feat(argo-cd): Add API version overrides for PDB and GKE (#1524)
Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
This commit is contained in:
parent
bbecd7445d
commit
6b523e3b0b
18 changed files with 130 additions and 91 deletions
|
|
@ -1,15 +1,5 @@
|
|||
{{- if .Values.server.certificate.enabled -}}
|
||||
{{- if .Values.apiVersionOverrides.certmanager -}}
|
||||
apiVersion: {{ .Values.apiVersionOverrides.certmanager }}
|
||||
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1" }}
|
||||
apiVersion: cert-manager.io/v1
|
||||
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1alpha3" }}
|
||||
apiVersion: cert-manager.io/v1alpha3
|
||||
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1alpha2" }}
|
||||
apiVersion: cert-manager.io/v1alpha2
|
||||
{{- else }}
|
||||
apiVersion: certmanager.k8s.io/v1alpha1
|
||||
{{- end }}
|
||||
apiVersion: {{ include "argo-cd.apiVersion.cert-manager" . }}
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ template "argo-cd.server.fullname" . }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.server.GKEbackendConfig.enabled }}
|
||||
apiVersion: cloud.google.com/v1beta1
|
||||
apiVersion: {{ include "argo-cd.apiVersions.cloudgoogle" . }}
|
||||
kind: BackendConfig
|
||||
metadata:
|
||||
name: {{ template "argo-cd.server.fullname" . }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.server.autoscaling.enabled }}
|
||||
apiVersion: {{ include "argo-cd.autoscaling.apiVersion" . }}
|
||||
apiVersion: {{ include "argo-cd.apiVersion.autoscaling" . }}
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
|
|
@ -17,7 +17,7 @@ spec:
|
|||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.autoscaling" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
|
|
@ -29,7 +29,7 @@ spec:
|
|||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.autoscaling" $) "autoscaling/v2beta1" }}
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- else }}
|
||||
target:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
{{- $paths := .Values.server.ingressGrpc.paths -}}
|
||||
{{- $extraPaths := .Values.server.ingressGrpc.extraPaths -}}
|
||||
{{- $pathType := .Values.server.ingressGrpc.pathType -}}
|
||||
apiVersion: {{ include "argo-cd.ingress.apiVersion" . }}
|
||||
apiVersion: {{ include "argo-cd.apiVersion.ingress" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.server.ingressGrpc.annotations }}
|
||||
|
|
@ -20,7 +20,7 @@ metadata:
|
|||
{{- toYaml .Values.server.ingressGrpc.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
{{- with .Values.server.ingressGrpc.ingressClassName }}
|
||||
ingressClassName: {{ . }}
|
||||
{{- end }}
|
||||
|
|
@ -63,11 +63,11 @@ spec:
|
|||
{{- end -}}
|
||||
{{- range $p := $paths }}
|
||||
- path: {{ $p }}
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
pathType: {{ $pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
{{- $paths := .Values.server.ingress.paths -}}
|
||||
{{- $extraPaths := .Values.server.ingress.extraPaths -}}
|
||||
{{- $pathType := .Values.server.ingress.pathType -}}
|
||||
apiVersion: {{ include "argo-cd.ingress.apiVersion" . }}
|
||||
apiVersion: {{ include "argo-cd.apiVersion.ingress" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.server.ingress.annotations }}
|
||||
|
|
@ -24,7 +24,7 @@ metadata:
|
|||
{{- toYaml .Values.server.ingress.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
{{- with .Values.server.ingress.ingressClassName }}
|
||||
ingressClassName: {{ . }}
|
||||
{{- end }}
|
||||
|
|
@ -41,11 +41,11 @@ spec:
|
|||
{{- range $p := $paths }}
|
||||
{{- if and $.Values.server.ingressGrpc.isAWSALB $.Values.server.ingressGrpc.enabled }}
|
||||
- path: {{ $p }}
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
pathType: Prefix
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
service:
|
||||
name: {{ template "argo-cd.server.fullname" $ }}-grpc
|
||||
port:
|
||||
|
|
@ -60,11 +60,11 @@ spec:
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
- path: {{ $p }}
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
pathType: {{ $pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
|
|
@ -87,11 +87,11 @@ spec:
|
|||
{{- end }}
|
||||
{{- range $p := $paths }}
|
||||
- path: {{ $p }}
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
pathType: {{ $pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||
{{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }}
|
||||
service:
|
||||
name: {{ $serviceName }}
|
||||
port:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.server.pdb.enabled }}
|
||||
apiVersion: {{ include "argo-cd.podDisruptionBudget.apiVersion" . }}
|
||||
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "argo-cd.server.fullname" . }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue