Add podDistruptionBudget resource for controller pods (#805)
* Add podDistruptionBudget resource for controller pods * Add PDB to GithubWebhookServer * Fix truncation on pdb naming Co-authored-by: Roee Landesman <roee.landesman@gmail.com>
This commit is contained in:
		
							parent
							
								
									b87e6e3966
								
							
						
					
					
						commit
						7ee1d6bcdb
					
				|  | @ -54,7 +54,10 @@ All additional docs are kept in the `docs/` folder, this README is solely for do | ||||||
| | `topologySpreadConstraints`                              | Set the controller pod topologySpreadConstraints                                                                           |                                                                      | | | `topologySpreadConstraints`                              | Set the controller pod topologySpreadConstraints                                                                           |                                                                      | | ||||||
| | `nodeSelector`                                           | Set the controller pod nodeSelector                                                                                        |                                                                      | | | `nodeSelector`                                           | Set the controller pod nodeSelector                                                                                        |                                                                      | | ||||||
| | `resources`                                              | Set the controller pod resources                                                                                           |                                                                      | | | `resources`                                              | Set the controller pod resources                                                                                           |                                                                      | | ||||||
| | `affinity`                                               | Set the controller pod affinity rules                                                                                      |                                                                      | | | `affinity`                                               | Set the controller pod affinity rules                                                                                      | | ||||||
|  | | `podDisruptionBudget.enabled`                                               | Enables a PDB to ensure HA of controller pods                                                                                     |      false                                                                    | | ||||||
|  | | `podDisruptionBudget.minAvailable`                                               | Minimum number of pods that must be available after eviction                                                                                     |                                                                          | | ||||||
|  | | `podDisruptionBudget.maxUnavailable`                                               | Maximum number of pods that can be unavailable after eviction. Kubernetes 1.7+ required.                                                                                     |                                                                          | | ||||||
| | `tolerations`                                            | Set the controller pod tolerations                                                                                         |                                                                      | | | `tolerations`                                            | Set the controller pod tolerations                                                                                         |                                                                      | | ||||||
| | `env`                                                    | Set environment variables for the controller container                                                                     |                                                                      | | | `env`                                                    | Set environment variables for the controller container                                                                     |                                                                      | | ||||||
| | `priorityClassName`                                      | Set the controller pod priorityClassName                                                                                   |                                                                      | | | `priorityClassName`                                      | Set the controller pod priorityClassName                                                                                   |                                                                      | | ||||||
|  | @ -89,3 +92,6 @@ All additional docs are kept in the `docs/` folder, this README is solely for do | ||||||
| | `githubWebhookServer.ingress.annotations`                | Set annotations for the ingress kind                                                                                       |                                                                      | | | `githubWebhookServer.ingress.annotations`                | Set annotations for the ingress kind                                                                                       |                                                                      | | ||||||
| | `githubWebhookServer.ingress.hosts`                      | Set hosts configuration for ingress                                                                                        | `[{"host": "chart-example.local", "paths": []}]`                     | | | `githubWebhookServer.ingress.hosts`                      | Set hosts configuration for ingress                                                                                        | `[{"host": "chart-example.local", "paths": []}]`                     | | ||||||
| | `githubWebhookServer.ingress.tls`                        | Set tls configuration for ingress                                                                                          |                                                                      | | | `githubWebhookServer.ingress.tls`                        | Set tls configuration for ingress                                                                                          |                                                                      | | ||||||
|  | | `githubWebhookServer.podDisruptionBudget.enabled`                                               | Enables a PDB to ensure HA of githubwebhook pods                                                                                     |      false                                                                    | | ||||||
|  | | `githubWebhookServer.podDisruptionBudget.minAvailable`                                               | Minimum number of pods that must be available after eviction                                                                                     |                                                                          | | ||||||
|  | | `githubWebhookServer.podDisruptionBudget.maxUnavailable`                                               | Maximum number of pods that can be unavailable after eviction. Kubernetes 1.7+ required.                                                                                     |                                                                          | | ||||||
|  | @ -58,3 +58,7 @@ Create the name of the service account to use | ||||||
| {{- define "actions-runner-controller-github-webhook-server.serviceMonitorName" -}} | {{- define "actions-runner-controller-github-webhook-server.serviceMonitorName" -}} | ||||||
| {{- include "actions-runner-controller-github-webhook-server.fullname" . | trunc 47 }}-service-monitor | {{- include "actions-runner-controller-github-webhook-server.fullname" . | trunc 47 }}-service-monitor | ||||||
| {{- end }} | {{- end }} | ||||||
|  | 
 | ||||||
|  | {{- define "actions-runner-controller-github-webhook-server.pdbName" -}} | ||||||
|  | {{- include "actions-runner-controller-github-webhook-server.fullname" . | trunc 59 }}-pdb | ||||||
|  | {{- end }} | ||||||
|  | @ -107,3 +107,7 @@ Create the name of the service account to use | ||||||
| {{- define "actions-runner-controller.servingCertName" -}} | {{- define "actions-runner-controller.servingCertName" -}} | ||||||
| {{- include "actions-runner-controller.fullname" . }}-serving-cert | {{- include "actions-runner-controller.fullname" . }}-serving-cert | ||||||
| {{- end }} | {{- end }} | ||||||
|  | 
 | ||||||
|  | {{- define "actions-runner-controller.pdbName" -}} | ||||||
|  | {{- include "actions-runner-controller.fullname" . | trunc 59 }}-pdb | ||||||
|  | {{- end }} | ||||||
|  | @ -0,0 +1,19 @@ | ||||||
|  | {{- if .Values.podDisruptionBudget.enabled }} | ||||||
|  | apiVersion: policy/v1beta1 | ||||||
|  | kind: PodDisruptionBudget | ||||||
|  | metadata: | ||||||
|  |   labels: | ||||||
|  |     {{- include "actions-runner-controller.labels" . | nindent 4 }} | ||||||
|  |   name: {{ include "actions-runner-controller.pdbName" . }} | ||||||
|  |   namespace: {{ .Release.Namespace }} | ||||||
|  | spec: | ||||||
|  |   {{- if .Values.podDisruptionBudget.minAvailable }} | ||||||
|  |   minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} | ||||||
|  |   {{- end  }} | ||||||
|  |   {{- if .Values.podDisruptionBudget.maxUnavailable }} | ||||||
|  |   maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} | ||||||
|  |   {{- end  }} | ||||||
|  |   selector: | ||||||
|  |     matchLabels: | ||||||
|  |       {{- include "actions-runner-controller.selectorLabels" . | nindent 6 }} | ||||||
|  | {{- end -}} | ||||||
|  | @ -0,0 +1,19 @@ | ||||||
|  | {{- if .Values.githubWebhookServer.podDisruptionBudget.enabled }} | ||||||
|  | apiVersion: policy/v1beta1 | ||||||
|  | kind: PodDisruptionBudget | ||||||
|  | metadata: | ||||||
|  |   labels: | ||||||
|  |     {{- include "actions-runner-controller.labels" . | nindent 4 }} | ||||||
|  |   name: {{ include "actions-runner-controller-github-webhook-server.pdbName" . }} | ||||||
|  |   namespace: {{ .Release.Namespace }} | ||||||
|  | spec: | ||||||
|  |   {{- if .Values.githubWebhookServer.podDisruptionBudget.minAvailable }} | ||||||
|  |   minAvailable: {{ .Values.githubWebhookServer.podDisruptionBudget.minAvailable }} | ||||||
|  |   {{- end  }} | ||||||
|  |   {{- if .Values.githubWebhookServer.podDisruptionBudget.maxUnavailable }} | ||||||
|  |   maxUnavailable: {{ .Values.githubWebhookServer.podDisruptionBudget.maxUnavailable }} | ||||||
|  |   {{- end  }} | ||||||
|  |   selector: | ||||||
|  |     matchLabels: | ||||||
|  |       {{- include "actions-runner-controller-github-webhook-server.selectorLabels" . | nindent 6 }} | ||||||
|  | {{- end -}} | ||||||
|  | @ -109,6 +109,12 @@ tolerations: [] | ||||||
| 
 | 
 | ||||||
