diff --git a/docs/guides/help/help.md b/docs/guides/help/help.md index 67a42042..d1abf4b2 100644 --- a/docs/guides/help/help.md +++ b/docs/guides/help/help.md @@ -1559,8 +1559,11 @@ To upgrade Runtime Radar from version 0.2.0 to version 0.3.0: ``` helm upgrade --install runtime-radar -n runtime-radar --create-namespace oci://ghcr.io/runtime-radar/runtime-radar:v0.3.0 \ + --set global.tls.force=true \ ``` + ***Note.** The `global.tls.force` parameter re-issues the internal TLS certificate so that it covers the components added in version 0.3.0, and restarts the Runtime Radar components. If you use your own certificate (`global.tls.existingSecret` or `tls.cert`), add `kube-manager` to its subject alternative names before upgrading.* + If you use Runtime Radar to protect multiple clusters, do the following: 1. Update Runtime Radar in the central cluster according to the instructions above. 1. [Connect the child clusters](#9839873547) in the Runtime Radar web interface. diff --git a/install/helm/README.md b/install/helm/README.md index b41de12c..2425f611 100644 --- a/install/helm/README.md +++ b/install/helm/README.md @@ -149,6 +149,8 @@ To upgrade an existing installation: helm upgrade runtime-radar -n runtime-radar ./install/helm -f custom-values.yaml ``` +The chart-generated `cs-crt` certificate is re-issued on every upgrade and all RR components are restarted to pick it up, so the certificate always lists the components of the installed release in its subject alternative names. Set `global.tls.force=false` to keep the existing certificate. A certificate you provide yourself (`global.tls.existingSecret` or inline `tls.cert`/`tls.certKey`/`tls.certCA`) is never re-issued: add new component names, e.g. `kube-manager` in 0.3.0, to its subject alternative names before upgrading, otherwise the reverse proxy gets `502 Bad Gateway` from them. + ### Breaking changes The following breaking changes apply when upgrading from earlier versions: @@ -514,6 +516,7 @@ clickhouse: | `global.logLevel` | Logging level for components | `INFO` | | `global.tls.enabled` | Enable TLS for RR components | `true` | | `global.tls.existingSecret` | Name of the existing secret with TLS certificates | `""` | +| `global.tls.force` | Re-issue the generated TLS certificate and restart RR components on every upgrade | `true` | | `global.auth.enabled` | Enable authentication for RR components | `true` | | `global.keys.existingSecret` | Existing secret name with keys `encryption`, `token`, and `publicAccessTokenSalt` | `""` | | `global.keys.encryption` | Encryption key for secrets stored in database. Must be a 64-character hexadecimal string (32 bytes) | `""` | diff --git a/install/helm/charts/common/templates/_tls.tpl b/install/helm/charts/common/templates/_tls.tpl index 2f5f9bf8..ea6d0b53 100644 --- a/install/helm/charts/common/templates/_tls.tpl +++ b/install/helm/charts/common/templates/_tls.tpl @@ -13,6 +13,7 @@ Params: - caDaysValid - String - Optional - Days validity for the certificate. - services - List - Optional - List of services to add as alt name. - altNames - List - Optional - Alt names for CA cert. + - force - Boolean - Optional - Ignore the existing certificate and generate a new one. - prefix - String - Optional - Prefix of tls section for sane alert. */}} {{- define "common.tls.generate" -}} @@ -22,7 +23,7 @@ Params: {{- $crt := "" }} {{- $key := "" }} {{- $ca := "" }} -{{- if (pluck "lookup" ($values.tls) ($global.tls) (((.context.Values).global).tls) (dict "lookup" true) | first) }} +{{- if and (not .force) (pluck "lookup" ($values.tls) ($global.tls) (((.context.Values).global).tls) (dict "lookup" true) | first) }} {{- $crt = include "common.secrets.lookup" (dict "secret" $secret "key" "tls.crt" "context" .context) }} {{- $key = include "common.secrets.lookup" (dict "secret" $secret "key" "tls.key" "context" .context) }} {{- $ca = include "common.secrets.lookup" (dict "secret" $secret "key" "ca.crt" "context" .context) }} @@ -73,6 +74,7 @@ Params: - caDaysValid - String - Optional - Days validity for the certificate. - services - List - Optional - List of services to add as alt name. - altNames - List - Optional - Alt names for CA cert. + - force - Boolean - Optional - Ignore the existing certificate and generate a new one. - prefix - String - Optional - Prefix of tls section for sane alert. */}} {{- define "common.tls.generateSecret" -}} diff --git a/install/helm/charts/common/templates/cs/_deployment.yaml b/install/helm/charts/common/templates/cs/_deployment.yaml index 071e1ef3..8f11a011 100644 --- a/install/helm/charts/common/templates/cs/_deployment.yaml +++ b/install/helm/charts/common/templates/cs/_deployment.yaml @@ -18,7 +18,8 @@ spec: metadata: {{- $podAnnotations := include "common.podAnnotations" . }} {{- $authEnabled := eq (include "common.cs.auth.enabled" .) "true" }} - {{- if or $podAnnotations $authEnabled }} + {{- $force := and (eq (include "common.cs.tls.enabled" .) "true") ((.Values.global).tls).force }} + {{- if or $podAnnotations $authEnabled $force }} annotations: {{- with $podAnnotations }} {{- . | nindent 8 }} @@ -26,6 +27,9 @@ spec: {{- if $authEnabled }} checksum/keys: {{ default (randAlphaNum 32) ((.Values.global).keys).token | sha256sum | quote }} {{- end }} + {{- if $force }} + tls-revision: {{ .Release.Revision | quote }} + {{- end }} {{- end }} labels: {{- include "common.podLabels" . | nindent 8 }} diff --git a/install/helm/templates/tls-secret.yaml b/install/helm/templates/tls-secret.yaml index d4e8cf26..eb2c40bb 100644 --- a/install/helm/templates/tls-secret.yaml +++ b/install/helm/templates/tls-secret.yaml @@ -30,7 +30,7 @@ data: {{- $altNames = append $altNames (printf "%s.%s.svc.%s" $dep.Name $releaseNamespace $clusterDomain) }} {{- end }} {{- end }} - {{- include "common.tls.generateSecret" (dict "context" . "secret" $secretName "altNames" $altNames) | indent 2 }} + {{- include "common.tls.generateSecret" (dict "context" . "secret" $secretName "altNames" $altNames "force" (and .Values.global.tls.force (not .Values.global.tls.existingSecret))) | indent 2 }} {{- end }} {{- if and .Values.global.postgresql.tls.enabled .Values.global.postgresql.tls.verify .Values.postgresql.externalHost (not .Values.global.postgresql.tls.existingSecret) }} diff --git a/install/helm/values.schema.json b/install/helm/values.schema.json index 8d755369..7237db1a 100644 --- a/install/helm/values.schema.json +++ b/install/helm/values.schema.json @@ -32,6 +32,11 @@ "type": "string", "description": "Name of the existing secret with TLS certificates", "default": "" + }, + "force": { + "type": "boolean", + "description": "Re-issue the generated TLS certificate and restart RR components on every upgrade", + "default": true } } }, diff --git a/install/helm/values.yaml b/install/helm/values.yaml index 58e6162e..7187d730 100644 --- a/install/helm/values.yaml +++ b/install/helm/values.yaml @@ -14,6 +14,8 @@ global: enabled: true # -- Name of the existing secret with TLS certificates existingSecret: "" + # -- Re-issue the generated TLS certificate and restart RR components on every upgrade + force: true auth: # -- Enable authentication for RR components diff --git a/runtime-monitor/.helm/templates/daemonset.yaml b/runtime-monitor/.helm/templates/daemonset.yaml index 8a2e2eef..2155fd79 100644 --- a/runtime-monitor/.helm/templates/daemonset.yaml +++ b/runtime-monitor/.helm/templates/daemonset.yaml @@ -12,6 +12,9 @@ spec: metadata: annotations: checksum/configmap: {{ toJson .Values.tetragon | sha256sum }} + {{- if and (eq (include "common.cs.tls.enabled" .) "true") ((.Values.global).tls).force }} + tls-revision: {{ .Release.Revision | quote }} + {{- end }} {{- include "common.podAnnotations" . | indent 8 }} labels: {{- include "common.podLabels" . | nindent 8 }}