Skip to content

Commit

Permalink
feat: amend node affinities to bring in default values
Browse files Browse the repository at this point in the history
  • Loading branch information
mentlak0 committed Jul 24, 2023
1 parent fc2ad8f commit 10a0520
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 75 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ endif
# Move content of data: from git-resolver-config-cm.yaml to gitResolverConfig: in values.yaml
yq -i '.gitResolverConfig = load("$(CHART_DIR)/templates/git-resolver-config-cm.yaml").data' $(CHART_DIR)/values.yaml
yq -i '.data = null' $(CHART_DIR)/templates/git-resolver-config-cm.yaml
# Move content of : from tekton-pipelines-controller-deploy.yaml to controller.affinities.nodeAffinities in values.yaml
yq -i '.controller.affinity.nodeAffinity = load("$(CHART_DIR)/templates/tekton-pipelines-controller-deploy.yaml").spec.template.spec.affinity.nodeAffinity' $(CHART_DIR)/values.yaml
# Move content of : from tekton-pipelines-webhook-deploy.yaml to webhook.affinities.nodeAffinities in values.yaml
yq -i '.webhook.affinity.nodeAffinity = load("$(CHART_DIR)/templates/tekton-pipelines-webhook-deploy.yaml").spec.template.spec.affinity.nodeAffinity' $(CHART_DIR)/values.yaml
# Retrieve the image value from the template
yq -i '.controller.deployment.image = load("$(CHART_DIR)/templates/tekton-pipelines-controller-deploy.yaml").spec.template.spec.containers[].image' $(CHART_DIR)/values.yaml
# Remove the image value, so that end users can customize the image
Expand Down
2 changes: 1 addition & 1 deletion charts/tekton-pipeline/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for Tekton Pipelines
name: tekton-pipeline
version: 1.0.1
version: 1.0.2
appVersion: 0.42.0
icon: https://avatars2.githubusercontent.com/u/47602533
home: https://github.com/cdfoundation/tekton-helm-chart
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ spec:
{{- end}}
spec:
affinity:
nodeAffinity:
helmTemplateRemoveMe: |
{{- with .Values.controllerDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
helmTemplateRemoveMe: |
{{- with .Values.controller.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: tekton-pipelines-controller
envFrom:
Expand All @@ -38,11 +37,11 @@ spec:
image: {{ .Values.controller.deployment.image }}
nodeSelector:
helmTemplateRemoveMe: |
{{- with .Values.controllerDeploymentTolerations.nodeSelector }}
{{- with .Values.controller.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end}}
tolerations:
- helmTemplateRemoveMe: |
{{- with .Values.controllerDeploymentTolerations.tolerations }}
{{- with .Values.controller.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ spec:
{{- end}}
spec:
affinity:
nodeAffinity:
helmTemplateRemoveMe: |
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
helmTemplateRemoveMe: |
{{- with .Values.webhook.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: webhook
envFrom:
Expand All @@ -30,11 +29,11 @@ spec:
optional: true
nodeSelector:
helmTemplateRemoveMe: |
{{- with .Values.webhookDeploymentTolerations.nodeSelector }}
{{- with .Values.webhook.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end}}
tolerations:
- helmTemplateRemoveMe: |
{{- with .Values.webhookDeploymentTolerations.tolerations }}
{{- with .Values.webhook.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end}}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ spec:
version: v0.42.0
spec:
affinity:
nodeAffinity:
{{- with .Values.controllerDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.controller.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -kubeconfig-writer-image
Expand Down Expand Up @@ -144,12 +143,12 @@ spec:
readOnly: true
image: {{ .Values.controller.deployment.image }}
nodeSelector:
{{- with .Values.controllerDeploymentTolerations.nodeSelector }}
{{- with .Values.controller.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end}}
serviceAccountName: tekton-pipelines-controller
tolerations:
{{- with .Values.controllerDeploymentTolerations.tolerations }}
{{- with .Values.controller.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end}}
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ spec:
version: v0.42.0
spec:
affinity:
nodeAffinity:
{{- with .Values.webhookDeploymentTolerations.nodeAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.webhook.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
Expand Down Expand Up @@ -122,11 +121,11 @@ spec:
seccompProfile:
type: RuntimeDefault
nodeSelector:
{{- with .Values.webhookDeploymentTolerations.nodeSelector }}
{{- with .Values.webhook.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end}}
serviceAccountName: tekton-pipelines-webhook
tolerations:
{{- with .Values.webhookDeploymentTolerations.tolerations }}
{{- with .Values.webhook.tolerations }}
{{- toYaml . | nindent 6 }}
{{- end}}
94 changes: 46 additions & 48 deletions charts/tekton-pipeline/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,59 @@ controller:
pod:
labels: {}
annotations: {}
# specifies the name of an optional kubernetes secret to mount environment variables from for things like HTTP proxy
# specifies the name of an optional kubernetes secret to mount environment variables from for things like HTTP proxy
envFromSecret: "tekton-env"
# Add node affinity tolerations for tekton-pipeline-controller. Add additional matchExpressions below. Default is set.
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
tolerations: []
nodeSelector: []
webhook:
deployment:
labels: {}
pod:
labels: {}
# specifies the name of an optional kubernetes secret to mount environment variables from for things like HTTP proxy
# specifies the name of an optional kubernetes secret to mount environment variables from for things like HTTP proxy
envFromSecret: "tekton-env"
# Add node affinity tolerations for tekton-pipelines-webhook. Add additional matchExpressions below. Default is set.
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
tolerations: []
nodeSelector: []
# Settings to increase deployment resources for tekton-pipelines-remote-resolvers-deployment
remoteResolversPod:
resources:
limits:
cpu: 1000m
memory: 1000Mi
requests:
cpu: 100m
memory: 100Mi
resolverDeploymentTolerations:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "agentpool"
operator: "In"
values:
- "buildnode"
tolerations: []
nodeSelector: []
# configuration to put in the config-defaults ConfigMap
configDefaults:
_example: |
Expand Down Expand Up @@ -85,52 +129,6 @@ configDefaults:
# default-max-matrix-combinations-count contains the default maximum number
# of combinations from a Matrix, if none is specified.
default-max-matrix-combinations-count: "256"
# Settings to increase deployment resources for tekton-pipelines-remote-resolvers-deployment
remoteResolversPod:
resources:
limits:
cpu: 1000m
memory: 1000Mi
requests:
cpu: 100m
memory: 100Mi
# Add node affinity tolerations for tekton-remote-resolvers
resolverDeploymentTolerations:
nodeAffinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: "key"
# operator: "In"
# values:
# - "node"
nodeSelector: []
tolerations: []
# Add node affinity tolerations for tekton-pipeline-controller. Add additional matchExpressions below. Default is set.
controllerDeploymentTolerations:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
nodeSelector: []
tolerations: []
# Add node affinity tolerations for tekton-pipelines-webhook. Add additional matchExpressions below. Default is set.
webhookDeploymentTolerations:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
nodeSelector: []
tolerations: []
gitResolverConfig:
# The maximum amount of time a single anonymous cloning resolution may take.
fetch-timeout: "1m"
Expand Down

0 comments on commit 10a0520

Please sign in to comment.