| affinity: {} | affinity: {} | ||||||
| 
 | 
 | ||||||
|  | # Only one of minAvailable or maxUnavailable can be set | ||||||
|  | podDisruptionBudget: | ||||||
|  |   enabled: false | ||||||
|  |   # minAvailable: 1 | ||||||
|  |   # maxUnavailable: 3 | ||||||
|  | 
 | ||||||
| # Leverage a PriorityClass to ensure your pods survive resource shortages | # Leverage a PriorityClass to ensure your pods survive resource shortages | ||||||
| # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ | # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ | ||||||
| # PriorityClass: system-cluster-critical | # PriorityClass: system-cluster-critical | ||||||
|  | @ -179,3 +185,9 @@ githubWebhookServer: | ||||||
|     #  - secretName: chart-example-tls |     #  - secretName: chart-example-tls | ||||||
|     #    hosts: |     #    hosts: | ||||||
|     #      - chart-example.local |     #      - chart-example.local | ||||||
|  | 
 | ||||||
|  |   # Only one of minAvailable or maxUnavailable can be set | ||||||
|  |   podDisruptionBudget: | ||||||
|  |     enabled: false | ||||||
|  |     # minAvailable: 1 | ||||||
|  |     # maxUnavailable: 3 | ||||||
		Loading…
	
		Reference in New Issue