Skip to content

Commit

Permalink
[castai-cluster-controller] Fix volume deployment when not specifying…
Browse files Browse the repository at this point in the history
… priority class (#666)

* Fix cluster controller deployment when not specifying priorityClass

Currently the definition of the shared-metadata volume in the pod is
guarded by the check for priorityClass. When not specifying this in
the helm values the volume is undefined in the resulting pod
definition but it's still referenced in the volume mounts. Fix this by
moving it out of the if clause.

* bump version

---------

Co-authored-by: Tobias Henkel <[email protected]>
  • Loading branch information
ValyaB and tobiashenkel authored Jan 13, 2025
1 parent e5c21d2 commit ab4cebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/castai-cluster-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: castai-cluster-controller
description: Cluster controller is responsible for handling certain Kubernetes actions such as draining and deleting nodes, adding labels, approving CSR requests.
type: application
version: 0.78.1
version: 0.78.2
appVersion: "v0.54.7"
annotations:
release-date: "2024-06-04T07:10:07"
Expand Down
7 changes: 3 additions & 4 deletions charts/castai-cluster-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ spec:
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }}
{{- end }}
{{- if and (.Capabilities.APIVersions.Has "scheduling.k8s.io/v1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version) (.Values.priorityClass | default dict).enabled }}
volumes:
- name: shared-metadata
emptyDir:
sizeLimit: 10Mi
{{- if and (.Capabilities.APIVersions.Has "scheduling.k8s.io/v1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version) (.Values.priorityClass | default dict).enabled }}
priorityClassName: {{ .Values.priorityClass.name }}
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.name }}
Expand Down Expand Up @@ -116,7 +116,7 @@ spec:
- name: {{ $k }}
value: "{{ $v }}"
{{- end }}
{{- if .Values.castai.clusterIdSecretKeyRef.name }}
{{- if .Values.castai.clusterIdSecretKeyRef.name }}
{{- if and (ne .Values.castai.clusterID "") (ne .Values.clusterID "") }}
{{- fail "clusterID and clusterIdSecretKeyRef are mutually exclusive" }}
{{- end }}
Expand Down Expand Up @@ -214,7 +214,7 @@ spec:
- name: {{ $k }}
value: "{{ $v }}"
{{- end }}
{{- if .Values.castai.clusterIdSecretKeyRef.name }}
{{- if .Values.castai.clusterIdSecretKeyRef.name }}
{{- if and (ne .Values.castai.clusterID "") (ne .Values.clusterID "") }}
{{- fail "clusterID and clusterIdSecretKeyRef are mutually exclusive" }}
{{- end }}
Expand Down Expand Up @@ -249,4 +249,3 @@ spec:
name: castai-cluster-controller
resources:
{{- .Values.monitor.resources | default dict | toYaml | nindent 12 }}

0 comments on commit ab4cebd

Please sign in to comment.