Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Fleet recipes for default policy change #5281

Merged
merged 9 commits into from
Feb 2, 2022
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
- name: Elastic Agent on ECK policy
id: eck-agent
namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
juliaElastic marked this conversation as resolved.
Show resolved Hide resolved
is_default: true
unenroll_timeout: 900
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
juliaElastic marked this conversation as resolved.
Show resolved Hide resolved
---
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
29 changes: 23 additions & 6 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
version: 0.14.0
juliaElastic marked this conversation as resolved.
Show resolved Hide resolved
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