-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bump dex chart to support webhooks (#1458)
* feat: bump dex chart to support webhooks * Update stable/dex/values.yaml Co-authored-by: Martin Hrabovcin <[email protected]> * Update stable/dex/values.yaml Co-authored-by: Martin Hrabovcin <[email protected]> * feat: bump dex chart to support webhooks --------- Co-authored-by: Martin Hrabovcin <[email protected]>
- Loading branch information
1 parent
284998b
commit 52ce25c
Showing
8 changed files
with
165 additions
and
5 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
Binary file not shown.
Binary file not shown.
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,40 @@ | ||
--- | ||
{{- if (.Capabilities.APIVersions.Has "cert-manager.io/v1") }} | ||
apiVersion: cert-manager.io/v1 | ||
{{- else }} | ||
apiVersion: certmanager.k8s.io/v1alpha1 | ||
{{- end }} | ||
kind: Certificate | ||
metadata: | ||
name: {{ template "dex.fullname" . }}-client-tls | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
# We have to add the following annotation so that the upgrade does | ||
# not fail with "already exists" error. See more details in: | ||
# https://github.com/helm/helm/issues/5482 | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
spec: | ||
secretName: {{ template "dex.fullname" . }}-client-tls | ||
issuerRef: | ||
name: {{ .Release.Name }}-dex-controller-ca-issuer | ||
kind: Issuer | ||
# The use of the common name field has been deprecated since 2000 and is | ||
duration: 87600h | ||
{{- if (.Capabilities.APIVersions.Has "cert-manager.io/v1") }} | ||
subject: | ||
organizations: | ||
- D2iQ | ||
{{- else }} | ||
organization: | ||
- D2iQ | ||
{{- end }} | ||
dnsNames: | ||
# names are the <name of the service>.<namespace>.svc.<domain> and | ||
# shortened variations. However, there is no way to determine the domain, | ||
# so we only include up to svc. | ||
- {{ template "dex.fullname" . }} | ||
- {{ template "dex.fullname" . }}.{{ .Release.Namespace }} | ||
- {{ template "dex.fullname" . }}.{{ .Release.Namespace }}.svc | ||
usages: | ||
- client auth |
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,79 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: pre-upgrade-job | ||
annotations: | ||
# This is what defines this resource as a hook. Without this line, the | ||
# job is considered part of the release. | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: OnFailure | ||
{{- if .Values.priorityClassName }} | ||
priorityClassName: "{{ .Values.priorityClassName }}" | ||
{{- end }} | ||
serviceAccountName: {{ .Release.Name }}-dex-pre-upgrade-hook | ||
containers: | ||
- name: create-secret | ||
image: "{{ .Values.kubectlImage }}" | ||
command: [ "/bin/sh" ] | ||
args: | ||
- -c | ||
- | | ||
kubectl get secret {{ template "dex.fullname" . }}-client-tls -n {{ .Release.namespace }} || \ | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
app: {{ template "dex.fullname" . }} | ||
controller.cert-manager.io/fao: "true" | ||
name: {{ template "dex.fullname" . }}-client-tls | ||
namespace: {{ .Release.namespace }} | ||
data: {} | ||
EOF | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: dex-pre-upgrade-hook | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["secrets"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: dex-pre-upgrade-hook | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: dex-pre-upgrade-hook | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Release.Name }}-dex-pre-upgrade-hook | ||
namespace: {{ .Release.Namespace }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Release.Name }}-dex-pre-upgrade-hook | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
"helm.sh/hook-weight": "-5" | ||
"helm.sh/hook-delete-policy": hook-succeeded |
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