Skip to content

Commit

Permalink
feat: add reloader, secret-generator operator
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Jun 18, 2024
1 parent 57f96ab commit 4dd3098
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
6 changes: 6 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.fullname" . }}
annotations:
{{- if .Values.operator.reloader.enabled }}
{{- if .Values.operator.reloader.auto }}
reloader.stakater.com/auto: "true"
{{- end }}
{{- end }}
labels:
app: {{ include "app.fullname" . }}
{{ include "app.labels.common" $ | indent 4 }}
Expand Down
8 changes: 8 additions & 0 deletions templates/secret-keycloak-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "app.oidc.client.secret.name" $ }}
annotations:
{{- if .Values.operator.secretgenerator.enabled }}
{{- if .Values.operator.keycloak.client.secret.generator.enabled }}
secret-generator.v1.mittwald.de/autogenerate: secret
{{- end }}
{{- end }}
labels:
app: {{ template "app.fullname" $ }}
{{ include "app.labels.common" $ | indent 4 }}
type: Opaque
stringData:
clientId: {{ .Values.operator.keycloak.client.spec.kcConfig.clientId | default (include "app.fullname" .) }}
{{- if not .Values.operator.keycloak.client.secret.generator.enabled }}
secret: {{ include "app.oidc.client.password" $ }}
{{- end }}
{{- end }}
22 changes: 21 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ oidc:

# Kubernetes operator configuration
operator:

# secret-generator oprator
secretgenerator:
# enabled or disable secret-generator annotation
enabled: false

# reloader operator for configmap and secrets
reloader:
# enabled or disable reloader annotation
enabled: true
# enabled or disable auto reloader (all deployment references)
auto: true

# product store microservice
microservice:
# enable or disable configuration for operator
Expand Down Expand Up @@ -347,7 +360,7 @@ operator:
remoteEntry:

# default release name (product name)
productName:
productName:

# default deployment name (release_name-name or appId)
appId:
Expand All @@ -363,6 +376,13 @@ operator:
enabled: false
# Set password for secret of default name of app
password:
# secret configuration
secret:
# secret generator configuration
generator:
# enabled or disable secret generator annotation for kc client resource
enabled: true

# definition
spec:
# keycloak realm where the client has to be created
Expand Down

0 comments on commit 4dd3098

Please sign in to comment.