Skip to content

Commit d876646

Browse files
feat: add PDBs
1 parent 85e0063 commit d876646

File tree

7 files changed

+80
-6
lines changed

7 files changed

+80
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ output
1313

1414
# ignore local dev
1515
values-dev.yaml
16-
dry-run.yaml
16+
dry-run.yaml
17+
values-test.yaml

charts/gitops-runtime/Chart.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: 0.1.44
33
description: A Helm chart for Codefresh gitops runtime
44
name: gitops-runtime
5-
version: 0.5.2
5+
version: 0.6.0
66
home: https://github.com/codefresh-io/gitops-runtime-helm
77
icon: https://avatars1.githubusercontent.com/u/11412079?v=3
88
keywords:
@@ -14,10 +14,8 @@ maintainers:
1414
annotations:
1515
artifacthub.io/alternativeName: "codefresh-gitops-runtime"
1616
artifacthub.io/changes: |
17-
- kind: changed
18-
description: "update codefresh-gitops-operator chart to 1.0.9 to handle promotions"
19-
- kind: changed
20-
description: "update cap-app-proxy to 1.2727.0 (exopse gitLog endpoint)"
17+
- kind: added
18+
description: "Add PDB templates for internal-router and app-proxy"
2119
dependencies:
2220
- name: argo-cd
2321
repository: https://codefresh-io.github.io/argo-helm
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- define "cap-app-proxy.resources.pdb" }}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "cap-app-proxy.fullname" . }}
6+
labels:
7+
{{- include "cap-app-proxy.labels" . | nindent 4 }}
8+
spec:
9+
{{- if or .Values.pdb.minAvailable .Values.pdb.maxUnavailable }}
10+
{{- with .Values.pdb.minAvailable }}
11+
minAvailable: {{ . }}
12+
{{- end }}
13+
{{- with .Values.pdb.maxUnavailable }}
14+
maxUnavailable: {{ . }}
15+
{{- end }}
16+
{{- else }}
17+
{{- fail (printf "ERROR: pdb.minAvailable or pdb.maxUnavailable is required!" ) }}
18+
{{- end }}
19+
selector:
20+
{{- include "cap-app-proxy.selectorLabels" . | nindent 4 }}
21+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- define "internal-router.resources.pdb" }}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "internal-router.fullname" . }}
6+
labels:
7+
{{- include "internal-router.labels" . | nindent 4 }}
8+
spec:
9+
{{- if or .Values.pdb.minAvailable .Values.pdb.maxUnavailable }}
10+
{{- with .Values.pdb.minAvailable }}
11+
minAvailable: {{ . }}
12+
{{- end }}
13+
{{- with .Values.pdb.maxUnavailable }}
14+
maxUnavailable: {{ . }}
15+
{{- end }}
16+
{{- else }}
17+
{{- fail (printf "ERROR: pdb.minAvailable or pdb.maxUnavailable is required!" ) }}
18+
{{- end }}
19+
selector:
20+
{{- include "internal-router.selectorLabels" . | nindent 4 }}
21+
{{- end }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $appProxyContext := deepCopy . }}
2+
{{- $_ := set $appProxyContext "Values" (get .Values "app-proxy") }}
3+
{{- $_ := set $appProxyContext.Values "global" (get .Values "global") }}
4+
5+
{{- if $appProxyContext.pdb.enabled }}
6+
{{- include "cap-app-proxy.resources.pdb" $appProxyContext }}
7+
{{- end }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $internalRouterContext := deepCopy . }}
2+
{{- $_ := set $internalRouterContext "Values" (get .Values "internal-router") }}
3+
{{- $_ := set $internalRouterContext.Values "global" (get .Values "global") }}
4+
5+
{{- if $internalRouterContext.pdb.enabled }}
6+
{{- include "internal-router.resources.pdb" $internalRouterContext }}
7+
{{- end }}

charts/gitops-runtime/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,16 @@ internal-router:
420420
dnsService: kube-dns
421421
dnsNamespace: kube-system
422422
clusterDomain: cluster.local
423+
424+
## Internal-Router Pod Disruption Budget
425+
pdb:
426+
# -- Enable PDB
427+
enabled: false
428+
# -- Set number of pods that are available after eviction as number of percentage
429+
minAvailable: ""
430+
# -- Set number of pods that are unavailable after eviction as number of percentage
431+
maxUnavailable: ""
432+
423433
#-----------------------------------------------------------------------------------------------------------------------
424434
# tunnel client
425435
#-----------------------------------------------------------------------------------------------------------------------
@@ -588,6 +598,15 @@ app-proxy:
588598
# -- extra volumes
589599
extraVolumes: []
590600

601+
## App-Proxy Pod Disruption Budget
602+
pdb:
603+
# -- Enable PDB
604+
enabled: false
605+
# -- Set number of pods that are available after eviction as number of percentage
606+
minAvailable: ""
607+
# -- Set number of pods that are unavailable after eviction as number of percentage
608+
maxUnavailable: ""
609+
591610
#-----------------------------------------------------------------------------------------------------------------------
592611
# gitops-operator
593612
#-----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)