-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bitnami/mysql] feat: ✨ Add TLS support (#30640)
* [bitnami/mysql] feat: ✨ Add TLS support Signed-off-by: Javier J. Salmerón García <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> * fix: 🐛 Apply requested changes Signed-off-by: Javier J. Salmerón García <[email protected]> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <[email protected]> --------- Signed-off-by: Javier J. Salmerón García <[email protected]> Signed-off-by: Bitnami Containers <[email protected]> Co-authored-by: Bitnami Containers <[email protected]>
- Loading branch information
1 parent
6278bcc
commit 151c51c
Showing
10 changed files
with
305 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,56 @@ | ||
{{- /* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }} | ||
{{- if empty .Values.tls.autoGenerated.certManager.existingIssuer }} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ printf "%s-clusterissuer" (include "common.names.fullname" .) }} | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
app.kubernetes.io/part-of: mysql | ||
app.kubernetes.io/component: mysql | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
selfSigned: {} | ||
--- | ||
{{- end }} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
app.kubernetes.io/part-of: mysql | ||
app.kubernetes.io/component: mysql | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} | ||
commonName: {{ printf "%s-ca" (include "common.names.fullname" .) }} | ||
isCA: true | ||
issuerRef: | ||
name: {{ default (printf "%s-clusterissuer" (include "common.names.fullname" .)) .Values.tls.autoGenerated.certManager.existingIssuer }} | ||
kind: {{ default "Issuer" .Values.tls.autoGenerated.certManager.existingIssuerKind }} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }} | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
app.kubernetes.io/part-of: mysql | ||
app.kubernetes.io/component: mysql | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
ca: | ||
secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} | ||
{{- 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,48 @@ | ||
{{- /* | ||
Copyright Broadcom, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ printf "%s-crt" (include "common.names.fullname" .) }} | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
app.kubernetes.io/part-of: mysql | ||
app.kubernetes.io/component: mysql | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
secretName: {{ printf "%s-crt" (include "common.names.fullname" .) }} | ||
commonName: {{ printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain }} | ||
issuerRef: | ||
name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }} | ||
kind: Issuer | ||
subject: | ||
organizations: | ||
- "MySQL" | ||
dnsNames: | ||
- '*.{{ include "common.names.namespace" . }}' | ||
- '*.{{ include "common.names.namespace" . }}.svc' | ||
- '*.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' | ||
- '*.{{ include "mysql.primary.fullname" . }}' | ||
- '*.{{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}' | ||
- '*.{{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc' | ||
- '*.{{ include "mysql.primary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' | ||
- '*.{{ include "mysql.secondary.fullname" . }}' | ||
- '*.{{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}' | ||
- '*.{{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc' | ||
- '*.{{ include "mysql.secondary.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' | ||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}' | ||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}' | ||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}.svc' | ||
- '*.{{ printf "%s-headless" (include "common.names.fullname" .) }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' | ||
privateKey: | ||
algorithm: {{ .Values.tls.autoGenerated.certManager.keyAlgorithm }} | ||
size: {{ int .Values.tls.autoGenerated.certManager.keySize }} | ||
duration: {{ .Values.tls.autoGenerated.certManager.duration }} | ||
renewBefore: {{ .Values.tls.autoGenerated.certManager.renewBefore }} | ||
{{- 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
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.