-
Notifications
You must be signed in to change notification settings - Fork 734
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
Remove is_default
and is_default_fleet_server
flag from ECK recipes
#6678
Comments
It's actually not just a doc change. We do rely on these flags to detect what policy should be used: cloud-on-k8s/pkg/controller/agent/fleet.go Lines 209 to 227 in 6dd1ba1
I can see 2 alternatives so far:
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: fleet-server
spec:
policyID: eck-fleet-server ## Here
version: 8.7.0
kibanaRef:
name: kibana
elasticsearchRefs:
- name: elasticsearch
mode: fleet
fleetServerEnabled: true
deployment:
replicas: 1
podTemplate:
spec:
serviceAccountName: fleet-server
automountServiceAccountToken: true
securityContext:
runAsUser: 0
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: elastic-agent
spec:
policyID: eck-agent ## Here
version: 8.7.0
kibanaRef:
name: kibana
fleetServerRef:
name: fleet-server
mode: fleet
daemonSet:
podTemplate:
spec:
serviceAccountName: elastic-agent
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
automountServiceAccountToken: true
securityContext:
runAsUser: 0 |
My idea was to automatically detect a "Default Fleet Server policy" and a "Default Agent Policy" as long as the following conditions were met:
Unfortunately, without {
"items": [{
"id": "eck-agent",
"namespace": "default",
"monitoring_enabled": ["logs", "metrics"],
"name": "Elastic Agent on ECK policy",
"unenroll_timeout": 900,
"inactivity_timeout": 1209600,
"is_preconfigured": true,
"status": "active",
"is_managed": false,
"revision": 3,
"updated_at": "2023-04-24T14:44:26.541Z",
"updated_by": "system",
"schema_version": "1.0.0",
"agents": 0
}, {
"id": "eck-fleet-server",
"namespace": "default",
"monitoring_enabled": ["logs", "metrics"],
"name": "Fleet Server on ECK policy",
"unenroll_timeout": 900,
"inactivity_timeout": 1209600,
"is_preconfigured": true,
"status": "active",
"is_managed": false,
"revision": 2,
"updated_at": "2023-04-24T14:44:20.503Z",
"updated_by": "system",
"schema_version": "1.0.0",
"agents": 0
}],
"total": 2,
"page": 1,
"perPage": 20
} While poking around with the Fleet API, by using the "package_policies": [{
"id": "fleet_server-1",
"version": "WzY5MSwxXQ==",
"name": "fleet_server-1",
"namespace": "default",
"package": {
"name": "fleet_server", ## Here
"title": "Fleet Server",
"version": "1.2.0"
}, @juliaElastic please let me know if my reasoning is correct 🙏 Unless someone else has an idea, I think I'll create a PR to make |
@barkbay Yes, the policy with the Would it be possible to remove the |
Flags
is_default
andis_default_fleet_server
are deprecated since 8.1.Remove these from ECK recipes:
https://github.com/elastic/cloud-on-k8s/blob/main/config/recipes/elastic-agent/fleet-kubernetes-integration.yaml#L30
The change should be tested, so that Fleet on Kubernetes still works after removing these flags.
Originally posted by @jen-huang in elastic/ingest-docs#76 (comment)
The text was updated successfully, but these errors were encountered: