Skip to content

Commit

Permalink
feat(helm): add support for controlplane deployment annotations
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Beaumont <mjboamail@gmail.com>
Signed-off-by: slavogiez <stephane.lavogiez@gmail.com>
  • Loading branch information
slavogiez and michaelbeaumont committed Oct 9, 2023
1 parent 71f9c31 commit e9298b9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ controlPlane:
# -- Minimum number of seconds for which a newly created pod should be ready for it to be considered available.
minReadySeconds: 0

# -- Control Plane Pod Annotations
# -- Annotations applied only to the `Deployment` resource
deploymentAnnotations: {}

# -- Annotations applied only to the `Pod` resource
podAnnotations: {}

# Horizontal Pod Autoscaling configuration
Expand Down
3 changes: 2 additions & 1 deletion deployments/charts/kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ A Helm chart for the Kuma Control Plane
| controlPlane.kdsGlobalAddress | string | `""` | Only used in `zone` mode |
| controlPlane.replicas | int | `1` | Number of replicas of the Kuma CP. Ignored when autoscaling is enabled |
| controlPlane.minReadySeconds | int | `0` | Minimum number of seconds for which a newly created pod should be ready for it to be considered available. |
| controlPlane.podAnnotations | object | `{}` | Control Plane Pod Annotations |
| controlPlane.deploymentAnnotations | object | `{}` | Annotations applied only to the `Deployment` resource |
| controlPlane.podAnnotations | object | `{}` | Annotations applied only to the `Pod` resource |
| controlPlane.autoscaling.enabled | bool | `false` | Whether to enable Horizontal Pod Autoscaling, which requires the [Metrics Server](https://github.com/kubernetes-sigs/metrics-server) in the cluster |
| controlPlane.autoscaling.minReplicas | int | `2` | The minimum CP pods to allow |
| controlPlane.autoscaling.maxReplicas | int | `5` | The max CP pods to scale to |
Expand Down
9 changes: 9 additions & 0 deletions deployments/charts/kuma/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ app: {{ include "kuma.name" . }}-control-plane
{{ include "kuma.labels" . }}
{{- end }}

{{/*
control plane deployment annotations
*/}}
{{- define "kuma.cpDeploymentAnnotations" -}}
{{- range $key, $value := $.Values.controlPlane.deploymentAnnotations }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
ingress labels
*/}}
Expand Down
1 change: 1 addition & 0 deletions deployments/charts/kuma/templates/cp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ metadata:
name: {{ include "kuma.name" . }}-control-plane
namespace: {{ .Release.Namespace }}
labels: {{ include "kuma.cpLabels" . | nindent 4 }}
annotations: {{ include "kuma.cpDeploymentAnnotations" . | nindent 4 }}
spec:
{{- if not .Values.controlPlane.autoscaling.enabled }}
replicas: {{ .Values.controlPlane.replicas }}
Expand Down
5 changes: 4 additions & 1 deletion deployments/charts/kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ controlPlane:
# -- Minimum number of seconds for which a newly created pod should be ready for it to be considered available.
minReadySeconds: 0

# -- Control Plane Pod Annotations
# -- Annotations applied only to the `Deployment` resource
deploymentAnnotations: {}

# -- Annotations applied only to the `Pod` resource
podAnnotations: {}

# Horizontal Pod Autoscaling configuration
Expand Down
5 changes: 4 additions & 1 deletion docs/generated/raw/helm-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ controlPlane:
# -- Minimum number of seconds for which a newly created pod should be ready for it to be considered available.
minReadySeconds: 0

# -- Control Plane Pod Annotations
# -- Annotations applied only to the `Deployment` resource
deploymentAnnotations: {}

# -- Annotations applied only to the `Pod` resource
podAnnotations: {}

# Horizontal Pod Autoscaling configuration
Expand Down

0 comments on commit e9298b9

Please sign in to comment.