Skip to content

Commit d55a54a

Browse files
[helm] agent preset replicas (#5981) (#5984)
* 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]>
1 parent 047b10c commit d55a54a

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

deploy/helm/elastic-agent/examples/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ Here is a collection of example configurations for the eck-integrations chart.
66
- [System - custom authlogs path](kubernetes-default/README.md)
77
- [Kubernetes - only container logs](kubernetes-only-logs/README.md)
88
- [Kubernetes - only hints autodiscover](kubernetes-hints-autodiscover/README.md)
9-
- [Custom Integration - nginx](nginx-custom-integration/README.md)
9+
- [Nginx - custom integration](nginx-custom-integration/README.md)
1010
- [Multiple Integrations](multiple-integrations/README.md)
1111
- [ECK - Kubernetes - defaults](eck/README.md)
12+
- [Fleet - Managed Agent](fleet-managed/README.md)
13+
- [User created cluster role](user-cluster-role/README.md)
14+
- [User created service account](user-service-account/README.md)
1215

1316
Useful links:
1417

1518
- [Kibana - Install and uninstall Elastic Agent integration assets](https://www.elastic.co/guide/en/fleet/current/install-uninstall-integration-assets.html)
1619
- [Kibana - Creating API Keys](https://www.elastic.co/guide/en/kibana/current/api-keys.html)
1720
- [Kibana - Create roles and users](https://www.elastic.co/guide/en/kibana/current/using-kibana-with-security.html#security-create-roles)
18-
- [ECK operator](https://github.com/elastic/cloud-on-k8s).
21+
- [ECK operator](https://github.com/elastic/cloud-on-k8s)
22+
- [Fleet - Manage Agents](https://www.elastic.co/guide/en/fleet/current/manage-agents-in-fleet.html)
23+
- [Fleet - Installing Elastic Agent](https://www.elastic.co/guide/en/fleet/current/install-fleet-managed-elastic-agent.html#elastic-agent-installation-steps)

deploy/helm/elastic-agent/examples/kubernetes-default/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ helm install elastic-agent ../../ \
3636
--set 'agent.imagePullSecrets[0].name=regcred' \
3737
--set outputs.default.type=ESSecretAuthAPI \
3838
--set outputs.default.secretName=es-api-secret
39+
```
3940

4041
## Validate:
4142

deploy/helm/elastic-agent/templates/agent/eck/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ spec:
3434
{{- end -}}
3535
{{- end }}
3636
deployment:
37-
{{- with ($presetVal).replicaCount }}
38-
replicas: {{ . }}
37+
{{- if hasKey $presetVal "replicaCount" }}
38+
replicas: {{ ($presetVal).replicaCount }}
3939
{{- end }}
4040
podTemplate:
4141
{{- toYaml ($podTemplateResource).template | nindent 6 }}

deploy/helm/elastic-agent/templates/agent/eck/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ spec:
3434
{{- end -}}
3535
{{- end }}
3636
statefulSet:
37-
{{- with ($presetVal).replicaCount }}
38-
replicas: {{ . }}
37+
{{- if hasKey $presetVal "replicaCount" }}
38+
replicas: {{ ($presetVal).replicaCount }}
3939
{{- end }}
4040
podTemplate:
4141
{{- toYaml ($podTemplateResource).template | nindent 6 }}

deploy/helm/elastic-agent/templates/agent/k8s/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ spec:
1717
selector:
1818
matchLabels:
1919
name: {{ $agentName }}
20+
{{- if hasKey $presetVal "replicaCount" }}
21+
replicas: {{ ($presetVal).replicaCount }}
22+
{{- end }}
2023
template:
2124
metadata:
2225
labels:

deploy/helm/elastic-agent/templates/agent/k8s/statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ spec:
1717
selector:
1818
matchLabels:
1919
name: {{ $agentName }}
20+
{{- if hasKey $presetVal "replicaCount" }}
21+
replicas: {{ ($presetVal).replicaCount }}
22+
{{- end }}
2023
template:
2124
metadata:
2225
labels:

0 commit comments

Comments
 (0)