diff --git a/charts/spire/README.md b/charts/spire/README.md index e831202..8f23256 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -59,13 +59,12 @@ Kubernetes: `>=1.21.0-0` |-----|------|---------|-------------| | fullnameOverride | string | `""` | | | nameOverride | string | `""` | | -| spiffe-csi-driver.agentSocketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | | +| spiffe-csi-driver | object | `{}` | | | spiffe-oidc-discovery-provider.enabled | bool | `false` | | | spiffe-oidc-discovery-provider.trustDomain | string | `"example.org"` | | | spire-agent.bundleConfigMap | string | `"spire-bundle"` | | | spire-agent.clusterName | string | `"example-cluster"` | | | spire-agent.nameOverride | string | `"agent"` | | -| spire-agent.socketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | | | spire-agent.trustDomain | string | `"example.org"` | | | spire-server.bundleConfigMap | string | `"spire-bundle"` | | | spire-server.clusterName | string | `"example-cluster"` | | diff --git a/charts/spire/charts/spiffe-csi-driver/README.md b/charts/spire/charts/spiffe-csi-driver/README.md index 4b4579e..03ee62c 100644 --- a/charts/spire/charts/spiffe-csi-driver/README.md +++ b/charts/spire/charts/spiffe-csi-driver/README.md @@ -10,7 +10,6 @@ A Helm chart to install the SPIFFE CSI driver. | Key | Type | Default | Description | |-----|------|---------|-------------| -| agentSocketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.registry | string | `"ghcr.io"` | | diff --git a/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml b/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml index c9c06d0..1e02f6a 100644 --- a/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml +++ b/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml @@ -96,11 +96,11 @@ spec: volumes: - name: spire-agent-sockets hostPath: - path: {{ dir .Values.agentSocketPath }} + path: {{ include "spire.agent-socket-path" . | dir }} type: DirectoryOrCreate - name: spire-agent-socket-dir hostPath: - path: {{ dir .Values.agentSocketPath }} + path: {{ include "spire.agent-socket-path" . | dir }} type: DirectoryOrCreate # This volume is where the socket for kubelet->driver communication lives - name: spiffe-csi-socket-dir diff --git a/charts/spire/charts/spiffe-csi-driver/values.yaml b/charts/spire/charts/spiffe-csi-driver/values.yaml index bf3760b..b6be7ee 100644 --- a/charts/spire/charts/spiffe-csi-driver/values.yaml +++ b/charts/spire/charts/spiffe-csi-driver/values.yaml @@ -63,5 +63,3 @@ nodeDriverRegistrar: # limits: # cpu: 100m # memory: 64Mi - -agentSocketPath: /run/spire/agent-sockets/spire-agent.sock diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/README.md b/charts/spire/charts/spiffe-oidc-discovery-provider/README.md index eaaf064..3499858 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/README.md +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/README.md @@ -11,7 +11,6 @@ A Helm chart to install the SPIFFE OIDC discovery provider. | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | -| agentSocketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | | | autoscaling.enabled | bool | `false` | | | autoscaling.maxReplicas | int | `5` | | | autoscaling.minReplicas | int | `1` | | 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 f8a8b8e..b44c456 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/configmap.yaml @@ -30,7 +30,7 @@ data: {{- end }} workload_api { - socket_path = "/spiffe-workload-api/{{ splitList "/" .Values.agentSocketPath | last }}" + socket_path = "/spiffe-workload-api/{{ include "spire.agent-socket-path" . | splitList "/" | last }}" trust_domain = "{{ .Values.trustDomain }}" } diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml b/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml index 768214a..a4b6827 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/values.yaml @@ -109,5 +109,4 @@ tolerations: [] affinity: {} -agentSocketPath: /run/spire/agent-sockets/spire-agent.sock trustDomain: "example.org" diff --git a/charts/spire/charts/spire-agent/README.md b/charts/spire/charts/spire-agent/README.md index dd4af6d..3b90505 100644 --- a/charts/spire/charts/spire-agent/README.md +++ b/charts/spire/charts/spire-agent/README.md @@ -29,7 +29,6 @@ A Helm chart to install the SPIRE agent. | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `true` | | | serviceAccount.name | string | `""` | | -| socketPath | string | `"/run/spire/agent-sockets/spire-agent.sock"` | | | trustDomain | string | `"example.org"` | | | waitForIt.image.pullPolicy | string | `"IfNotPresent"` | | | waitForIt.image.registry | string | `"cgr.dev"` | | diff --git a/charts/spire/charts/spire-agent/templates/configmap.yaml b/charts/spire/charts/spire-agent/templates/configmap.yaml index 0f2fc85..55d4e78 100644 --- a/charts/spire/charts/spire-agent/templates/configmap.yaml +++ b/charts/spire/charts/spire-agent/templates/configmap.yaml @@ -10,7 +10,7 @@ data: log_level = {{ .Values.logLevel | quote }} server_address = "{{ .Release.Name }}-server" server_port = {{ .Values.server.port | quote }} - socket_path = {{ .Values.socketPath | quote }} + socket_path = {{ include "spire.agent-socket-path" . | quote }} trust_bundle_path = "/run/spire/bundle/bundle.crt" trust_domain = {{ .Values.trustDomain | quote }} } diff --git a/charts/spire/charts/spire-agent/templates/daemonset.yaml b/charts/spire/charts/spire-agent/templates/daemonset.yaml index 248e824..acee537 100644 --- a/charts/spire/charts/spire-agent/templates/daemonset.yaml +++ b/charts/spire/charts/spire-agent/templates/daemonset.yaml @@ -51,7 +51,7 @@ spec: mountPath: /run/spire/bundle readOnly: true - name: spire-agent-socket-dir - mountPath: {{ dir .Values.socketPath }} + mountPath: {{ include "spire.agent-socket-path" . | dir }} readOnly: false - name: spire-token mountPath: /var/run/secrets/tokens @@ -89,5 +89,5 @@ spec: audience: spire-server - name: spire-agent-socket-dir hostPath: - path: {{ dir .Values.socketPath }} + path: {{ include "spire.agent-socket-path" . | dir }} type: DirectoryOrCreate diff --git a/charts/spire/charts/spire-agent/values.yaml b/charts/spire/charts/spire-agent/values.yaml index e636778..607e04f 100644 --- a/charts/spire/charts/spire-agent/values.yaml +++ b/charts/spire/charts/spire-agent/values.yaml @@ -53,7 +53,6 @@ nodeSelector: kubernetes.io/arch: amd64 logLevel: info -socketPath: /run/spire/agent-sockets/spire-agent.sock clusterName: example-cluster trustDomain: example.org diff --git a/charts/spire/templates/_helpers.tpl b/charts/spire/templates/_helpers.tpl index 7d7d356..e052bfc 100644 --- a/charts/spire/templates/_helpers.tpl +++ b/charts/spire/templates/_helpers.tpl @@ -29,3 +29,11 @@ Create chart name and version as used by the chart label. {{- define "spire.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} + +{{- define "spire.agent-socket-path" -}} +{{- print "/run/spire/agent-sockets/spire-agent.sock" }} +{{- end }} + +{{- define "spire.server-socket-path" -}} +{{- print "/run/spire/server-sockets/spire-server.sock" }} +{{- end }} diff --git a/charts/spire/values.yaml b/charts/spire/values.yaml index 310fe73..7e26097 100644 --- a/charts/spire/values.yaml +++ b/charts/spire/values.yaml @@ -16,10 +16,7 @@ spire-agent: clusterName: *clusterName trustDomain: *trustDomain - socketPath: &agentSocketPath /run/spire/agent-sockets/spire-agent.sock - -spiffe-csi-driver: - agentSocketPath: *agentSocketPath +spiffe-csi-driver: {} spiffe-oidc-discovery-provider: enabled: false