Skip to content

Improve helmchart template adding fields #4952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,37 @@ spec:
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot remove those

# - key: kubernetes.io/os
# operator: In
# values:
# - linux
# TODO(user): Uncomment the following code to configure the nodeSelector expression
# annotations, nodeSelector, tolerations, topologySpreadConstraints.
# nodeSelector:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be really added there or via kustomize? Is there a better way to configure it?
We will need to check out and either validate the scenario with e2e tests.
Could we have a PR for those and keep this one only for the imagePull ?

# disktype: ssd
# Annotations for the manager pod
# annotations:
# example-annotation: "value"
# Node selector for scheduling the manager pod
# nodeSelector:
# disktype: ssd
# Tolerations for the manager pod
# tolerations:
# - key: "key1"
# operator: "Equal"
# value: "value1"
# effect: "NoSchedule"
# Topology spread constraints for the manager pod
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: "topology.kubernetes.io/zone"
# whenUnsatisfiable: "ScheduleAnyway"
# labelSelector:
# matchLabels:
# app: controller-manager
# imagePullSecrets for pulling images from private registries
# imagePullSecrets:
# - name: myregistrykey
securityContext:
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
# This ensures that deployments meet the highest security requirements for Kubernetes.
Expand All @@ -65,6 +90,8 @@ spec:
- --health-probe-bind-address=:8081
image: controller:latest
name: manager
# imagePullPolicy for the manager container (e.g., Always, IfNotPresent, Never)
# imagePullPolicy: IfNotPresent
Comment on lines +93 to +94
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add that as default
Could we have a PR only for the image

ports: []
securityContext:
readOnlyRootFilesystem: true
Expand Down Expand Up @@ -93,7 +120,16 @@ spec:
requests:
cpu: 10m
memory: 64Mi
# Extra volumeMounts for the manager container
# volumeMounts:
# - name: extra-config
# mountPath: /etc/extra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know if that will work with the patches but is a good call I think we need a PR for that and e2e tests to ensure that we do not break the behaviour

