Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm: mandate issuer configuration when using cert-manager to generate certificates #24666

Merged
merged 2 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Documentation/helm-values.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions install/kubernetes/cilium/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "clustermesh-apiserver-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: clustermesh-apiserver-admin-cert
commonName: {{ include "clustermesh-apiserver-generate-certs.admin-common-name" . }}
dnsNames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "clustermesh-apiserver-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: clustermesh-apiserver-client-cert
commonName: externalworkload
duration: {{ printf "%dh0m0s" (mul .Values.clustermesh.apiserver.tls.auto.certValidityDuration 24) }}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "clustermesh-apiserver-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: clustermesh-apiserver-remote-cert
commonName: {{ include "clustermesh-apiserver-generate-certs.remote-common-name" . }}
duration: {{ printf "%dh0m0s" (mul .Values.clustermesh.apiserver.tls.auto.certValidityDuration 24) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "clustermesh-apiserver-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef | nindent 4 }}
sayboras marked this conversation as resolved.
Show resolved Hide resolved
secretName: clustermesh-apiserver-server-cert
commonName: clustermesh-apiserver.cilium.io
dnsNames:
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "hubble-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: hubble-relay-client-certs
commonName: "*.hubble-relay.cilium.io"
dnsNames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "hubble-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: hubble-relay-server-certs
commonName: "*.hubble-relay.cilium.io"
dnsNames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "hubble-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
sayboras marked this conversation as resolved.
Show resolved Hide resolved
secretName: hubble-server-certs
commonName: {{ $cn | quote }}
dnsNames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
issuerRef:
{{- include "hubble-generate-certs.certmanager.issuer" . | nindent 4 }}
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
secretName: hubble-ui-client-certs
commonName: "*.hubble-ui.cilium.io"
dnsNames:
Expand Down
12 changes: 12 additions & 0 deletions install/kubernetes/cilium/templates/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
{{- end }}
{{- end }}

{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "certmanager") }}
{{- if not .Values.hubble.tls.auto.certManagerIssuerRef }}
{{ fail "Hubble TLS certgen method=certmanager requires that user specifies .Values.hubble.tls.auto.certManagerIssuerRef" }}
{{- end }}
{{- end }}

{{- if and (or .Values.externalWorkloads.enabled .Values.clustermesh.useAPIServer) .Values.clustermesh.apiserver.tls.auto.enabled (eq .Values.clustermesh.apiserver.tls.auto.method "certmanager") }}
{{- if not .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef }}
{{ fail "ClusterMesh TLS certgen method=certmanager requires that user specifies .Values.clustermesh.apiserver.tls.auto.certManagerIssuerRef" }}
{{- end }}
{{- end }}

{{/* validate hubble-ui specific config */}}
{{- if and .Values.hubble.ui.enabled
(ne .Values.hubble.ui.backend.image.tag "latest")
Expand Down
4 changes: 1 addition & 3 deletions install/kubernetes/cilium/values.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions install/kubernetes/cilium/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,6 @@ hubble:
# kind: ClusterIssuer
# name: ca-issuer
# -- certmanager issuer used when hubble.tls.auto.method=certmanager.
# If not specified, a CA issuer will be created.
certManagerIssuerRef: {}

# -- Deprecated in favor of tls.ca. To be removed in 1.13.
Expand Down Expand Up @@ -2176,7 +2175,7 @@ nodeinit:
# -- bootstrapFile is the location of the file where the bootstrap timestamp is
# written by the node-init DaemonSet
bootstrapFile: "/tmp/cilium-bootstrap.d/cilium-bootstrap-time"

# -- startup offers way to customize startup nodeinit script (pre and post position)
startup:
preScript: ""
Expand Down Expand Up @@ -2542,7 +2541,6 @@ clustermesh:
# kind: ClusterIssuer
# name: ca-issuer
# -- certmanager issuer used when clustermesh.apiserver.tls.auto.method=certmanager.
# If not specified, a CA issuer will be created.
certManagerIssuerRef: {}
# -- base64 encoded PEM values for the ExternalWorkload CA certificate and private key.
ca:
Expand Down