Skip to content

Commit 125158a

Browse files
author
github-actions
committed
Update perfectscale-autoscaler chart with new package version v1.0.25
1 parent 32ad6f3 commit 125158a

File tree

4 files changed

+115
-12
lines changed

4 files changed

+115
-12
lines changed

charts/psc-autoscaler/templates/admission.yaml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{- $ca := genCA "psc-autoscaler-ca" 1825 -}}
33
{{- $cert := genSignedCert ( include "psc-autoscaler.fullname" . ) nil $altNames 1825 $ca -}}
44
---
5+
{{- if not .Values.admission.certManager.enabled }}
56
apiVersion: v1
67
kind: Secret
78
type: kubernetes.io/tls
@@ -24,7 +25,7 @@ data:
2425
tls.crt: {{ $cert.Cert | b64enc }}
2526
tls.key: {{ $cert.Key | b64enc }}
2627
{{- end }}
27-
28+
{{- end }}
2829
---
2930
apiVersion: admissionregistration.k8s.io/v1
3031
kind: MutatingWebhookConfiguration
@@ -35,10 +36,16 @@ metadata:
3536
{{- if .Values.additionalLabels }}
3637
{{- toYaml .Values.additionalLabels | nindent 4 }}
3738
{{- end }}
38-
{{- with .Values.admission.annotations }}
39+
{{- $hasAnnotations := .Values.admission.annotations }}
40+
{{- if or $hasAnnotations .Values.admission.certManager.enabled }}
3941
annotations:
42+
{{- with $hasAnnotations }}
4043
{{- toYaml . | nindent 4 }}
41-
{{- end }}
44+
{{- end }}
45+
{{- if .Values.admission.certManager.enabled }}
46+
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "psc-autoscaler.fullname" . }}-ca
47+
{{- end }}
48+
{{- end }}
4249
webhooks:
4350
- name: pods.perfectscale.io
4451
{{- if and (.Values.settings.excludedNamespaces) (ne (.Values.settings.excludedNamespaces | toString) "[]") }}
@@ -55,11 +62,15 @@ webhooks:
5562
resources: [ "pods" ]
5663
scope: "Namespaced"
5764
clientConfig:
58-
{{- if .Values.admission.staticCerts.enabled }}
65+
{{- if not .Values.admission.certManager.enabled }}
66+
{{- if .Values.admission.externalCertSecret.enabled }}
67+
caBundle: {{ .Values.admission.externalCertSecret.caCert }}
68+
{{- else if .Values.admission.staticCerts.enabled }}
5969
caBundle: {{ .Values.admission.staticCerts.caCert }}
60-
{{- else }}
70+
{{- else }}
6171
caBundle: {{ $ca.Cert | b64enc }}
62-
{{- end }}
72+
{{- end }}
73+
{{- end }}
6374
service:
6475
namespace: {{ .Release.Namespace }}
6576
name: {{ include "psc-autoscaler.fullname" . }}
@@ -79,10 +90,16 @@ metadata:
7990
{{- if .Values.additionalLabels }}
8091
{{- toYaml .Values.additionalLabels | nindent 4 }}
8192
{{- end }}
82-
{{- with .Values.admission.annotations }}
93+
{{- $hasAnnotations := .Values.admission.annotations }}
94+
{{- if or $hasAnnotations .Values.admission.certManager.enabled }}
8395
annotations:
96+
{{- with $hasAnnotations }}
8497
{{- toYaml . | nindent 4 }}
85-
{{- end }}
98+
{{- end }}
99+
{{- if .Values.admission.certManager.enabled }}
100+
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "psc-autoscaler.fullname" . }}-ca
101+
{{- end }}
102+
{{- end }}
86103
webhooks:
87104
- name: configs.perfectscale.io
88105
rules:
@@ -97,11 +114,15 @@ webhooks:
97114
resources: [ "namespaceautomationconfigs", "workloadautomationconfigs" ]
98115
scope: "Namespaced"
99116
clientConfig:
100-
{{- if .Values.admission.staticCerts.enabled }}
117+
{{- if not .Values.admission.certManager.enabled }}
118+
{{- if .Values.admission.externalCertSecret.enabled }}
119+
caBundle: {{ .Values.admission.externalCertSecret.caCert }}
120+
{{- else if .Values.admission.staticCerts.enabled }}
101121
caBundle: {{ .Values.admission.staticCerts.caCert }}
102-
{{- else }}
122+
{{- else }}
103123
caBundle: {{ $ca.Cert | b64enc }}
104-
{{- end }}
124+
{{- end }}
125+
{{- end }}
105126
service:
106127
namespace: {{ .Release.Namespace }}
107128
name: {{ include "psc-autoscaler.fullname" . }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{- if .Values.admission.certManager.enabled }}
2+
{{- $fullname := include "psc-autoscaler.fullname" . -}}
3+
{{- $namespace := .Release.Namespace -}}
4+
{{- $altNames := list (printf "%s.%s" $fullname $namespace) (printf "%s.%s.svc" $fullname $namespace) -}}
5+
{{- $commonName := printf "%s.%s" $fullname $namespace -}}
6+
{{- $labels := include "psc-autoscaler.labels" . }}
7+
8+
---
9+
apiVersion: cert-manager.io/v1
10+
kind: Issuer
11+
metadata:
12+
name: {{ $fullname }}-selfsigned
13+
namespace: {{ $namespace }}
14+
spec:
15+
selfSigned: {}
16+
17+
---
18+
apiVersion: cert-manager.io/v1
19+
kind: Certificate
20+
metadata:
21+
name: {{ $fullname }}-ca
22+
namespace: {{ $namespace }}
23+
spec:
24+
isCA: true
25+
commonName: ca.{{ $fullname }}.psc.local
26+
secretName: {{ $fullname }}-ca-keypair
27+
duration: 87600h # 10 years
28+
renewBefore: 720h
29+
issuerRef:
30+
name: {{ $fullname }}-selfsigned
31+
kind: Issuer
32+
group: cert-manager.io
33+
34+
---
35+
apiVersion: cert-manager.io/v1
36+
kind: Issuer
37+
metadata:
38+
name: {{ $fullname }}-ca-issuer
39+
namespace: {{ $namespace }}
40+
spec:
41+
ca:
42+
secretName: {{ $fullname }}-ca-keypair
43+
44+
---
45+
apiVersion: cert-manager.io/v1
46+
kind: Certificate
47+
metadata:
48+
name: {{ $fullname }}-tls
49+
namespace: {{ $namespace }}
50+
labels:
51+
{{- $labels | nindent 4 }}
52+
spec:
53+
secretName: {{ $fullname }}-tls
54+
duration: 2160h # 90 days
55+
renewBefore: 360h # 15 days
56+
subject:
57+
organizations:
58+
- psc-autoscaler
59+
commonName: {{ $commonName }}
60+
dnsNames:
61+
{{- range $altNames }}
62+
- {{ . }}
63+
{{- end }}
64+
issuerRef:
65+
name: {{ $fullname }}-ca-issuer
66+
kind: Issuer
67+
group: cert-manager.io
68+
{{- end }}