volumeMounts: []
# Extra volumes for the manager pod
# volumes:
# - name: extra-config
# configMap:
# name: extra-config
volumes: []
serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
{{- with .Values.controllerManager.pod.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "chart.labels" . | nindent 8 }}
control-plane: controller-manager
Expand Down Expand Up @@ -67,11 +70,34 @@ spec:
mountPath: /tmp/k8s-metrics-server/metrics-certs
readOnly: true
{{- end }}
{{- with .Values.controllerManager.pod.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.controllerManager.securityContext | nindent 8 }}
serviceAccountName: {{ .Values.controllerManager.serviceAccountName }}
terminationGracePeriodSeconds: {{ .Values.controllerManager.terminationGracePeriodSeconds }}
{{- with .Values.controllerManager.pod.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and .Values.certmanager.enable (or .Values.webhook.enable .Values.metrics.enable) }}
volumes:
{{- if and .Values.webhook.enable .Values.certmanager.enable }}
Expand All @@ -84,4 +110,7 @@ spec:
secret:
secretName: metrics-server-cert
{{- end }}
{{- with .Values.controllerManager.pod.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# [MANAGER]: Manager Deployment Configurations
controllerManager:
replicas: 1
pod:
# imagePullSecrets for pulling images from private registries
imagePullSecrets: []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I liked it 👍 less the pod above since all here would be only about controller-manager
See : #4912
The person made a valid feedback about how we are exposing the values

I think we will need to change that we might need a PR just to change what we have today on that
but I want to share it with you.

# nodeSelector for scheduling the manager pod
nodeSelector: {}
# affinity rules for the manager pod
affinity: {}
# tolerations for the manager pod
tolerations: []
# topologySpreadConstraints for the manager pod
topologySpreadConstraints: []
# extraVolumeMounts for additional volumeMounts in the manager container
extraVolumeMounts: []
# extraVolumes for additional volumes in the manager pod
extraVolumes: []
# annotations for the manager pod
annotations: {}
container:
image:
repository: controller
tag: latest
# imagePullPolicy for the manager container (e.g., Always, IfNotPresent, Never)
imagePullPolicy: IfNotPresent
args:
- "--leader-elect"
- "--metrics-bind-address=:8443"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,37 @@ spec:
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
# TODO(user): Uncomment the following code to configure the nodeSelector expression
# annotations, nodeSelector, tolerations, topologySpreadConstraints.
# nodeSelector:
# disktype: ssd
# Annotations for the manager pod
# annotations:
# example-annotation: "value"
# Node selector for scheduling the manager pod
# nodeSelector:
# disktype: ssd
# Tolerations for the manager pod
# tolerations:
# - key: "key1"
# operator: "Equal"
# value: "value1"
# effect: "NoSchedule"
# Topology spread constraints for the manager pod
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: "topology.kubernetes.io/zone"
# whenUnsatisfiable: "ScheduleAnyway"
# labelSelector:
# matchLabels:
# app: controller-manager
# imagePullSecrets for pulling images from private registries
# imagePullSecrets:
# - name: myregistrykey
securityContext:
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
# This ensures that deployments meet the highest security requirements for Kubernetes.
Expand All @@ -65,6 +90,8 @@ spec:
- --health-probe-bind-address=:8081
image: controller:latest
name: manager
# imagePullPolicy for the manager container (e.g., Always, IfNotPresent, Never)
# imagePullPolicy: IfNotPresent
ports: []
securityContext:
readOnlyRootFilesystem: true
Expand Down Expand Up @@ -93,7 +120,16 @@ spec:
requests:
cpu: 10m
memory: 64Mi
# Extra volumeMounts for the manager container
# volumeMounts:
# - name: extra-config
# mountPath: /etc/extra
volumeMounts: []
# Extra volumes for the manager pod
# volumes:
# - name: extra-config
# configMap:
# name: extra-config
volumes: []
serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
{{- with .Values.controllerManager.pod.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "chart.labels" . | nindent 8 }}
control-plane: controller-manager
Expand Down Expand Up @@ -56,16 +59,42 @@ spec:
mountPath: /tmp/k8s-metrics-server/metrics-certs
readOnly: true
{{- end }}
{{- with .Values.controllerManager.pod.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.controllerManager.securityContext | nindent 8 }}
serviceAccountName: {{ .Values.controllerManager.serviceAccountName }}
terminationGracePeriodSeconds: {{ .Values.controllerManager.terminationGracePeriodSeconds }}
{{- with .Values.controllerManager.pod.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controllerManager.pod.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and .Values.certmanager.enable .Values.metrics.enable }}
volumes:
{{- if and .Values.metrics.enable .Values.certmanager.enable }}
- name: metrics-certs
secret:
secretName: metrics-server-cert
{{- end }}
{{- with .Values.controllerManager.pod.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# [MANAGER]: Manager Deployment Configurations
controllerManager:
replicas: 1
pod:
# imagePullSecrets for pulling images from private registries
imagePullSecrets: []
# nodeSelector for scheduling the manager pod
nodeSelector: {}
# affinity rules for the manager pod
affinity: {}
# tolerations for the manager pod
tolerations: []
# topologySpreadConstraints for the manager pod
topologySpreadConstraints: []
# extraVolumeMounts for additional volumeMounts in the manager container
extraVolumeMounts: []
# extraVolumes for additional volumes in the manager pod
extraVolumes: []
# annotations for the manager pod
annotations: {}
container:
image:
repository: controller
tag: latest
# imagePullPolicy for the manager container (e.g., Always, IfNotPresent, Never)
imagePullPolicy: IfNotPresent
args:
- "--leader-elect"
- "--metrics-bind-address=:8443"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,37 @@ spec:
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
# TODO(user): Uncomment the following code to configure the nodeSelector expression
# annotations, nodeSelector, tolerations, topologySpreadConstraints.
# nodeSelector:
# disktype: ssd
# Annotations for the manager pod
# annotations:
# example-annotation: "value"
# Node selector for scheduling the manager pod
# nodeSelector:
# disktype: ssd
# Tolerations for the manager pod
# tolerations:
# - key: "key1"
# operator: "Equal"
# value: "value1"
# effect: "NoSchedule"
# Topology spread constraints for the manager pod
# topologySpreadConstraints:
# - maxSkew: 1
# topologyKey: "topology.kubernetes.io/zone"
# whenUnsatisfiable: "ScheduleAnyway"
# labelSelector:
# matchLabels:
# app: controller-manager
# imagePullSecrets for pulling images from private registries
# imagePullSecrets:
# - name: myregistrykey
securityContext:
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
# This ensures that deployments meet the highest security requirements for Kubernetes.
Expand All @@ -65,6 +90,8 @@ spec:
- --health-probe-bind-address=:8081
image: controller:latest
name: manager
# imagePullPolicy for the manager container (e.g., Always, IfNotPresent, Never)
# imagePullPolicy: IfNotPresent
ports: []
securityContext:
readOnlyRootFilesystem: true
Expand Down Expand Up @@ -93,7 +120,16 @@ spec:
requests:
cpu: 10m
memory: 64Mi
# Extra volumeMounts for the manager container
# volumeMounts:
# - name: extra-config
# mountPath: /etc/extra
volumeMounts: []
# Extra volumes for the manager pod
# volumes:
# - name: extra-config
# configMap:
# name: extra-config
volumes: []
serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
Loading