Add cilium chart
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{{- if .Values.hubble.metrics.dashboards.enabled }}
|
||||
{{- $files := .Files.Glob "files/hubble/dashboards/*.json" }}
|
||||
{{- range $path, $fileContents := $files }}
|
||||
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ $dashboardName | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ $.Values.hubble.metrics.dashboards.namespace | default $.Release.Namespace }}
|
||||
labels:
|
||||
k8s-app: hubble
|
||||
app.kubernetes.io/name: hubble
|
||||
app.kubernetes.io/part-of: cilium
|
||||
{{- if $.Values.hubble.metrics.dashboards.label }}
|
||||
{{ $.Values.hubble.metrics.dashboards.label }}: {{ ternary $.Values.hubble.metrics.dashboards.labelValue "1" (not (empty $.Values.hubble.metrics.dashboards.labelValue)) | quote }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.hubble.metrics.dashboards.annotations $.Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- with $.Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.hubble.metrics.dashboards.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hubble-metrics
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
k8s-app: hubble
|
||||
app.kubernetes.io/name: hubble
|
||||
app.kubernetes.io/part-of: cilium
|
||||
annotations:
|
||||
{{- with .Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.metrics.serviceAnnotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.hubble.metrics.serviceMonitor.enabled }}
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: {{ .Values.hubble.metrics.port | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: hubble-metrics
|
||||
port: {{ .Values.hubble.metrics.port }}
|
||||
protocol: TCP
|
||||
targetPort: hubble-metrics
|
||||
selector:
|
||||
k8s-app: cilium
|
||||
{{- end }}
|
||||
@@ -0,0 +1,30 @@
|
||||
{{- if and .Values.agent .Values.hubble.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hubble-peer
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
k8s-app: cilium
|
||||
app.kubernetes.io/part-of: cilium
|
||||
app.kubernetes.io/name: hubble-peer
|
||||
spec:
|
||||
selector:
|
||||
k8s-app: cilium
|
||||
ports:
|
||||
- name: peer-service
|
||||
{{- if .Values.hubble.peerService.servicePort }}
|
||||
port: {{ .Values.hubble.peerService.servicePort }}
|
||||
{{- else }}
|
||||
port: {{ .Values.hubble.tls.enabled | ternary 443 80 }}
|
||||
{{- end }}
|
||||
protocol: TCP
|
||||
targetPort: {{ .Values.hubble.peerService.targetPort }}
|
||||
{{- if semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion }}
|
||||
internalTrafficPolicy: Local
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.metrics.enabled .Values.hubble.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: hubble
|
||||
namespace: {{ .Values.prometheus.serviceMonitor.namespace | default .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/part-of: cilium
|
||||
{{- with .Values.hubble.metrics.serviceMonitor.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.hubble.metrics.serviceMonitor.annotations .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.metrics.serviceMonitor.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: hubble
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
endpoints:
|
||||
- port: hubble-metrics
|
||||
interval: {{ .Values.hubble.metrics.serviceMonitor.interval | quote }}
|
||||
honorLabels: true
|
||||
path: /metrics
|
||||
{{- with .Values.hubble.metrics.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.metrics.serviceMonitor.jobLabel }}
|
||||
jobLabel: {{ .Values.hubble.metrics.serviceMonitor.jobLabel | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "certmanager") .Values.hubble.relay.enabled }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: hubble-relay-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
issuerRef:
|
||||
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
|
||||
secretName: hubble-relay-client-certs
|
||||
commonName: "*.hubble-relay.cilium.io"
|
||||
dnsNames:
|
||||
- "*.hubble-relay.cilium.io"
|
||||
duration: {{ printf "%dh0m0s" (mul .Values.hubble.tls.auto.certValidityDuration 24) }}
|
||||
privateKey:
|
||||
rotationPolicy: Always
|
||||
{{- end }}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "certmanager") .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: hubble-relay-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
issuerRef:
|
||||
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
|
||||
secretName: hubble-relay-server-certs
|
||||
commonName: "*.hubble-relay.cilium.io"
|
||||
dnsNames:
|
||||
- "*.hubble-relay.cilium.io"
|
||||
{{- range $dns := .Values.hubble.relay.tls.server.extraDnsNames }}
|
||||
- {{ $dns | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.relay.tls.server.extraIpAddresses }}
|
||||
ipAddresses:
|
||||
{{- range $ip := .Values.hubble.relay.tls.server.extraIpAddresses }}
|
||||
- {{ $ip | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
duration: {{ printf "%dh0m0s" (mul .Values.hubble.tls.auto.certValidityDuration 24) }}
|
||||
privateKey:
|
||||
rotationPolicy: Always
|
||||
{{- end }}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "certmanager") }}
|
||||
{{- $cn := list "*" (.Values.cluster.name | replace "." "-") "hubble-grpc.cilium.io" | join "." }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: hubble-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
issuerRef:
|
||||
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
|
||||
secretName: hubble-server-certs
|
||||
commonName: {{ $cn | quote }}
|
||||
dnsNames:
|
||||
- {{ $cn | quote }}
|
||||
{{- range $dns := .Values.hubble.tls.server.extraDnsNames }}
|
||||
- {{ $dns | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.hubble.tls.server.extraIpAddresses }}
|
||||
ipAddresses:
|
||||
{{- range $ip := .Values.hubble.tls.server.extraIpAddresses }}
|
||||
- {{ $ip | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
duration: {{ printf "%dh0m0s" (mul .Values.hubble.tls.auto.certValidityDuration 24) }}
|
||||
privateKey:
|
||||
rotationPolicy: Always
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "certmanager") .Values.hubble.ui.enabled .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: hubble-ui-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
issuerRef:
|
||||
{{- toYaml .Values.hubble.tls.auto.certManagerIssuerRef | nindent 4 }}
|
||||
secretName: hubble-ui-client-certs
|
||||
commonName: "*.hubble-ui.cilium.io"
|
||||
dnsNames:
|
||||
- "*.hubble-ui.cilium.io"
|
||||
duration: {{ printf "%dh0m0s" (mul .Values.hubble.tls.auto.certValidityDuration 24) }}
|
||||
privateKey:
|
||||
rotationPolicy: Always
|
||||
{{- end }}
|
||||
@@ -0,0 +1,68 @@
|
||||
{{- define "hubble-generate-certs.job.spec" }}
|
||||
{{- $certValiditySecondsStr := printf "%ds" (mul .Values.hubble.tls.auto.certValidityDuration 24 60 60) -}}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
{{- with .Values.certgen.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: certgen
|
||||
image: {{ include "cilium.image" .Values.certgen.image | quote }}
|
||||
imagePullPolicy: {{ .Values.certgen.image.pullPolicy }}
|
||||
command:
|
||||
- "/usr/bin/cilium-certgen"
|
||||
# Because this is executed as a job, we pass the values as command
|
||||
# line args instead of via config map. This allows users to inspect
|
||||
# the values used in past runs by inspecting the completed pod.
|
||||
args:
|
||||
- "--cilium-namespace={{ .Release.Namespace }}"
|
||||
{{- if .Values.debug.enabled }}
|
||||
- "--debug"
|
||||
{{- end }}
|
||||
- "--ca-generate"
|
||||
- "--ca-reuse-secret"
|
||||
{{- if and .Values.tls.ca.cert .Values.tls.ca.key }}
|
||||
- "--ca-secret-name=cilium-ca"
|
||||
{{- end }}
|
||||
- "--hubble-server-cert-generate"
|
||||
- "--hubble-server-cert-common-name={{ list "*" (.Values.cluster.name | replace "." "-") "hubble-grpc.cilium.io" | join "." }}"
|
||||
- "--hubble-server-cert-validity-duration={{ $certValiditySecondsStr }}"
|
||||
{{- if .Values.hubble.relay.enabled }}
|
||||
- "--hubble-relay-client-cert-generate"
|
||||
- "--hubble-relay-client-cert-validity-duration={{ $certValiditySecondsStr }}"
|
||||
{{- end }}
|
||||
{{- if and .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
- "--hubble-relay-server-cert-generate"
|
||||
- "--hubble-relay-server-cert-validity-duration={{ $certValiditySecondsStr }}"
|
||||
{{- end }}
|
||||
{{- with .Values.certgen.extraVolumeMounts }}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
hostNetwork: true
|
||||
{{- with .Values.certgen.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccount: {{ .Values.serviceAccounts.hubblecertgen.name | quote }}
|
||||
serviceAccountName: {{ .Values.serviceAccounts.hubblecertgen.name | quote }}
|
||||
automountServiceAccountToken: {{ .Values.serviceAccounts.hubblecertgen.automount }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
restartPolicy: OnFailure
|
||||
{{- with .Values.certgen.extraVolumes }}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
affinity:
|
||||
{{- with .Values.certgen.affinity }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
ttlSecondsAfterFinished: {{ .Values.certgen.ttlSecondsAfterFinished }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,38 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "cronJob") .Values.serviceAccounts.hubblecertgen.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/part-of: cilium
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
resourceNames:
|
||||
- hubble-server-certs
|
||||
- hubble-relay-client-certs
|
||||
- hubble-relay-server-certs
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
resourceNames:
|
||||
- cilium-ca
|
||||
verbs:
|
||||
- get
|
||||
- update
|
||||
{{- end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "cronJob") .Values.serviceAccounts.hubblecertgen.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/part-of: cilium
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: hubble-generate-certs
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccounts.hubblecertgen.name | quote }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "cronJob") .Values.hubble.tls.auto.schedule }}
|
||||
apiVersion: {{ include "cronjob.apiVersion" . }}
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
app.kubernetes.io/name: hubble-generate-certs
|
||||
app.kubernetes.io/part-of: cilium
|
||||
{{- if or .Values.certgen.annotations.cronJob .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.certgen.annotations.cronJob }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
schedule: {{ .Values.hubble.tls.auto.schedule | quote }}
|
||||
concurrencyPolicy: Forbid
|
||||
jobTemplate:
|
||||
{{- include "hubble-generate-certs.job.spec" . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "cronJob") }}
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: hubble-generate-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
k8s-app: hubble-generate-certs
|
||||
app.kubernetes.io/name: hubble-generate-certs
|
||||
app.kubernetes.io/part-of: cilium
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
{{- with .Values.certgen.annotations.job }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{ include "hubble-generate-certs.job.spec" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "cronJob") .Values.serviceAccounts.hubblecertgen.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccounts.hubblecertgen.name | quote }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- if or .Values.serviceAccounts.hubblecertgen.annotations .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- with .Values.hubble.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceAccounts.hubblecertgen.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{/*
|
||||
Generate TLS certificates for Hubble Server and Hubble Relay.
|
||||
|
||||
Note: Always use this template as follows:
|
||||
|
||||
{{- $_ := include "hubble-generate-certs.helm.setup-ca" . -}}
|
||||
|
||||
The assignment to `$_` is required because we store the generated CI in a global `ca` variable.
|
||||
Please, don't try to "simplify" this, as without this trick, every generated
|
||||
certificate would be signed by a different CA.
|
||||
*/}}
|
||||
{{- define "hubble-generate-certs.helm.setup-ca" }}
|
||||
{{- if not .ca }}
|
||||
{{- $ca := "" -}}
|
||||
{{- $crt := .Values.tls.ca.cert -}}
|
||||
{{- $key := .Values.tls.ca.key -}}
|
||||
{{- if and $crt $key }}
|
||||
{{- $ca = buildCustomCert $crt $key -}}
|
||||
{{- else }}
|
||||
{{- $_ := include "cilium.ca.setup" . -}}
|
||||
{{- with lookup "v1" "Secret" .Release.Namespace .commonCASecretName }}
|
||||
{{- $crt := index .data "ca.crt" }}
|
||||
{{- $key := index .data "ca.key" }}
|
||||
{{- $ca = buildCustomCert $crt $key -}}
|
||||
{{- else }}
|
||||
{{- $ca = .commonCA -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $_ := set . "ca" $ca -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "helm") .Values.hubble.relay.enabled }}
|
||||
{{- $_ := include "hubble-generate-certs.helm.setup-ca" . -}}
|
||||
{{- $cn := "*.hubble-relay.cilium.io" }}
|
||||
{{- $dns := list $cn }}
|
||||
{{- $cert := genSignedCert $cn nil $dns (.Values.hubble.tls.auto.certValidityDuration | int) .ca -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-relay-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .ca.Cert | b64enc }}
|
||||
tls.crt: {{ $cert.Cert | b64enc }}
|
||||
tls.key: {{ $cert.Key | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "helm") .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
{{- $_ := include "hubble-generate-certs.helm.setup-ca" . -}}
|
||||
{{- $cn := "*.hubble-relay.cilium.io" }}
|
||||
{{- $ip := .Values.hubble.relay.tls.server.extraIpAddresses }}
|
||||
{{- $dns := prepend .Values.hubble.relay.tls.server.extraDnsNames $cn }}
|
||||
{{- $cert := genSignedCert $cn $ip $dns (.Values.hubble.tls.auto.certValidityDuration | int) .ca -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-relay-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .ca.Cert | b64enc }}
|
||||
tls.crt: {{ $cert.Cert | b64enc }}
|
||||
tls.key: {{ $cert.Key | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if and .Values.agent .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "helm") }}
|
||||
{{- $_ := include "hubble-generate-certs.helm.setup-ca" . -}}
|
||||
{{- $cn := list "*" (.Values.cluster.name | replace "." "-") "hubble-grpc.cilium.io" | join "." }}
|
||||
{{- $ip := .Values.hubble.tls.server.extraIpAddresses }}
|
||||
{{- $dns := prepend .Values.hubble.tls.server.extraDnsNames $cn }}
|
||||
{{- $cert := genSignedCert $cn $ip $dns (.Values.hubble.tls.auto.certValidityDuration | int) .ca -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .ca.Cert | b64enc }}
|
||||
tls.crt: {{ $cert.Cert | b64enc }}
|
||||
tls.key: {{ $cert.Key | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled .Values.hubble.tls.auto.enabled (eq .Values.hubble.tls.auto.method "helm") .Values.hubble.ui.enabled .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
{{- $_ := include "hubble-generate-certs.helm.setup-ca" . -}}
|
||||
{{- $cn := "*.hubble-ui.cilium.io" }}
|
||||
{{- $dns := list $cn }}
|
||||
{{- $cert := genSignedCert $cn nil $dns (.Values.hubble.tls.auto.certValidityDuration | int) .ca -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-ui-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .ca.Cert | b64enc }}
|
||||
tls.crt: {{ $cert.Cert | b64enc }}
|
||||
tls.key: {{ $cert.Key | b64enc }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled (not .Values.hubble.tls.auto.enabled) .Values.hubble.relay.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-relay-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .Values.tls.ca.cert }}
|
||||
tls.crt: {{ .Values.hubble.relay.tls.client.cert | required "missing hubble.relay.tls.client.cert" }}
|
||||
tls.key: {{ .Values.hubble.relay.tls.client.key | required "missing hubble.relay.tls.client.key" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled (not .Values.hubble.tls.auto.enabled) .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-relay-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .Values.tls.ca.cert }}
|
||||
tls.crt: {{ .Values.hubble.relay.tls.server.cert | required "missing hubble.relay.tls.server.cert" }}
|
||||
tls.key: {{ .Values.hubble.relay.tls.server.key | required "missing hubble.relay.tls.server.key" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and .Values.agent .Values.hubble.enabled .Values.hubble.tls.enabled (not .Values.hubble.tls.auto.enabled) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-server-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .Values.tls.ca.cert }}
|
||||
tls.crt: {{ .Values.hubble.tls.server.cert | required "missing hubble.tls.server.cert" }}
|
||||
tls.key: {{ .Values.hubble.tls.server.key | required "missing hubble.tls.server.key" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if and .Values.hubble.enabled .Values.hubble.tls.enabled (not .Values.hubble.tls.auto.enabled) .Values.hubble.ui.enabled .Values.hubble.relay.enabled .Values.hubble.relay.tls.server.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: hubble-ui-client-certs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- with .Values.hubble.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
ca.crt: {{ .Values.tls.ca.cert }}
|
||||
tls.crt: {{ .Values.hubble.ui.tls.client.cert | required "missing hubble.ui.tls.client.cert" }}
|
||||
tls.key: {{ .Values.hubble.ui.tls.client.key | required "missing hubble.ui.tls.client.key" }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user