Skip to content

Commit

Permalink
feat(charts/prow): support global value overrides in third plugins (#355
Browse files Browse the repository at this point in the history
)

* feat(charts/prow): support global image pull policy

* feat(charts/prow): support global value overrides in third plugins
  • Loading branch information
wuhuizuo authored Dec 20, 2022
1 parent 02a1b2e commit dbf4bb7
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion charts/prow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type: application
# time you make changes to the chart and its templates,
# including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.6.0"
version: "0.6.1"

# This is the version number of the application being deployed.
# This version number should be incremented each time you make changes to the
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/crier/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.crier.image.repository }}:{{ .Values.crier.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.crier.image.pullPolicy }}
imagePullPolicy: {{ .Values.crier.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --config-path=/etc/config/config.yaml
- --job-config-path=/etc/job-config
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/deck/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.deck.image.repository }}:{{ .Values.deck.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.deck.image.pullPolicy }}
imagePullPolicy: {{ .Values.deck.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --config-path=/etc/config/config.yaml
- --plugin-config=/etc/plugins/plugins.yaml
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/ghproxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.ghproxy.image.repository }}:{{ .Values.ghproxy.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.ghproxy.image.pullPolicy }}
imagePullPolicy: {{ .Values.ghproxy.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --cache-dir=/cache
- --cache-sizeGB=99
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/hook/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.hook.image.repository }}:{{ .Values.hook.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.hook.image.pullPolicy }}
imagePullPolicy: {{ .Values.hook.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --config-path=/etc/config/config.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.horologium.image.repository }}:{{ .Values.horologium.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.horologium.image.pullPolicy }}
imagePullPolicy: {{ .Values.horologium.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --config-path=/etc/config/config.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.jenkinsOperator.image.repository }}:{{ .Values.jenkinsOperator.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.jenkinsOperator.image.pullPolicy }}
imagePullPolicy: {{ .Values.jenkinsOperator.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --github-token-path=/etc/github/oauth
- --github-endpoint=http://{{ include "prow.fullname.ghproxy" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/pipeline/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.pipeline.image.repository }}:{{ .Values.pipeline.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.pipeline.image.pullPolicy }}
imagePullPolicy: {{ .Values.pipeline.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --all-contexts
- --config=/etc/config/config.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.pcm.image.repository }}:{{ .Values.pcm.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.pcm.image.pullPolicy }}
imagePullPolicy: {{ .Values.pcm.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --enable-controller=plank
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/sinker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.sinker.image.repository }}:{{ .Values.sinker.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.sinker.image.pullPolicy }}
imagePullPolicy: {{ .Values.sinker.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --config-path=/etc/config/config.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.statusReconciler.image.repository }}:{{ .Values.statusReconciler.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.statusReconciler.image.pullPolicy }}
imagePullPolicy: {{ .Values.statusReconciler.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --continue-on-error=true
Expand Down
2 changes: 1 addition & 1 deletion charts/prow/templates/components/tide/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.tide.image.repository }}:{{ .Values.tide.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.tide.image.pullPolicy }}
imagePullPolicy: {{ .Values.tide.image.pullPolicy | default .Values.imagePullPolicy }}
args:
- --dry-run=false
- --config-path=/etc/config/config.yaml
Expand Down
41 changes: 28 additions & 13 deletions charts/prow/templates/third-plugins/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
app.kubernetes.io/app: {{ $name }}
template:
metadata:
{{- with .podAnnotations }}
{{- with $root.Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -38,18 +38,16 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ $val.serviceAccountName | default "default" }}
{{- with $val.podSecurityContext }}
{{- with $root.Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ $name }}
{{- with $val.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- toYaml $root.Values.securityContext | nindent 12 }}
image: "{{ $val.image.repository }}:{{ $val.image.tag | default $root.Chart.AppVersion }}"
imagePullPolicy: {{ $val.image.pullPolicy }}
imagePullPolicy: {{ $val.image.pullPolicy | default $root.Values.imagePullPolicy }}
{{- if $val.args }}
args:
{{- toYaml $val.args | nindent 12 }}
Expand All @@ -72,6 +70,10 @@ spec:
ports:
- name: http
containerPort: {{ $val.ports.http | default 80 }}
{{- with $val.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: github-token
mountPath: /etc/github
Expand All @@ -88,9 +90,9 @@ spec:
- name: plugins
mountPath: /etc/plugins
readOnly: true
- name: external-plugins-config
mountPath: /etc/external_plugins_config
readOnly: true
{{- with $val.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
{{- with $val.livenessProbe }}
{{- toYaml . | nindent 12 }}
Expand All @@ -117,7 +119,7 @@ spec:
secretName: {{ include "prow.fullname" $root }}-github-token
- name: hmac
secret:
secretName: hmac-token
secretName: {{ include "prow.fullname" . }}-hmac-token
- name: config
configMap:
name: {{ include "prow.fullname" $root }}-config
Expand All @@ -127,7 +129,20 @@ spec:
- name: plugins
configMap:
name: {{ include "prow.fullname" $root }}-plugins
- name: external-plugins-config
configMap:
name: {{ include "prow.fullname" $root }}-external-plugins-config
# other external volumes
{{- with $val.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $root.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $root.Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $root.Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 2 additions & 4 deletions charts/prow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Declare variables to be passed into your templates.

### Global Pod configurations.
imagePullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down Expand Up @@ -453,13 +454,12 @@ thirdPlugins: {}
# needs-rebase:
# replicaCount: 1
# serviceAccountName: ""
# podSecurityContext: {}
# containerSecurityContext: {}
# image:
# repository: gcr.io/k8s-prow/needs-rebase
# pullPolicy: Always
# ports:
# http: 80
# resources: {}
# ti-community-autoresponder: {}
# ti-community-blunderbuss:
# ti-community-cherrypicker:
Expand All @@ -475,7 +475,6 @@ thirdPlugins: {}
# service:
# type: ClusterIP
# port: 80

# ingress:
# enabled: true
# className: ""
Expand All @@ -492,7 +491,6 @@ thirdPlugins: {}
# # - secretName: chart-example-tls
# # hosts:
# # - << REPLACE >>

# replicaCount: 1
# image:
# repository: ticommunityinfra/tichi-web
Expand Down

0 comments on commit dbf4bb7

Please sign in to comment.