Skip to content

Commit

Permalink
feat(helm): add existingSecret variables (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohdearaugustin committed Mar 17, 2021
1 parent 2ead19c commit 48fd3f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion helm/akhq/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.17.0"
description: Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
name: akhq
version: 0.2.0
version: 0.2.1
keywords:
- kafka
- confluent
Expand Down
12 changes: 8 additions & 4 deletions helm/akhq/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
{{- if .Values.configuration }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.secrets }}
{{- if and (not .Values.existingSecret) (.Values.secrets) }}
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.image.annotations }}
Expand Down Expand Up @@ -57,7 +57,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy | default "Always" }}
env:
{{- if .Values.extraEnv }}{{ toYaml .Values.extraEnv | trim | nindent 12 }}{{ end }}
{{- if .Values.secrets }}
{{- if or (.Values.existingSecrets) (.Values.secrets) }}
- name: MICRONAUT_ENVIRONMENTS
value: secrets
- name: MICRONAUT_CONFIG_FILES
Expand All @@ -70,7 +70,7 @@ spec:
mountPath: /app/application.yml
subPath: application.yml
{{- end }}
{{- if .Values.secrets }}
{{- if or (.Values.existingSecrets) (.Values.secrets) }}
- name: secrets
mountPath: /app/application-secrets.yml
subPath: application-secrets.yml
Expand Down Expand Up @@ -110,8 +110,12 @@ spec:
configMap:
name: {{ template "akhq.fullname" . }}
{{- end }}
{{- if .Values.secrets }}
{{- if or (.Values.existingSecrets) (.Values.secrets) }}
- name: secrets
secret:
{{- if .Values.existingSecrets }}
secretName: {{ .Values.existingSecrets }}
{{- else }}
secretName: {{ template "akhq.fullname" . }}-secrets
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/akhq/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.secrets }}
{{- if and ( not .Values.existingSecrets) (.Values.secrets) }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -16,4 +16,4 @@ data:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
40 changes: 21 additions & 19 deletions helm/akhq/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,29 @@ extraEnv: []
configuration: |
akhq:
server:
access-log:
enabled: false
access-log:
enabled: false
name: org.akhq.log.access
##... and secret for connection information
secrets: |
akhq:
connections:
my-cluster-plain-text:
properties:
bootstrap.servers: "kafka:9092"
schema-registry:
url: "http://schema-registry:8085"
type: "confluent"
basic-auth-username: basic-auth-user
basic-auth-password: basic-auth-pass
connect:
- name: "my-connect"
url: "http://connect:8083"
basic-auth-username: basic-auth-user
basic-auth-password: basic-auth-pass
existingSecrets: ""
# name of the existingSecret
secrets: {}
# akhq:
# connections:
# my-cluster-plain-text:
# properties:
# bootstrap.servers: "kafka:9092"
# schema-registry:
# url: "http://schema-registry:8085"
# type: "confluent"
# basic-auth-username: basic-auth-user
# basic-auth-password: basic-auth-pass
# connect:
# - name: "my-connect"
# url: "http://connect:8083"
# basic-auth-username: basic-auth-user
# basic-auth-password: basic-auth-pass

kafkaSecrets: []
#Provide extra base64 encoded kubernetes secrets (keystore/truststore)
Expand All @@ -64,7 +66,7 @@ serviceAccountName: null

# Add your own init container or uncomment and modify the example.
initContainers: {}
# create-keystore:
# create-keystore:
# image: "openjdk:11-slim"
# command: ['sh', '-c', 'keytool']
# volumeMounts:
Expand Down

0 comments on commit 48fd3f4

Please sign in to comment.