-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add (optional) mutating wehhook which will add hash on creation of deployments. this will prevent pod restarts when configmaps/secrets already exist - fix non-404 error handle when loading children - fix RBACs - test minimal and typical production setup - fixed reconcile loop when secrets/configmaps are missing - watch not (yet) existing secrets/configmaps for much faster updates when they are created - when using webhooks: disable scheduling when secrets/configmaps; reenable scheduling once secrets/configmaps; this prevents unneccessary container restarts
- Loading branch information
Showing
30 changed files
with
1,081 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,10 @@ rules: | |
- update | ||
- patch | ||
- watch | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
{{- if .Values.webhooks.enabled }} | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: MutatingWebhookConfiguration | ||
metadata: | ||
name: '{{ template "wave-fullname" . }}-mutating-webhook-configuration' | ||
annotations: | ||
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ template "wave-fullname" . }}-serving-cert' | ||
webhooks: | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: '{{ template "wave-fullname" . }}-webhook-service' | ||
namespace: '{{ .Release.Namespace }}' | ||
path: /mutate-apps-v1-deployment | ||
failurePolicy: Ignore | ||
name: deployments.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- deployments | ||
sideEffects: NoneOnDryRun | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: '{{ template "wave-fullname" . }}-webhook-service' | ||
namespace: '{{ .Release.Namespace }}' | ||
path: /mutate-apps-v1-statefulset | ||
failurePolicy: Ignore | ||
name: statefulsets.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- statefulsets | ||
sideEffects: NoneOnDryRun | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: '{{ template "wave-fullname" . }}-webhook-service' | ||
namespace: '{{ .Release.Namespace }}' | ||
path: /mutate-apps-v1-daemonset | ||
failurePolicy: Ignore | ||
name: daemonsets.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- daemonsets | ||
sideEffects: NoneOnDryRun | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if .Values.webhooks.enabled }} | ||
# The following manifests contain a self-signed issuer CR and a certificate CR. | ||
# More document can be found at https://docs.cert-manager.io | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ template "wave-fullname" . }}-selfsigned-issuer | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
selfSigned: {} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ template "wave-fullname" . }}-serving-cert | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
dnsNames: | ||
- {{ template "wave-fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc | ||
- {{ template "wave-fullname" . }}-webhook-service.{{ .Release.Namespace }}.svc.cluster.local | ||
issuerRef: | ||
kind: Issuer | ||
name: {{ template "wave-fullname" . }}-selfsigned-issuer | ||
secretName: {{ template "wave-fullname" . }}-webhook-server-cert | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.webhooks.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "wave-fullname" . }}-webhook-service | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "wave-labels.chart" . | nindent 4 }} | ||
spec: | ||
ports: | ||
- port: 443 | ||
targetPort: 9443 | ||
selector: | ||
{{ include "wave-labels.chart" . | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: MutatingWebhookConfiguration | ||
metadata: | ||
name: mutating-webhook-configuration | ||
webhooks: | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: webhook-service | ||
namespace: system | ||
path: /mutate-apps-v1-daemonset | ||
failurePolicy: Ignore | ||
name: daemonsets.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- daemonsets | ||
sideEffects: NoneOnDryRun | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: webhook-service | ||
namespace: system | ||
path: /mutate-apps-v1-deployment | ||
failurePolicy: Ignore | ||
name: deployments.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- deployments | ||
sideEffects: NoneOnDryRun | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: webhook-service | ||
namespace: system | ||
path: /mutate-apps-v1-statefulset | ||
failurePolicy: Ignore | ||
name: statefulsets.wave.pusher.com | ||
rules: | ||
- apiGroups: | ||
- apps | ||
apiVersions: | ||
- v1 | ||
operations: | ||
- CREATE | ||
- UPDATE | ||
resources: | ||
- statefulsets | ||
sideEffects: NoneOnDryRun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# production setup used in tests | ||
replicas: 2 | ||
|
||
webhooks: | ||
enabled: true | ||
|
||
pdb: | ||
enabled: true | ||
|
||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: topology.kubernetes.io/zone | ||
whenUnsatisfiable: ScheduleAnyway | ||
labelSelector: | ||
matchLabels: | ||
app: wave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.