Skip to content

Commit

Permalink
feat(helm): add support for controlplane deployment annotations (#7959)
Browse files Browse the repository at this point in the history
Signed-off-by: slavogiez <stephane.lavogiez@gmail.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Beaumont <mjboamail@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 13, 2023
1 parent 55696b8 commit e80604b
Show file tree
Hide file tree
Showing 34 changed files with 80 additions and 8 deletions.
6 changes: 2 additions & 4 deletions api/mesh/v1alpha1/kds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ message KumaResource {
google.protobuf.Any spec = 2;
}

message ZoneHealthCheckRequest {
}
message ZoneHealthCheckRequest {}

message ZoneHealthCheckResponse {
}
message ZoneHealthCheckResponse {}

service GlobalKDSService {
// StreamXDSConfigs is logically a service exposed by Zone CP so Global CP can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6384,6 +6384,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -6384,6 +6384,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6590,6 +6590,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6446,6 +6446,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 2
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ metadata:
"foo": "baz"
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ metadata:
"foo": "bar"
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ metadata:
app: kuma-control-plane
app.kubernetes.io/name: kuma
app.kubernetes.io/instance: kuma
annotations:

spec:
replicas: 1
minReadySeconds: 0
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 e80604b

Please sign in to comment.