diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/README.md b/charts/spire/charts/spiffe-oidc-discovery-provider/README.md index 8fab9b8..88d9d79 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/README.md +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/README.md @@ -29,6 +29,8 @@ A Helm chart to install the SPIFFE OIDC discovery provider. | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `agentSocketName` | The name of the spire-agent unix socket | `spire-agent.sock` | | `csiDriverName` | The csi driver to use | `csi.spiffe.io` | +| `bundleSource` | Configure where to fetch the trust bundle from. Must be CSI or ConfigMap. | `CSI` | +| `bundleConfigMap` | ConfigMap name for SPIRE bundle when bundleSource is ConfigMap | `spire-bundle` | | `replicaCount` | Replica count | `1` | | `namespaceOverride` | Namespace override | `""` | | `annotations` | Annotations for the deployment | `{}` | diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml index 06a52f3..30e970e 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml @@ -1,3 +1,6 @@ +{{- if and (ne .Values.bundleSource "ConfigMap") (ne .Values.bundleSource "CSI") }} +{{- fail "Bundle source must be CSI or ConfigmMap" }} +{{- end }} {{- $tlsCount := 0 }} {{- if and .Values.enabled .Values.tls.spire.enabled }} {{- $tlsCount = add $tlsCount 1 }} @@ -44,9 +47,14 @@ serving_cert_file: jwks_uri: {{ .Values.config.jwksUri | quote }} {{- end }} +{{- if eq .Values.bundleSource "ConfigMap" }} +file: + path: /bundle/bundle.spiffe +{{- else }} workload_api: socket_path: {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | quote }} trust_domain: {{ include "spire-lib.trust-domain" . | quote }} +{{- end }} health_checks: bind_port: "8008" diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/deployment.yaml b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/deployment.yaml index 8b02c5b..07420bf 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/deployment.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/deployment.yaml @@ -86,9 +86,15 @@ spec: name: https {{- end }} volumeMounts: + {{- if eq .Values.bundleSource "ConfigMap" }} + - name: spiffe-bundle + mountPath: /bundle + readOnly: true + {{- else }} - name: spiffe-workload-api mountPath: {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | dir }} readOnly: true + {{- end }} - name: spire-oidc-sockets mountPath: /run/spire/oidc-sockets readOnly: false @@ -171,10 +177,17 @@ spec: {{- end }} {{- end }} volumes: + {{- if or .Values.tls.spire.enabled (eq .Values.bundleSource "CSI") }} - name: spiffe-workload-api csi: driver: "{{ .Values.csiDriverName }}" readOnly: true + {{- end }} + {{- if eq .Values.bundleSource "ConfigMap" }} + - name: spiffe-bundle + configMap: + name: {{ include "spire-lib.bundle-configmap" . }} + {{- end }} - name: spire-oidc-sockets emptyDir: {} - name: spire-oidc-config diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml b/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml index 613b131..43ef469 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml @@ -11,6 +11,12 @@ agentSocketName: spire-agent.sock ## @param csiDriverName The csi driver to use csiDriverName: csi.spiffe.io +## @param bundleSource Configure where to fetch the trust bundle from. Must be CSI or ConfigMap. +bundleSource: CSI + +## @param bundleConfigMap ConfigMap name for SPIRE bundle when bundleSource is ConfigMap +bundleConfigMap: spire-bundle + ## @param replicaCount Replica count replicaCount: 1 diff --git a/examples/static-manifest-server/values.yaml b/examples/static-manifest-server/values.yaml index 99c1d1c..b005fab 100644 --- a/examples/static-manifest-server/values.yaml +++ b/examples/static-manifest-server/values.yaml @@ -17,7 +17,7 @@ spire-server: selectors: - tpm:pub_hash:12345 foo-kubelet: - parentID: spiffe://example.org/foo + parentID: spiffe://example.org/hosts/foo spiffeID: spiffe://example.org/k8s/one/node/foo selectors: - systemd:id:kubelet.service @@ -28,4 +28,8 @@ spire-agent: spiffe-csi-driver: enabled: false spiffe-oidc-discovery-provider: - enabled: false + enabled: true + bundleSource: ConfigMap + tls: + spire: + enabled: false