Skip to content

Commit

Permalink
Adjust Fleet recipes for default policy change (#5281)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic authored Feb 2, 2022
1 parent e38f85f commit 4504f93
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 17 deletions.
33 changes: 27 additions & 6 deletions config/recipes/elastic-agent/fleet-apm-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,40 @@ spec:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.default.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.default.svc:8220"]
xpack.fleet.packages:
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
- name: apm
version: latest
xpack.fleet.agentPolicies:
- name: Default Fleet Server on ECK policy
- name: Fleet Server on ECK policy
id: eck-fleet-server
is_default_fleet_server: true
namespace: default
monitoring_enabled:
- logs
- metrics
package_policies:
- package:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
name: fleet_server-1
- name: Default Elastic Agent on ECK policy
is_default: true
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
package_policies:
- name: system-1
id: system-1
package:
name: system
- package:
name: apm
name: apm-1
Expand All @@ -32,7 +53,7 @@ spec:
enabled: true
vars:
- name: host
value: 0.0.0.0:8200
value: 0.0.0.0:8200
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
Expand Down
33 changes: 27 additions & 6 deletions config/recipes/elastic-agent/fleet-custom-logs-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,40 @@ spec:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.default.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.default.svc:8220"]
xpack.fleet.packages:
- name: log
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
- name: log
version: latest
xpack.fleet.agentPolicies:
- name: Default Fleet Server on ECK policy
- name: Fleet Server on ECK policy
id: eck-fleet-server
namespace: default
monitoring_enabled:
- logs
- metrics
is_default_fleet_server: true
package_policies:
- package:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
name: fleet_server-1
- name: Default Elastic Agent on ECK policy
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
unenroll_timeout: 900
package_policies:
- name: system-1
id: system-1
package:
name: system
- package:
name: log
name: log-1
Expand Down
27 changes: 22 additions & 5 deletions config/recipes/elastic-agent/fleet-kubernetes-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,37 @@ spec:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.default.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.default.svc:8220"]
xpack.fleet.packages:
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
- name: kubernetes
# pinning this version as the next one introduced a kube-proxy host setting default that breaks this recipe,
# see https://github.com/elastic/integrations/pull/1565 for more details
version: 0.14.0
xpack.fleet.agentPolicies:
- name: Default Fleet Server on ECK policy
- name: Fleet Server on ECK policy
id: eck-fleet-server
namespace: default
monitoring_enabled:
- logs
- metrics
is_default_fleet_server: true
package_policies:
- package:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
name: fleet_server-1
- name: Default Elastic Agent on ECK policy
is_default: true
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
package_policies:
- package:
name: system
Expand Down
70 changes: 70 additions & 0 deletions docs/orchestrating-elastic-stack-applications/agent-fleet.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,39 @@ spec:
config:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-quickstart-es-http.default.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-quickstart-agent-http.default.svc:8220"]
xpack.fleet.packages:
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
xpack.fleet.agentPolicies:
- name: Fleet Server on ECK policy
id: eck-fleet-server
is_default_fleet_server: true
namespace: default
monitoring_enabled:
- logs
- metrics
package_policies:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
package_policies:
- name: system-1
id: system-1
package:
name: system
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
Expand Down Expand Up @@ -232,12 +265,49 @@ spec:
config:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-sample-es-http.default.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-sample-agent-http.default.svc:8220"]
xpack.fleet.packages:
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
xpack.fleet.agentPolicies:
- name: Fleet Server on ECK policy
id: eck-fleet-server
is_default_fleet_server: true
namespace: default
monitoring_enabled:
- logs
- metrics
package_policies:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
package_policies:
- name: system-1
id: system-1
package:
name: system
----

* `xpack.fleet.agents.elasticsearch.hosts` must point to the Elasticsearch cluster that Elastic Agents should send data to. For ECK-managed Elasticsearch clusters, ECK creates a Service accessible through `https://ES_RESOURCE_NAME-es-http.ES_RESOURCE_NAMESPACE.svc:9200` URL, where `ES_RESOURCE_NAME` is the name of Elasticsearch resource and `ES_RESOURCE_NAMESPACE` is the namespace it was deployed in.

* `xpack.fleet.agents.fleet_server.hosts` must point to Fleet Server that Elastic Agents should connect to. For ECK-managed Fleet Server instances, ECK creates a Service accessible through `https://FS_RESOURCE_NAME-agent-http.FS_RESOURCE_NAMESPACE.svc:8220` URL, where `FS_RESOURCE_NAME` is the name of Elastic Agent resource with Fleet Server enabled and `FS_RESOURCE_NAMESPACE` is the namespace it was deployed in.

* `xpack.fleet.packages` are required packages to enable Fleet Server and Elastic Agents to enroll.

* `xpack.fleet.agentPolicies` policies are needed for Fleet Server and Elastic Agents to enroll to, check https://www.elastic.co/guide/en/fleet/current/agent-policy.html for more information.

[id="{p}-elastic-agent-fleet-configuration-setting-referenced-resources"]
=== Set referenced resources

Expand Down

0 comments on commit 4504f93

Please sign in to comment.