charts/psc-autoscaler/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ spec:
143143
volumes:
144144
- name: tls
145145
secret:
146+
{{- if .Values.admission.externalCertSecret.enabled }}
147+
secretName: {{ .Values.admission.externalCertSecret.tlsName }}
148+
{{- else }}
146149
secretName: {{ include "psc-autoscaler.fullname" . }}-tls
150+
{{- end }}
147151

148152
---
149153
apiVersion: apps/v1

charts/psc-autoscaler/values.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ revisionHistoryLimit: 10
33
image:
44
repository: public.ecr.aws/perfectscale-io/psc-autoscaler
55
pullPolicy: Always
6-
tag: "v1.0.24"
6+
tag: "v1.0.25"
77
settings:
88
port: 8443
99
env: "prod"
@@ -116,6 +116,16 @@ admission:
116116
# Admission Enforcer on AKS excludes kube-system and AKS internal namespaces from being processed by the webhook.
117117
# To disable this behavior, provide the following annotation:
118118
# admissions.enforcer/disabled: "true"
119+
120+
certManager:
121+
enabled: false
122+
#If you have a Kubernetes secret containing the certificates for the webhook created outside of the Helm chart,
123+
# set enabled: true under externalCertSecret, specify the secret name in the tlsName field,
124+
# and provide the actual base64 encoded CA bundle in the caCert field.
125+
externalCertSecret:
126+
enabled: false
127+
tlsName: "somename"
128+
caCert: "someCAbundle"
119129
integrationTests:
120130
enabled: true
121131
image:

0 commit comments

Comments
 (0)