From 13ad4764b2cd70c60b0f72d67ae3eec0e289f2ab Mon Sep 17 00:00:00 2001 From: mentlak0 Date: Mon, 17 Jul 2023 21:03:28 +0100 Subject: [PATCH 1/2] feat: add deployment node tolerations --- .github/workflows/increment-version.yml | 35 +++++++++++++++++++ .github/workflows/publish.yml | 19 +--------- charts/tekton-pipeline/Chart.yaml | 2 +- .../tekton-pipelines-controller-deploy.yaml | 23 ++++++++++++ .../tekton-pipelines-webhook-deploy.yaml | 10 ++++++ .../tekton-pipelines-controller-deploy.yaml | 11 ++++++ ...ton-pipelines-remote-resolvers-deploy.yaml | 9 +++++ .../tekton-pipelines-webhook-deploy.yaml | 8 +++++ charts/tekton-pipeline/values.yaml | 15 ++++++++ ...ton-pipelines-remote-resolvers-deploy.yaml | 9 +++++ 10 files changed, 122 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/increment-version.yml diff --git a/.github/workflows/increment-version.yml b/.github/workflows/increment-version.yml new file mode 100644 index 0000000..1bbdf7a --- /dev/null +++ b/.github/workflows/increment-version.yml @@ -0,0 +1,35 @@ +name: Increment Version + +on: [pull_request, pull_request_target] + +jobs: + build: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: check source code + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.ACCESS_TOKEN }} + + + - name: next release version + id: nextversion + uses: jenkins-x-plugins/jx-release-version@v2.6.11 + with: + previous-version: from-file:charts/tekton-pipeline/Chart.yaml + + - name: Update version in Chart.yaml + id: updatechart + uses: mikefarah/yq@v4.34.1 + with: + cmd: yq eval '.version = "${{ steps.nextversion.outputs.version }}"' -i charts/tekton-pipeline/Chart.yaml + + - name: Commit Changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'chore: update Chart.yaml' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c94d199..e5bbfb8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,24 +11,7 @@ jobs: steps: - name: check source code uses: actions/checkout@v3 - - - name: next release version - id: nextversion - uses: jenkins-x-plugins/jx-release-version@v2.6.11 - with: - previous-version: from-file:charts/tekton-pipeline/Chart.yaml - - - name: Update version in Chart.yaml - id: updatechart - uses: mikefarah/yq@v4.34.1 - with: - cmd: yq eval '.version = "${{ steps.nextversion.outputs.version }}"' -i charts/tekton-pipeline/Chart.yaml - - - name: Commit Changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: 'chore: update Chart.yaml' - + - uses: J12934/helm-gh-pages-action@master with: access-token: ${{ secrets.ACCESS_TOKEN }} diff --git a/charts/tekton-pipeline/Chart.yaml b/charts/tekton-pipeline/Chart.yaml index 245c81f..486b56d 100644 --- a/charts/tekton-pipeline/Chart.yaml +++ b/charts/tekton-pipeline/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart for Tekton Pipelines name: tekton-pipeline -version: 0.6.4 +version: 1.0.0 appVersion: 0.42.0 icon: https://avatars2.githubusercontent.com/u/47602533 home: https://github.com/cdfoundation/tekton-helm-chart diff --git a/charts/tekton-pipeline/patches/tekton-pipelines-controller-deploy.yaml b/charts/tekton-pipeline/patches/tekton-pipelines-controller-deploy.yaml index 2d3914e..008455a 100644 --- a/charts/tekton-pipeline/patches/tekton-pipelines-controller-deploy.yaml +++ b/charts/tekton-pipeline/patches/tekton-pipelines-controller-deploy.yaml @@ -22,6 +22,19 @@ spec: {{- toYaml . | nindent 8 }} {{- end}} spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - helmTemplateRemoveMe: | + {{- with .Values.controllerDeploymentTolerations.nodeSelectorTerms }} + {{- toYaml . | nindent 12 }} + {{- end}} + - matchExpressions: + - key: kubernetes.io/os + operator: NotIn + values: + - windows containers: - name: tekton-pipelines-controller envFrom: @@ -30,3 +43,13 @@ spec: optional: true helmTemplateRemoveMe: | image: {{ .Values.controller.deployment.image }} + nodeSelector: + helmTemplateRemoveMe: | + {{- with .Values.controllerDeploymentTolerations.nodeSelector }} + {{- toYaml . | nindent 8 }} + {{- end}} + tolerations: + - helmTemplateRemoveMe: | + {{- with .Values.controllerDeploymentTolerations.tolerations }} + {{- toYaml . | nindent 6 }} + {{- end}} diff --git a/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml b/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml index be7b112..9b20f2c 100644 --- a/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml +++ b/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml @@ -22,3 +22,13 @@ spec: - secretRef: name: "{{ .Values.webhook.envFromSecret }}" optional: true + nodeSelector: + helmTemplateRemoveMe: | + {{- with .Values.webhookDeploymentTolerations.nodeSelector }} + {{- toYaml . | nindent 8 }} + {{- end}} + tolerations: + - helmTemplateRemoveMe: | + {{- with .Values.webhookDeploymentTolerations.tolerations }} + {{- toYaml . | nindent 6 }} + {{- end}} \ No newline at end of file diff --git a/charts/tekton-pipeline/templates/tekton-pipelines-controller-deploy.yaml b/charts/tekton-pipeline/templates/tekton-pipelines-controller-deploy.yaml index ee94794..e023131 100644 --- a/charts/tekton-pipeline/templates/tekton-pipelines-controller-deploy.yaml +++ b/charts/tekton-pipeline/templates/tekton-pipelines-controller-deploy.yaml @@ -45,6 +45,9 @@ spec: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: + {{- with .Values.controllerDeploymentTolerations.nodeSelectorTerms }} + {{- toYaml . | nindent 12 }} + {{- end}} - matchExpressions: - key: kubernetes.io/os operator: NotIn @@ -147,7 +150,15 @@ spec: name: verification-secrets readOnly: true image: {{ .Values.controller.deployment.image }} + nodeSelector: + {{- with .Values.controllerDeploymentTolerations.nodeSelector }} + {{- toYaml . | nindent 8 }} + {{- end}} serviceAccountName: tekton-pipelines-controller + tolerations: + {{- with .Values.controllerDeploymentTolerations.tolerations }} + {{- toYaml . | nindent 6 }} + {{- end}} volumes: - configMap: name: config-logging diff --git a/charts/tekton-pipeline/templates/tekton-pipelines-remote-resolvers-deploy.yaml b/charts/tekton-pipeline/templates/tekton-pipelines-remote-resolvers-deploy.yaml index 02f0709..ed7136c 100644 --- a/charts/tekton-pipeline/templates/tekton-pipelines-remote-resolvers-deploy.yaml +++ b/charts/tekton-pipeline/templates/tekton-pipelines-remote-resolvers-deploy.yaml @@ -59,7 +59,16 @@ spec: app.kubernetes.io/part-of: tekton-pipelines topologyKey: kubernetes.io/hostname weight: 100 + {{- with .Values.resolverDeploymentTolerations.nodeAffinity }} + nodeAffinity: {{- toYaml . | trim | nindent 10 }} + {{- end }} + {{- with .Values.resolverDeploymentTolerations.nodeSelector }} + nodeSelector: {{- toYaml . | trim | nindent 10 }} + {{- end }} serviceAccountName: tekton-pipelines-resolvers + {{- with .Values.resolverDeploymentTolerations.tolerations }} + tolerations: {{- toYaml . | trim | nindent 6 }} + {{- end }} containers: - name: controller image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/resolvers:v0.42.0@sha256:eaa7d21d45f0bc1c411823d6a943e668c820f9cf52f1549d188edb89e992f6e0 diff --git a/charts/tekton-pipeline/templates/tekton-pipelines-webhook-deploy.yaml b/charts/tekton-pipeline/templates/tekton-pipelines-webhook-deploy.yaml index 8913adc..4499d86 100644 --- a/charts/tekton-pipeline/templates/tekton-pipelines-webhook-deploy.yaml +++ b/charts/tekton-pipeline/templates/tekton-pipelines-webhook-deploy.yaml @@ -125,4 +125,12 @@ spec: runAsUser: 65532 seccompProfile: type: RuntimeDefault + nodeSelector: + {{- with .Values.webhookDeploymentTolerations.nodeSelector }} + {{- toYaml . | nindent 8 }} + {{- end}} serviceAccountName: tekton-pipelines-webhook + tolerations: + {{- with .Values.webhookDeploymentTolerations.tolerations }} + {{- toYaml . | nindent 6 }} + {{- end}} diff --git a/charts/tekton-pipeline/values.yaml b/charts/tekton-pipeline/values.yaml index c892bb2..4feda48 100644 --- a/charts/tekton-pipeline/values.yaml +++ b/charts/tekton-pipeline/values.yaml @@ -94,6 +94,21 @@ remoteResolversPod: requests: cpu: 100m memory: 100Mi +# Add node affinity tolerations for tekton-remote-resolvers +resolverDeploymentTolerations: + nodeAffinity: [] + nodeSelector: [] + tolerations: [] +# Add node affinity tolerations for tekton-pipeline-controller +controllerDeploymentTolerations: + nodeSelectorTerms: [] + nodeSelector: [] + tolerations: [] +# Add node affinity tolerations for tekton-pipelines-webhook +webhookDeploymentTolerations: + nodeSelectorTerms: [] + nodeSelector: [] + tolerations: [] gitResolverConfig: # The maximum amount of time a single anonymous cloning resolution may take. fetch-timeout: "1m" diff --git a/src/templates/tekton-pipelines-remote-resolvers-deploy.yaml b/src/templates/tekton-pipelines-remote-resolvers-deploy.yaml index 02f0709..ed7136c 100644 --- a/src/templates/tekton-pipelines-remote-resolvers-deploy.yaml +++ b/src/templates/tekton-pipelines-remote-resolvers-deploy.yaml @@ -59,7 +59,16 @@ spec: app.kubernetes.io/part-of: tekton-pipelines topologyKey: kubernetes.io/hostname weight: 100 + {{- with .Values.resolverDeploymentTolerations.nodeAffinity }} + nodeAffinity: {{- toYaml . | trim | nindent 10 }} + {{- end }} + {{- with .Values.resolverDeploymentTolerations.nodeSelector }} + nodeSelector: {{- toYaml . | trim | nindent 10 }} + {{- end }} serviceAccountName: tekton-pipelines-resolvers + {{- with .Values.resolverDeploymentTolerations.tolerations }} + tolerations: {{- toYaml . | trim | nindent 6 }} + {{- end }} containers: - name: controller image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/resolvers:v0.42.0@sha256:eaa7d21d45f0bc1c411823d6a943e668c820f9cf52f1549d188edb89e992f6e0 From 90ebb1ef544f17444916779a4010f84ec06ce3f6 Mon Sep 17 00:00:00 2001 From: mentlak0 Date: Mon, 17 Jul 2023 21:04:25 +0100 Subject: [PATCH 2/2] feat: add new line --- .../patches/tekton-pipelines-webhook-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml b/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml index 9b20f2c..ed3676e 100644 --- a/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml +++ b/charts/tekton-pipeline/patches/tekton-pipelines-webhook-deploy.yaml @@ -31,4 +31,4 @@ spec: - helmTemplateRemoveMe: | {{- with .Values.webhookDeploymentTolerations.tolerations }} {{- toYaml . | nindent 6 }} - {{- end}} \ No newline at end of file + {{- end}}