Skip to content

Commit

Permalink
helm: move initContainers to inside controller for consistency with p…
Browse files Browse the repository at this point in the history
…od settings (#5425)

Other pod-level settings are determined by the `controller` group of
settings, so initContainers should be inside of controller
(`controller.initContainers`) rather than a top-level field.
  • Loading branch information
rfratto authored Oct 10, 2023
1 parent 97d7604 commit d5338a2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
5 changes: 5 additions & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ internal API changes are not present.
Unreleased
----------

### Breaking changes

- The `initContainers` setting has been moved to `controller.initContainers`
for consistency with other Pod-level settings. (@rfratto)

### Enhancements

- Make CRDs optional through the `crds.create` setting. (@bentonam, @rfratto)
Expand Down
2 changes: 1 addition & 1 deletion operations/helm/charts/grafana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to
| controller.enableStatefulSetAutoDeletePVC | bool | `false` | Whether to enable automatic deletion of stale PVCs due to a scale down operation, when controller.type is 'statefulset'. |
| controller.hostNetwork | bool | `false` | Configures Pods to use the host network. When set to true, the ports that will be used must be specified. |
| controller.hostPID | bool | `false` | Configures Pods to use the host PID namespace. |
| controller.initContainers | list | `[]` | |
| controller.nodeSelector | object | `{}` | nodeSelector to apply to Grafana Agent pods. |
| controller.parallelRollout | bool | `true` | Whether to deploy pods in parallel. Only used when controller.type is 'statefulset'. |
| controller.podAnnotations | object | `{}` | Extra pod annotations to add. |
Expand Down Expand Up @@ -109,7 +110,6 @@ use the older mode (called "static mode"), set the `agent.mode` value to
| ingress.path | string | `"/"` | |
| ingress.pathType | string | `"Prefix"` | |
| ingress.tls | list | `[]` | |
| initContainers | list | `[]` | |
| nameOverride | string | `nil` | Overrides the chart's name. Used to change the infix in the resource names. |
| rbac.create | bool | `true` | Whether to create RBAC resources for the agent. |
| service.annotations | object | `{}` | |
Expand Down
37 changes: 19 additions & 18 deletions operations/helm/charts/grafana-agent/ci/initcontainers-values.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
initContainers:
- name: geo-ip
image: ghcr.io/maxmind/geoipupdate:v6.0
volumeMounts:
- name: geoip
mountPath: /etc/geoip
volumes:
- name: geoip
emptyDir: {}
env:
- name: GEOIPUPDATE_ACCOUNT_ID
value: "geoipupdate_account_id"
- name: GEOIPUPDATE_LICENSE_KEY
value: "geoipupdate_license_key"
- name: GEOIPUPDATE_EDITION_IDS
value: "GeoLite2-ASN GeoLite2-City GeoLite2-Country"
- name: GEOIPUPDATE_DB_DIR
value: "/etc/geoip"
controller:
initContainers:
- name: geo-ip
image: ghcr.io/maxmind/geoipupdate:v6.0
volumeMounts:
- name: geoip
mountPath: /etc/geoip
volumes:
- name: geoip
emptyDir: {}
env:
- name: GEOIPUPDATE_ACCOUNT_ID
value: "geoipupdate_account_id"
- name: GEOIPUPDATE_LICENSE_KEY
value: "geoipupdate_license_key"
- name: GEOIPUPDATE_EDITION_IDS
value: "GeoLite2-ASN GeoLite2-City GeoLite2-Country"
- name: GEOIPUPDATE_DB_DIR
value: "/etc/geoip"
volumes:
extra:
- name: geoip
mountPath: /etc/geoip

agent:
mounts:
extra:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ spec:
{{- toYaml .Values.image.pullSecrets | nindent 4 }}
{{- end }}
{{- end }}
{{- if .Values.initContainers }}
{{- if .Values.controller.initContainers }}
initContainers:
{{- with .Values.initContainers }}
{{- with .Values.controller.initContainers }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Expand Down
10 changes: 5 additions & 5 deletions operations/helm/charts/grafana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ global:
# -- Security context to apply to the Grafana Agent pod.
podSecurityContext: {}

## The init containers to run.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
##
initContainers: []

crds:
# -- Whether to install CRDs for monitoring.
create: true
Expand Down Expand Up @@ -210,6 +205,11 @@ controller:
# -- volumeClaimTemplates to add when controller.type is 'statefulset'.
volumeClaimTemplates: []

## -- Additional init containers to run.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
##
initContainers: []

service:
# -- Creates a Service for the controller's pods.
enabled: true
Expand Down

0 comments on commit d5338a2

Please sign in to comment.