mirror of
https://github.com/kerberos-io/helm-charts.git
synced 2026-08-23 15:18:33 +00:00
Merge pull request #80 from kerberos-io/feature/add-tls-certificate
feature/add-tls-certificate
This commit is contained in:
17
charts/hub/examples/hub-api-server-tls-secret.yaml
Normal file
17
charts/hub/examples/hub-api-server-tls-secret.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hub-api-server-tls
|
||||
namespace: kerberos-hub
|
||||
type: kubernetes.io/tls
|
||||
stringData:
|
||||
# Paste your PEM certificate chain here (e.g., fullchain.pem)
|
||||
tls.crt: |
|
||||
-----BEGIN CERTIFICATE-----
|
||||
REPLACE_WITH_YOUR_CERTIFICATE
|
||||
-----END CERTIFICATE-----
|
||||
# Paste your PEM private key here (e.g., privkey.pem)
|
||||
tls.key: |
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
REPLACE_WITH_YOUR_PRIVATE_KEY
|
||||
-----END PRIVATE KEY-----
|
||||
@@ -127,10 +127,18 @@ spec:
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.kerberoshub.api.volumes }}
|
||||
{{- $serverTLS := .Values.kerberoshub.api.serverTLS }}
|
||||
{{- if or .Values.kerberoshub.api.volumes (and $serverTLS.enabled $serverTLS.secretName) }}
|
||||
volumes:
|
||||
{{- with .Values.kerberoshub.api.volumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and $serverTLS.enabled $serverTLS.secretName }}
|
||||
- name: hub-api-server-tls
|
||||
secret:
|
||||
secretName: {{ $serverTLS.secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: hub-api
|
||||
image: "{{ .Values.global.imageRegistry }}{{ .Values.kerberoshub.api.repository }}:{{ .Values.kerberoshub.api.tag }}"
|
||||
@@ -142,10 +150,17 @@ spec:
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
{{- with .Values.kerberoshub.api.volumeMounts}}
|
||||
{{- if or .Values.kerberoshub.api.volumeMounts (and $serverTLS.enabled $serverTLS.secretName) }}
|
||||
volumeMounts:
|
||||
{{- with .Values.kerberoshub.api.volumeMounts}}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and $serverTLS.enabled $serverTLS.secretName }}
|
||||
- name: hub-api-server-tls
|
||||
mountPath: {{ $serverTLS.mountPath }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
# Mongodb - loaded from ConfigMap
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
@@ -178,6 +193,12 @@ spec:
|
||||
value: "{{ .Values.kerberoshub.api.fallbackLanguage }}"
|
||||
- name: API_KEY
|
||||
value: "{{ .Values.kerberoshub.api.apiKey }}"
|
||||
{{- if .Values.kerberoshub.api.serverTLS.enabled }}
|
||||
- name: TLS_CERT_FILE
|
||||
value: "{{ .Values.kerberoshub.api.serverTLS.certFile }}"
|
||||
- name: TLS_KEY_FILE
|
||||
value: "{{ .Values.kerberoshub.api.serverTLS.keyFile }}"
|
||||
{{- end }}
|
||||
|
||||
# Kerberos Hub
|
||||
- name: LICENSE_KEY
|
||||
|
||||
@@ -209,6 +209,16 @@ kerberoshub:
|
||||
# persistentVolumeClaim:
|
||||
# claimName: custom-layout-claim
|
||||
|
||||
# Server-side TLS for hub-api itself (port 8081).
|
||||
# When enabled, TLS_CERT_FILE and TLS_KEY_FILE are injected and
|
||||
# the provided Kubernetes TLS secret is mounted read-only.
|
||||
serverTLS:
|
||||
enabled: false
|
||||
secretName: ""
|
||||
mountPath: "/etc/hub-api/tls"
|
||||
certFile: "/etc/hub-api/tls/tls.crt"
|
||||
keyFile: "/etc/hub-api/tls/tls.key"
|
||||
|
||||
# When migrating to another url, this might help migrating.
|
||||
#legacyUrl: "api.legacy.yourdomain.com"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user