From 758a51441e9537133fe8bf7df28e7183ef057a54 Mon Sep 17 00:00:00 2001 From: Vlad Yarotsky <472161+v-yarotsky@users.noreply.github.com> Date: Thu, 8 Feb 2024 09:15:21 -0800 Subject: [PATCH] Fix `nodeSelector`, `affinity`, `tolerations` in the Helm chart (#548) ## Proposed changes `nodeSelector`, `affinity`, and `tolerations` are currently ignored unless `initContainers` is set to a non-empty value, due to a misplaced `if` in the template. This change fixes the issue. --------- Co-authored-by: Ramon Quitales Co-authored-by: Engin Diri --- CHANGELOG.md | 2 ++ deploy/helm/pulumi-operator/Chart.yaml | 4 ++-- deploy/helm/pulumi-operator/README.md | 6 +++--- deploy/helm/pulumi-operator/templates/deployment.yaml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7422b94c..ccfc0eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ CHANGELOG ========= ## HEAD (unreleased) +- Fixed `nodeSelector`, `affinity`, and `tolerations` Helm chart values that were previously effectively ignored. + [#548](https://github.com/pulumi/pulumi-kubernetes-operator/pull/548) ## 1.14.0 (2023-11-08) - Changed indentation in deploy/helm/pulumi-operator/templates/deployment.yaml for volumes and volumeMounts. diff --git a/deploy/helm/pulumi-operator/Chart.yaml b/deploy/helm/pulumi-operator/Chart.yaml index 5946b12f..7e8919c1 100755 --- a/deploy/helm/pulumi-operator/Chart.yaml +++ b/deploy/helm/pulumi-operator/Chart.yaml @@ -9,7 +9,7 @@ icon: https://www.pulumi.com/logos/brand/twitter-card.png type: application -version: 0.5.0 +version: 0.6.0 appVersion: 1.14.0 keywords: @@ -25,7 +25,7 @@ maintainers: annotations: artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/changes: | - - set terminationGracePeriodSeconds for HelmCharts (#520) + - Fix nodeSelector, affinity, tolerations in the Helm chart (#548) artifacthub.io/images: | - name: pulumi-kubernetes-operator image: docker.io/pulumi-kubernetes-operator:v1.14.0 diff --git a/deploy/helm/pulumi-operator/README.md b/deploy/helm/pulumi-operator/README.md index 51f45a3b..f231bba3 100644 --- a/deploy/helm/pulumi-operator/README.md +++ b/deploy/helm/pulumi-operator/README.md @@ -1,6 +1,6 @@ # node-red ⚙ -![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 1.14.0](https://img.shields.io/badge/AppVersion-1.14.0-informational?style=for-the-badge) +![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 1.14.0](https://img.shields.io/badge/AppVersion-1.14.0-informational?style=for-the-badge) ## Description 📜 @@ -11,7 +11,7 @@ A Helm chart for the Pulumi Kubernetes Operator To install the chart using the OCI artifact, run: ```bash -helm install pulumi-kubernetes-operator oci://ghcr.io/pulumi/helm-charts/pulumi-kubernetes-operator --version 0.5.0 +helm install pulumi-kubernetes-operator oci://ghcr.io/pulumi/helm-charts/pulumi-kubernetes-operator --version 0.6.0 ``` ## Usage @@ -27,7 +27,7 @@ helm repo update To install the chart with the release name `pulumi-kubernetes-operator` run: ```bash -helm install pulumi-kubernetes-operator pulumi-kubernetes-operator/pulumi-kubernetes-operator --version 0.5.0 +helm install pulumi-kubernetes-operator pulumi-kubernetes-operator/pulumi-kubernetes-operator --version 0.6.0 ``` After a few seconds, the `pulumi-kubernetes-operator` should be running. diff --git a/deploy/helm/pulumi-operator/templates/deployment.yaml b/deploy/helm/pulumi-operator/templates/deployment.yaml index 09f6a96f..5c041b49 100644 --- a/deploy/helm/pulumi-operator/templates/deployment.yaml +++ b/deploy/helm/pulumi-operator/templates/deployment.yaml @@ -90,7 +90,6 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- end }} - {{- if .Values.initContainers }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -103,6 +102,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.initContainers }} initContainers: {{- with .Values.initContainers }} {{- toYaml . | nindent 6 }}