Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install PodDistruptionBudgets when replica greater than 1 #1509

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
30f262c
feat: add JOBSERVICE_WEBHOOK_JOB_MAX_RETRY and JOBSERVICE_WEBHOOK_JOB…
zyyw Mar 22, 2023
45881e8
feat: add configmap checksum annotation for portal
geneliu Mar 17, 2023
b7a24d6
feat: add config of reaper.max_update_hours & reaper.max_dangling_hours
zyyw Apr 17, 2023
4758272
extraEnvVars for all workloads
jouve Apr 11, 2023
46f67fb
feat: add podLabels
boniek83 Apr 19, 2023
5b76956
Update logo path to main for new releases
OrlinVasilev Apr 7, 2023
7a9bcca
Update README.md (#1488)
Vad1mo May 19, 2023
363710d
Allow `CONFIG_OVERWRITE_JSON` to be set in values file (#1147)
PhilipNelson5 May 19, 2023
16e1d08
feat: remove notary
zyyw May 16, 2023
2d87984
fix: add github-ghcr to the list of PERMITTED_REGISTRY_TYPES_FOR_PROX…
zyyw May 12, 2023
1374b17
Add TLS 1.3 support for harbor-nginx
kariya-mitsuru May 12, 2023
36ee315
Add TLS 1.3 support for harbor-portal
kariya-mitsuru May 18, 2023
93092f8
Fix incorrect comment on values.yaml
arjungandhi May 28, 2023
21b8211
Add tls checksum
Jun 26, 2023
a20d33c
Allow user to set topologySpreadConstraints
Sep 21, 2022
94d71ed
Fix #1127 - remove capabilities check for prometheus
sudermanjr Jun 19, 2023
f5b1043
feat: add pdb
MarcHenriotMMS Jul 12, 2023
fce0169
feat: add pdb
MarcHenriotMMS Jul 12, 2023
62f997c
fix: set podDisruptionBudget.enabled to false
MarcHenriotMMS Jul 12, 2023
188921f
Merge branch 'master' into master
rgarcia89 Jul 21, 2023
b79f2a2
fix: add matchLabels in spec.selector in all pdb
MarcHenriot Aug 2, 2023
5b153f7
feat: add pdb to exporter
MarcHenriot Aug 2, 2023
deff5f2
Merge branch 'goharbor:master' into master
rgarcia89 Aug 3, 2023
b17fd7f
Merge pull request #2 from MarcHenriot/master
rgarcia89 Aug 3, 2023
9c0e526
Merge branch 'goharbor:main' into master
rgarcia89 Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions templates/core/core-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.core.podDisruptionBudget.enabled (gt (int .Values.core.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.core" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.core.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.core.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.core.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.core.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: core
{{- end }}
19 changes: 19 additions & 0 deletions templates/exporter/exporter-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.exporter.podDisruptionBudget.enabled (gt (int .Values.exporter.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.exporter" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.exporter.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.exporter.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.exporter.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.exporter.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: exporter
{{- end }}
19 changes: 19 additions & 0 deletions templates/jobservice/jobservice-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.jobservice.podDisruptionBudget.enabled (gt (int .Values.jobservice.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.jobservice" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.jobservice.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.jobservice.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.jobservice.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.jobservice.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: jobservice
{{- end }}
19 changes: 19 additions & 0 deletions templates/nginx/nginx-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.nginx.podDisruptionBudget.enabled (gt (int .Values.nginx.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.nginx" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.nginx.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.nginx.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.nginx.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.nginx.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: nginx
{{- end }}
19 changes: 19 additions & 0 deletions templates/portal/portal-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.portal.podDisruptionBudget.enabled (gt (int .Values.portal.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.portal" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.portal.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.portal.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.portal.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.portal.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: portal
{{- end }}
19 changes: 19 additions & 0 deletions templates/registry/registry-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.registry.podDisruptionBudget.enabled (gt (int .Values.registry.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.registry" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.registry.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.registry.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.registry.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.registry.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: registry
{{- end }}
19 changes: 19 additions & 0 deletions templates/trivy/trivy-pdb.yaml
@@ -0,0 +1,19 @@
{{- if and .Values.trivy.podDisruptionBudget.enabled (gt (int .Values.trivy.replicas) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "harbor.trivy" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
spec:
{{- if .Values.trivy.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.trivy.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.trivy.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.trivy.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "harbor.matchLabels" . | indent 6 }}
component: trivy
{{- end }}
28 changes: 28 additions & 0 deletions values.yaml
Expand Up @@ -391,6 +391,10 @@ nginx:
# mount the service account token
automountServiceAccountToken: false
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
# resources:
# requests:
Expand Down Expand Up @@ -422,6 +426,10 @@ portal:
# mount the service account token
automountServiceAccountToken: false
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
# resources:
# requests:
Expand Down Expand Up @@ -455,6 +463,10 @@ core:
# mount the service account token
automountServiceAccountToken: false
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
## Startup probe values
startupProbe:
Expand Down Expand Up @@ -530,6 +542,10 @@ jobservice:
repository: goharbor/harbor-jobservice
tag: dev
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
# set the service account to be used, default if left empty
serviceAccountName: ""
Expand Down Expand Up @@ -606,6 +622,10 @@ registry:
# cpu: 100m
extraEnvVars: []
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
nodeSelector: {}
tolerations: []
Expand Down Expand Up @@ -676,6 +696,10 @@ trivy:
automountServiceAccountToken: false
# replicas the number of Pod replicas
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
# debugMode the flag to enable Trivy debug mode with more verbose scanning log
debugMode: false
# vulnType a comma-separated list of vulnerability types. Possible values are `os` and `library`.
Expand Down Expand Up @@ -878,6 +902,10 @@ redis:

exporter:
replicas: 1
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
revisionHistoryLimit: 10
# resources:
# requests:
Expand Down