Enable global config for clusterName, trustDomain, and bundleConfigMap (#156)
This commit is contained in:
@@ -105,20 +105,16 @@ Kubernetes: `>=1.21.0-0`
|
|||||||
| Key | Type | Default | Description |
|
| Key | Type | Default | Description |
|
||||||
|-----|------|---------|-------------|
|
|-----|------|---------|-------------|
|
||||||
| fullnameOverride | string | `""` | |
|
| fullnameOverride | string | `""` | |
|
||||||
|
| global.spire.bundleConfigMap | string | `""` | Override all instances of bundleConfigMap |
|
||||||
|
| global.spire.clusterName | string | `"example-cluster"` | Set the name of the Kubernetes cluster |
|
||||||
|
| global.spire.trustDomain | string | `"example.org"` | Set the trust domain to use for the spiffe identifiers |
|
||||||
| nameOverride | string | `""` | |
|
| nameOverride | string | `""` | |
|
||||||
| spiffe-csi-driver.enabled | bool | `true` | |
|
| spiffe-csi-driver.enabled | bool | `true` | |
|
||||||
| spiffe-oidc-discovery-provider.enabled | bool | `false` | |
|
| 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.enabled | bool | `true` | |
|
| spire-agent.enabled | bool | `true` | |
|
||||||
| spire-agent.nameOverride | string | `"agent"` | |
|
| spire-agent.nameOverride | string | `"agent"` | |
|
||||||
| spire-agent.trustDomain | string | `"example.org"` | |
|
|
||||||
| spire-server.bundleConfigMap | string | `"spire-bundle"` | |
|
|
||||||
| spire-server.clusterName | string | `"example-cluster"` | |
|
|
||||||
| spire-server.controllerManager.enabled | bool | `true` | |
|
| spire-server.controllerManager.enabled | bool | `true` | |
|
||||||
| spire-server.enabled | bool | `true` | |
|
| spire-server.enabled | bool | `true` | |
|
||||||
| spire-server.nameOverride | string | `"server"` | |
|
| spire-server.nameOverride | string | `"server"` | |
|
||||||
| spire-server.trustDomain | string | `"example.org"` | |
|
|
||||||
|
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|||||||
@@ -87,3 +87,19 @@ Create the name of the service account to use
|
|||||||
{{- define "spiffe-oidc-discovery-provider.workload-api-socket-path" -}}
|
{{- define "spiffe-oidc-discovery-provider.workload-api-socket-path" -}}
|
||||||
{{- printf "/spiffe-workload-api/%s" .Values.agentSocketName }}
|
{{- printf "/spiffe-workload-api/%s" .Values.agentSocketName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spiffe-oidc-discovery-provider.cluster-name" }}
|
||||||
|
{{- if ne (len (dig "spire" "clusterName" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.clusterName }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.clusterName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spiffe-oidc-discovery-provider.trust-domain" }}
|
||||||
|
{{- if ne (len (dig "spire" "trustDomain" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.trustDomain }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.trustDomain }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -103,3 +103,27 @@ Create the name of the service account to use
|
|||||||
{{- define "spire-agent.socket-path" -}}
|
{{- define "spire-agent.socket-path" -}}
|
||||||
{{- print .Values.socketPath }}
|
{{- print .Values.socketPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-agent.cluster-name" }}
|
||||||
|
{{- if ne (len (dig "spire" "clusterName" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.clusterName }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.clusterName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-agent.trust-domain" }}
|
||||||
|
{{- if ne (len (dig "spire" "trustDomain" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.trustDomain }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.trustDomain }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-agent.bundle-configmap" }}
|
||||||
|
{{- if ne (len (dig "spire" "bundleConfigMap" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.bundleConfigMap }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.bundleConfigMap }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ data:
|
|||||||
server_port = {{ .Values.server.port | quote }}
|
server_port = {{ .Values.server.port | quote }}
|
||||||
socket_path = {{ include "spire-agent.socket-path" . | quote }}
|
socket_path = {{ include "spire-agent.socket-path" . | quote }}
|
||||||
trust_bundle_path = "/run/spire/bundle/bundle.crt"
|
trust_bundle_path = "/run/spire/bundle/bundle.crt"
|
||||||
trust_domain = {{ .Values.trustDomain | quote }}
|
trust_domain = {{ include "spire-agent.trust-domain" . | quote }}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
NodeAttestor "k8s_psat" {
|
NodeAttestor "k8s_psat" {
|
||||||
plugin_data {
|
plugin_data {
|
||||||
cluster = {{ .Values.clusterName | quote }}
|
cluster = {{ include "spire-agent.cluster-name" . | quote }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ spec:
|
|||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.fullname" . }}
|
||||||
- name: spire-bundle
|
- name: spire-bundle
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ .Values.bundleConfigMap }}
|
name: {{ include "spire-agent.bundle-configmap" . }}
|
||||||
- name: spire-token
|
- name: spire-token
|
||||||
projected:
|
projected:
|
||||||
sources:
|
sources:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ A Helm chart to install the SPIRE server.
|
|||||||
| autoscaling.maxReplicas | int | `100` | |
|
| autoscaling.maxReplicas | int | `100` | |
|
||||||
| autoscaling.minReplicas | int | `1` | |
|
| autoscaling.minReplicas | int | `1` | |
|
||||||
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
|
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
|
||||||
| bundleConfigMap | string | `"spire-server"` | |
|
| bundleConfigMap | string | `"spire-bundle"` | |
|
||||||
| caKeyType | string | `"rsa-2048"` | The CA key type to use, possible values are rsa-2048, rsa-4096, ec-p256, ec-p384 (AWS requires the use of RSA. EC cryptography is not supported) |
|
| caKeyType | string | `"rsa-2048"` | The CA key type to use, possible values are rsa-2048, rsa-4096, ec-p256, ec-p384 (AWS requires the use of RSA. EC cryptography is not supported) |
|
||||||
| caTTL | string | `"24h"` | |
|
| caTTL | string | `"24h"` | |
|
||||||
| ca_subject.common_name | string | `"example.org"` | |
|
| ca_subject.common_name | string | `"example.org"` | |
|
||||||
|
|||||||
@@ -110,3 +110,27 @@ Create the name of the service account to use
|
|||||||
[{{ printf "%s:%s-agent" .Release.Namespace .Release.Name | quote }}]
|
[{{ printf "%s:%s-agent" .Release.Namespace .Release.Name | quote }}]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-server.cluster-name" }}
|
||||||
|
{{- if ne (len (dig "spire" "clusterName" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.clusterName }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.clusterName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-server.trust-domain" }}
|
||||||
|
{{- if ne (len (dig "spire" "trustDomain" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.trustDomain }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.trustDomain }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "spire-server.bundle-configmap" }}
|
||||||
|
{{- if ne (len (dig "spire" "bundleConfigMap" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.bundleConfigMap }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Values.bundleConfigMap }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Values.bundleConfigMap }}
|
name: {{ include "spire-server.bundle-configmap" . }}
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ data:
|
|||||||
server {
|
server {
|
||||||
bind_address = "0.0.0.0"
|
bind_address = "0.0.0.0"
|
||||||
bind_port = "8081"
|
bind_port = "8081"
|
||||||
trust_domain = {{ .Values.trustDomain | quote }}
|
trust_domain = {{ include "spire-server.trust-domain" . | quote }}
|
||||||
data_dir = "/run/spire/data"
|
data_dir = "/run/spire/data"
|
||||||
log_level = {{ .Values.logLevel | quote }}
|
log_level = {{ .Values.logLevel | quote }}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ data:
|
|||||||
NodeAttestor "k8s_psat" {
|
NodeAttestor "k8s_psat" {
|
||||||
plugin_data {
|
plugin_data {
|
||||||
clusters = {
|
clusters = {
|
||||||
{{ $root.Values.clusterName | quote }} = {
|
{{ include "spire-server.cluster-name" $root | quote }} = {
|
||||||
service_account_allow_list = {{ include "spire-server.serviceAccountAllowedList" $root | trim }}
|
service_account_allow_list = {{ include "spire-server.serviceAccountAllowedList" $root | trim }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ data:
|
|||||||
Notifier "k8sbundle" {
|
Notifier "k8sbundle" {
|
||||||
plugin_data {
|
plugin_data {
|
||||||
namespace = {{ .Values.notifier.k8sbundle.namespace | default $namespace | quote }}
|
namespace = {{ .Values.notifier.k8sbundle.namespace | default $namespace | quote }}
|
||||||
config_map = {{ .Values.bundleConfigMap | quote }}
|
config_map = {{ include "spire-server.bundle-configmap" . | quote }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ data:
|
|||||||
resourceName: {{ .Release.Name | sha256sum | trunc 8 }}.spiffe.io
|
resourceName: {{ .Release.Name | sha256sum | trunc 8 }}.spiffe.io
|
||||||
resourceNamespace: {{ include "spire-server.namespace" . }}
|
resourceNamespace: {{ include "spire-server.namespace" . }}
|
||||||
validatingWebhookConfigurationName: {{ include "spire-controller-manager.fullname" . }}-webhook
|
validatingWebhookConfigurationName: {{ include "spire-controller-manager.fullname" . }}-webhook
|
||||||
clusterName: {{ .Values.clusterName }}
|
clusterName: {{ include "spire-server.cluster-name" . }}
|
||||||
trustDomain: {{ .Values.trustDomain }}
|
trustDomain: {{ include "spire-server.trust-domain" . }}
|
||||||
ignoreNamespaces:
|
ignoreNamespaces:
|
||||||
{{- with .Values.controllerManager.ignoreNamespaces }}
|
{{- with .Values.controllerManager.ignoreNamespaces }}
|
||||||
{{- toYaml . | nindent 6 }}
|
{{- toYaml . | nindent 6 }}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ metadata:
|
|||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: [configmaps]
|
resources: [configmaps]
|
||||||
resourceNames: [{{ .Values.bundleConfigMap }}]
|
resourceNames: [{{ include "spire-server.bundle-configmap" . }}]
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- patch
|
- patch
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ jwtIssuer: oidc-discovery.example.org
|
|||||||
clusterName: example-cluster
|
clusterName: example-cluster
|
||||||
trustDomain: example.org
|
trustDomain: example.org
|
||||||
|
|
||||||
bundleConfigMap: spire-server
|
bundleConfigMap: spire-bundle
|
||||||
|
|
||||||
federation:
|
federation:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
+13
-14
@@ -1,8 +1,16 @@
|
|||||||
# You can enable features that affect all services here.
|
# You can enable config/features that affect all services here.
|
||||||
# global:
|
global:
|
||||||
# telemetry:
|
spire:
|
||||||
# prometheus:
|
# -- Set the name of the Kubernetes cluster
|
||||||
# enabled: true
|
clusterName: "example-cluster"
|
||||||
|
# -- Set the trust domain to use for the spiffe identifiers
|
||||||
|
trustDomain: "example.org"
|
||||||
|
# -- Override all instances of bundleConfigMap
|
||||||
|
bundleConfigMap: ""
|
||||||
|
|
||||||
|
# telemetry:
|
||||||
|
# prometheus:
|
||||||
|
# enabled: true
|
||||||
|
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
@@ -11,10 +19,6 @@ fullnameOverride: ""
|
|||||||
spire-server:
|
spire-server:
|
||||||
enabled: true
|
enabled: true
|
||||||
nameOverride: server
|
nameOverride: server
|
||||||
bundleConfigMap: &bundleConfigMap spire-bundle
|
|
||||||
|
|
||||||
clusterName: &clusterName "example-cluster"
|
|
||||||
trustDomain: &trustDomain "example.org"
|
|
||||||
|
|
||||||
controllerManager:
|
controllerManager:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -22,14 +26,9 @@ spire-server:
|
|||||||
spire-agent:
|
spire-agent:
|
||||||
enabled: true
|
enabled: true
|
||||||
nameOverride: agent
|
nameOverride: agent
|
||||||
bundleConfigMap: *bundleConfigMap
|
|
||||||
|
|
||||||
clusterName: *clusterName
|
|
||||||
trustDomain: *trustDomain
|
|
||||||
|
|
||||||
spiffe-csi-driver:
|
spiffe-csi-driver:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
spiffe-oidc-discovery-provider:
|
spiffe-oidc-discovery-provider:
|
||||||
enabled: false
|
enabled: false
|
||||||
trustDomain: *trustDomain
|
|
||||||
|
|||||||
Reference in New Issue
Block a user