-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ccojocar/dex_grpc_client
feat:(dex grpc) add gRPC client for dex server
- Loading branch information
Showing
11 changed files
with
390 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
charts/sso-operator/templates/job-install-grpc-secrets.yaml
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,43 @@ | ||
{{- if .Values.dex.certs.install.create }} | ||
{{ $caName := .Values.dex.certs.grpcCA }} | ||
{{ $clientTlsSecretName := .Values.dex.certs.grpcClientTls }} | ||
{{ $sourceNamespace := .Values.dex.certs.install.sourceNamespace }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "4" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
name: job-install-grpc-secrets | ||
labels: | ||
draft: {{ default "draft-app" .Values.draft }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
spec: | ||
activeDeadlineSeconds: {{ .Values.dex.certs.install.activeDeadlineSeconds }} | ||
template: | ||
metadata: | ||
labels: | ||
release: "{{ .Release.Name }}" | ||
component: "job" | ||
spec: | ||
serviceAccountName: {{ template "fullname" . }}-install-certs | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: main | ||
image: "{{ .Values.dex.certs.install.image }}:{{ .Values.dex.certs.install.imageTag }}" | ||
imagePullPolicy: {{ .Values.dex.certs.install.imagePullPolicy }} | ||
command: | ||
- /bin/bash | ||
- -exc | ||
- | | ||
# Cleanup the existing config map and secrets | ||
kubectl delete configmap {{ $caName }} --namespace {{ .Release.Namespace }} || true | ||
kubectl delete secret {{ $clientTlsSecretName }} --namespace {{ .Release.Namespace }} || true | ||
# Copy the secrts from source namespace | ||
kubectl get secret {{ $clientTlsSecretName }} --namespace={{ $sourceNamespace }} --export -o yaml |\ | ||
kubectl apply --namespace={{ .Release.Namespace }} -f - | ||
kubectl get cm {{ $caName }} --namespace={{ $sourceNamespace }} --export -o yaml |\ | ||
kubectl apply --namespace={{ .Release.Namespace }} -f - | ||
{{- 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,16 @@ | ||
{{- if .Values.dex.certs.install.create }} | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
metadata: | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "2" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
name: {{ template "fullname" . }}-install-certs | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["secrets", "configmaps"] | ||
verbs: ["*"] | ||
{{- 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,22 @@ | ||
{{- if .Values.dex.certs.install.create }} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "3" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
name: {{ template "fullname" . }}-install-certs | ||
namespace: {{ .Values.dex.certs.install.sourceNamespace }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ template "fullname" . }}-install-certs | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "fullname" . }}-install-certs | ||
namespace: {{ .Release.Namespace }} | ||
|
||
{{- 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,14 @@ | ||
{{- if .Values.dex.certs.install.create }} | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
name: {{ template "fullname" . }}-install-certs | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
{{- 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
Oops, something went wrong.