Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions charts/temporal/ci/certificates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
server:
additionalVolumeMounts:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we automate these volumes/volumeMounts via helpers so that the user doesn't need to include them in their values? They are all boiler plate as the variable names and locations are all determined by Temporal itself. We can use a server.tls or similar values structure that mixes in the relevant volumes/mounts alongside any additional* the user has set. Likewise web.tls.

- name: tls-certs
mountPath: /etc/tls
- name: temporal-tls-certs
mountPath: /etc/temporal/tls
additionalVolumes:
- name: tls-certs
secret:
secretName: tls-certs
- name: temporal-tls-certs
secret:
secretName: temporal-tls-certs
config:
tls:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can build config.tls automatically based on interpreting a more concise server.tls stanza also. Most of this is also boiler plate, just not sure about requireClientAuth and serverName for example. I defer to your knowledge of what should be customisable there.

internode:
server:
certFile: "/etc/temporal/tls/tls.crt"
keyFile: "/etc/temporal/tls/tls.key"
requireClientAuth: true
clientCaFiles:
- "/etc/temporal/tls/ca.crt"
client:
serverName: ""
rootCaFiles:
- "/etc/temporal/tls/ca.crt"
frontend:
server:
certFile: "/etc/temporal/tls/tls.crt"
keyFile: "/etc/temporal/tls/tls.key"
requireClientAuth: false
client:
serverName: ""
rootCaFiles:
- "/etc/temporal/tls/ca.crt"
web:
additionalVolumeMounts:
- name: tls-certs
mountPath: /etc/tls
- name: temporal-tls-certs
mountPath: /etc/temporal/tls
additionalVolumes:
- name: tls-certs
secret:
secretName: tls-certs
- name: temporal-tls-certs
secret:
secretName: temporal-tls-certs
additionalEnv:
- name: TEMPORAL_TLS_SERVER_NAME
value: ""
- name: TEMPORAL_TLS_CA
value: /etc/temporal/tls/ca.crt
- name: TEMPORAL_TLS_CERT
value: /etc/temporal/tls/tls.crt
- name: TEMPORAL_TLS_KEY
value: /etc/temporal/tls/tls.key
frontend:
service:
enabled: true
ingress:
enabled: true
className: ""
hosts:
- ""
additionalSecrets:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these basically placeholders that cert-manager updates?

- name: tls-certs
value:
tls.crt: |
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
tls.key: |
-----BEGIN EC PRIVATE KEY-----
-----END EC PRIVATE KEY-----
certificates:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, maybe we add the volumes/mounts based on this block? Not sure if need to have server. and web. variants though, would it be valid to want cert manager for one but not the other?

enabled: false
issuer:
name: temporal-issuer
secretName: tls-certs
certificate:
name: temporal-cert
isCA: false
secret:
name: temporal-tls-certs
privateKey:
algorithm: RSA
size: 2048
rotationPolicy: Always
annotations:
argocd.argoproj.io/hook: PreSync
28 changes: 28 additions & 0 deletions charts/temporal/templates/certificates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
{{- if .Values.certificates.enabled }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ .Values.certificates.issuer.name }}
spec:
ca:
secretName: {{ .Values.certificates.issuer.secretName }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Values.certificates.certificate.name }}
spec:
dnsNames:
- {{ index .Values.server.frontend.ingress.hosts 0 }}
commonName: {{ index .Values.server.frontend.ingress.hosts 0 }}
isCA: {{ .Values.certificates.certificate.isCA }}
issuerRef:
kind: Issuer
name: {{ .Values.certificates.issuer.name }}
secretName: {{ .Values.certificates.certificate.secret.name }}
privateKey:
algorithm: {{ .Values.certificates.certificate.privateKey.algorithm }}
size: {{ .Values.certificates.certificate.privateKey.size }}
rotationPolicy: {{ .Values.certificates.certificate.privateKey.rotationPolicy }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/temporal/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.additionalSecrets }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add an additionalSecrets concept here, but rather have secrets specific to TLS. I think there is actually a specific kind of secret in k8s for certificates?

{{- range .Values.additionalSecrets }}
apiVersion: v1
kind: Secret
metadata:
name: "{{ .name }}"
data:
{{- range $key, $val := .value }}
{{ $key }}: {{ $val | b64enc | nindent 4 }}
{{- end }}
type: Opaque
{{- end }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -537,4 +537,29 @@ shims:
elasticsearchTool: true
test:
podAnnotations: {}

certificates:
enabled: false
issuer:
name: temporal-issuer
secretName: tls-certs
certificate:
name: temporal-cert
isCA: false
secret:
name: temporal-tls-certs
privateKey:
algorithm: RSA
size: 2048
rotationPolicy: Always

additionalSecrets: []
# - name: tls-certs
# value:
# tls.crt: |
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# tls.key: |
# -----BEGIN EC PRIVATE KEY-----
# -----END EC PRIVATE KEY-----
resources: {}