Skip to content

Commit

Permalink
[helm] agent preset replicas (#5981) (#5984)
Browse files Browse the repository at this point in the history
* fix: set correct replicas of deployment and statefulset presets

* fix: examples markdown fixes

(cherry picked from commit f994f5b)

Co-authored-by: Panos Koutsovasilis <[email protected]>
  • Loading branch information
mergify[bot] and pkoutsovasilis authored Nov 8, 2024
1 parent 047b10c commit d55a54a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
9 changes: 7 additions & 2 deletions deploy/helm/elastic-agent/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ Here is a collection of example configurations for the eck-integrations chart.
- [System - custom authlogs path](kubernetes-default/README.md)
- [Kubernetes - only container logs](kubernetes-only-logs/README.md)
- [Kubernetes - only hints autodiscover](kubernetes-hints-autodiscover/README.md)
- [Custom Integration - nginx](nginx-custom-integration/README.md)
- [Nginx - custom integration](nginx-custom-integration/README.md)
- [Multiple Integrations](multiple-integrations/README.md)
- [ECK - Kubernetes - defaults](eck/README.md)
- [Fleet - Managed Agent](fleet-managed/README.md)
- [User created cluster role](user-cluster-role/README.md)
- [User created service account](user-service-account/README.md)

Useful links:

- [Kibana - Install and uninstall Elastic Agent integration assets](https://www.elastic.co/guide/en/fleet/current/install-uninstall-integration-assets.html)
- [Kibana - Creating API Keys](https://www.elastic.co/guide/en/kibana/current/api-keys.html)
- [Kibana - Create roles and users](https://www.elastic.co/guide/en/kibana/current/using-kibana-with-security.html#security-create-roles)
- [ECK operator](https://github.com/elastic/cloud-on-k8s).
- [ECK operator](https://github.com/elastic/cloud-on-k8s)
- [Fleet - Manage Agents](https://www.elastic.co/guide/en/fleet/current/manage-agents-in-fleet.html)
- [Fleet - Installing Elastic Agent](https://www.elastic.co/guide/en/fleet/current/install-fleet-managed-elastic-agent.html#elastic-agent-installation-steps)
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ helm install elastic-agent ../../ \
--set 'agent.imagePullSecrets[0].name=regcred' \
--set outputs.default.type=ESSecretAuthAPI \
--set outputs.default.secretName=es-api-secret
```

## Validate:

Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ spec:
{{- end -}}
{{- end }}
deployment:
{{- with ($presetVal).replicaCount }}
replicas: {{ . }}
{{- if hasKey $presetVal "replicaCount" }}
replicas: {{ ($presetVal).replicaCount }}
{{- end }}
podTemplate:
{{- toYaml ($podTemplateResource).template | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ spec:
{{- end -}}
{{- end }}
statefulSet:
{{- with ($presetVal).replicaCount }}
replicas: {{ . }}
{{- if hasKey $presetVal "replicaCount" }}
replicas: {{ ($presetVal).replicaCount }}
{{- end }}
podTemplate:
{{- toYaml ($podTemplateResource).template | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/elastic-agent/templates/agent/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
selector:
matchLabels:
name: {{ $agentName }}
{{- if hasKey $presetVal "replicaCount" }}
replicas: {{ ($presetVal).replicaCount }}
{{- end }}
template:
metadata:
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
selector:
matchLabels:
name: {{ $agentName }}
{{- if hasKey $presetVal "replicaCount" }}
replicas: {{ ($presetVal).replicaCount }}
{{- end }}
template:
metadata:
labels:
Expand Down

0 comments on commit d55a54a

Please sign in to comment.