Namespace override
This patch makes it possible to install the subcharts in different namespaces as needed. Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
export EXTRA_HELM_ARGS="--values=examples/production/values.yaml"
|
||||||
Executable
+48
@@ -0,0 +1,48 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
|
||||||
|
k_wait=(kubectl wait --for condition=available --timeout 30s --namespace)
|
||||||
|
k_rollout_status=(kubectl rollout status --watch --timeout 30s --namespace)
|
||||||
|
|
||||||
|
cat <<EOF >>"$GITHUB_STEP_SUMMARY"
|
||||||
|
### spire
|
||||||
|
| workload | Status |
|
||||||
|
| -------- | ------ |
|
||||||
|
| spire-server | $("${k_rollout_status[@]}" spire-server statefulset spire-server) |
|
||||||
|
| spire-spiffe-csi-driver | $("${k_rollout_status[@]}" spire-system daemonset spire-spiffe-csi-driver) |
|
||||||
|
| spire-agent | $("${k_rollout_status[@]}" spire-system daemonset spire-agent) |
|
||||||
|
| spire-spiffe-oidc-discovery-provider | $("${k_wait[@]}" spire-server deployments.apps spire-spiffe-oidc-discovery-provider) |
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ $1 -ne 0 ]; then
|
||||||
|
echo
|
||||||
|
echo '```'
|
||||||
|
echo '==> Events of namespace spire-server'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s get events --output wide --namespace spire-server'
|
||||||
|
kubectl --request-timeout=30s get events --output wide --namespace spire-server
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '<== Events of namespace spire-server'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s describe pods --namespace spire-server'
|
||||||
|
kubectl --request-timeout=30s describe pods --namespace spire-server
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
echo '==> Events of namespace spire-system'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s get events --output wide --namespace spire-system'
|
||||||
|
kubectl --request-timeout=30s get events --output wide --namespace spire-system
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '<== Events of namespace spire-system'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s describe pods --namespace spire-system'
|
||||||
|
kubectl --request-timeout=30s describe pods --namespace spire-system
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
kubectl get pods -o name -n spire-server | while read line; do echo logs for $line; kubectl logs -n spire-server $line --all-containers=true --ignore-errors=true; done
|
||||||
|
kubectl get pods -o name -n spire-system | while read line; do echo logs for $line; kubectl logs -n spire-system $line --all-containers=true --ignore-errors=true; done
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
echo '```'
|
||||||
|
fi | cat >> "$GITHUB_STEP_SUMMARY"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
kubectl label namespace "$scenario" pod-security.kubernetes.io/enforce=privileged
|
kubectl create namespace "spire-system"
|
||||||
kubectl create namespace "${scenario}-deps"
|
kubectl label namespace "spire-system" pod-security.kubernetes.io/enforce=privileged
|
||||||
kubectl label namespace "${scenario}-deps" pod-security.kubernetes.io/enforce=restricted
|
kubectl create namespace "spire-server"
|
||||||
helm install -n "${scenario}-deps" spire charts/spire -f "${TEST_DIR}"/deps-values.yaml
|
kubectl label namespace "spire-server" pod-security.kubernetes.io/enforce=restricted
|
||||||
|
|||||||
@@ -1,20 +1,5 @@
|
|||||||
global:
|
|
||||||
telemetry:
|
|
||||||
prometheus:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
spiffe-csi-driver:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
spire-agent:
|
|
||||||
enabled: true
|
|
||||||
serviceAccount:
|
|
||||||
name: spire-agent
|
|
||||||
server:
|
|
||||||
address: spire-server.lockdown-deps
|
|
||||||
|
|
||||||
spiffe-oidc-discovery-provider:
|
spiffe-oidc-discovery-provider:
|
||||||
enabled: false
|
namespaceOverride: spire-server
|
||||||
|
|
||||||
spire-server:
|
spire-server:
|
||||||
enabled: false
|
namespaceOverride: spire-server
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: apps/v1
|
|||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-csi-driver.fullname" . }}
|
name: {{ include "spiffe-csi-driver.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spiffe-csi-driver.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spiffe-csi-driver.labels" . | nindent 4 }}
|
{{- include "spiffe-csi-driver.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ A Helm chart to install the SPIFFE OIDC discovery provider.
|
|||||||
| insecureScheme.nginx.image.version | string | `"1.23.2-alpine"` | |
|
| insecureScheme.nginx.image.version | string | `"1.23.2-alpine"` | |
|
||||||
| insecureScheme.nginx.resources | object | `{}` | |
|
| insecureScheme.nginx.resources | object | `{}` | |
|
||||||
| nameOverride | string | `""` | |
|
| nameOverride | string | `""` | |
|
||||||
|
| namespaceOverride | string | `""` | |
|
||||||
| nodeSelector | object | `{}` | |
|
| nodeSelector | object | `{}` | |
|
||||||
| podAnnotations | object | `{}` | |
|
| podAnnotations | object | `{}` | |
|
||||||
| podSecurityContext | object | `{}` | |
|
| podSecurityContext | object | `{}` | |
|
||||||
|
|||||||
@@ -23,6 +23,17 @@ If release name contains chart name it will be used as a full name.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||||
|
*/}}
|
||||||
|
{{- define "spiffe-oidc-discovery-provider.namespace" -}}
|
||||||
|
{{- if .Values.namespaceOverride -}}
|
||||||
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create chart name and version as used by the chart label.
|
Create chart name and version as used by the chart label.
|
||||||
*/}}
|
*/}}
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ apiVersion: v1
|
|||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
data:
|
data:
|
||||||
oidc-discovery-provider.conf: |
|
oidc-discovery-provider.conf: |
|
||||||
log_level = "{{ .Values.config.logLevel }}"
|
log_level = "{{ .Values.config.logLevel }}"
|
||||||
|
|
||||||
domains = [
|
domains = [
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}",
|
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}",
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}",
|
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}",
|
||||||
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local",
|
"{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.cluster.local",
|
||||||
{{- if gt (len .Values.config.domains) 0 }}
|
{{- if gt (len .Values.config.domains) 0 }}
|
||||||
"{{- join "\",\n \"" .Values.config.domains }}"
|
"{{- join "\",\n \"" .Values.config.domains }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
||||||
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ apiVersion: autoscaling/v2beta1
|
|||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
||||||
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
{{- with .Values.service.annotations }}
|
{{- with .Values.service.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spiffe-oidc-discovery-provider.serviceAccountName" . }}
|
name: {{ include "spiffe-oidc-discovery-provider.serviceAccountName" . }}
|
||||||
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
||||||
{{- with .Values.serviceAccount.annotations }}
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
|
|||||||
+3
-2
@@ -2,6 +2,7 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ include "spiffe-oidc-discovery-provider.fullname" . }}-test-connection"
|
name: "{{ include "spiffe-oidc-discovery-provider.fullname" . }}-test-connection"
|
||||||
|
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -19,13 +20,13 @@ spec:
|
|||||||
- name: wget-service-name-namespace
|
- name: wget-service-name-namespace
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ['wget']
|
command: ['wget']
|
||||||
args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}/.well-known/openid-configuration']
|
args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}:{{ .Values.service.port }}/.well-known/openid-configuration']
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.securityContext | nindent 8 }}
|
{{- toYaml .Values.securityContext | nindent 8 }}
|
||||||
- name: wget-service-name-namespace-svc-cluster-local
|
- name: wget-service-name-namespace-svc-cluster-local
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ['wget']
|
command: ['wget']
|
||||||
args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/.well-known/openid-configuration']
|
args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.cluster.local:{{ .Values.service.port }}/.well-known/openid-configuration']
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.securityContext | nindent 8 }}
|
{{- toYaml .Values.securityContext | nindent 8 }}
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ agentSocket: spire-agent.sock
|
|||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
|
namespaceOverride: ""
|
||||||
|
|
||||||
image:
|
image:
|
||||||
# registry: gcr.io
|
# registry: gcr.io
|
||||||
# repository: spiffe-io/oidc-discovery-provider
|
# repository: spiffe-io/oidc-discovery-provider
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ A Helm chart to install the SPIRE agent.
|
|||||||
| initContainers | list | `[]` | |
|
| initContainers | list | `[]` | |
|
||||||
| logLevel | string | `"info"` | |
|
| logLevel | string | `"info"` | |
|
||||||
| nameOverride | string | `""` | |
|
| nameOverride | string | `""` | |
|
||||||
|
| namespaceOverride | string | `""` | |
|
||||||
| nodeSelector | object | `{}` | |
|
| nodeSelector | object | `{}` | |
|
||||||
| podAnnotations | object | `{}` | |
|
| podAnnotations | object | `{}` | |
|
||||||
| podSecurityContext | object | `{}` | |
|
| podSecurityContext | object | `{}` | |
|
||||||
@@ -37,6 +38,7 @@ A Helm chart to install the SPIRE agent.
|
|||||||
| resources | object | `{}` | |
|
| resources | object | `{}` | |
|
||||||
| securityContext | object | `{}` | |
|
| securityContext | object | `{}` | |
|
||||||
| server.address | string | `""` | |
|
| server.address | string | `""` | |
|
||||||
|
| server.namespaceOverride | string | `""` | |
|
||||||
| server.port | int | `8081` | |
|
| server.port | int | `8081` | |
|
||||||
| serviceAccount.annotations | object | `{}` | |
|
| serviceAccount.annotations | object | `{}` | |
|
||||||
| serviceAccount.create | bool | `true` | |
|
| serviceAccount.create | bool | `true` | |
|
||||||
|
|||||||
@@ -23,6 +23,25 @@ If release name contains chart name it will be used as a full name.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||||
|
*/}}
|
||||||
|
{{- define "spire-agent.namespace" -}}
|
||||||
|
{{- if .Values.namespaceOverride -}}
|
||||||
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "spire-agent.server.namespace" -}}
|
||||||
|
{{- if .Values.server.namespaceOverride -}}
|
||||||
|
{{- .Values.server.namespaceOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create chart name and version as used by the chart label.
|
Create chart name and version as used by the chart label.
|
||||||
*/}}
|
*/}}
|
||||||
@@ -77,7 +96,7 @@ Create the name of the service account to use
|
|||||||
{{- if .Values.server.address }}
|
{{- if .Values.server.address }}
|
||||||
{{- .Values.server.address }}
|
{{- .Values.server.address }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{ .Release.Name }}-server
|
{{ .Release.Name }}-server.{{ include "spire-agent.server.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-agent.namespace" . }}
|
||||||
data:
|
data:
|
||||||
agent.conf: |
|
agent.conf: |
|
||||||
agent {
|
agent {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apps/v1
|
|||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-agent.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-agent.labels" . | nindent 4 }}
|
{{- include "spire-agent.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -16,11 +16,10 @@ kind: ClusterRoleBinding
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-agent.namespace" . }}
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: {{ include "spire-agent.fullname" . }}
|
name: {{ include "spire-agent.fullname" . }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-agent.serviceAccountName" . }}
|
name: {{ include "spire-agent.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-agent.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-agent.labels" . | nindent 4 }}
|
{{- include "spire-agent.labels" . | nindent 4 }}
|
||||||
{{- with .Values.serviceAccount.annotations }}
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ image:
|
|||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
|
namespaceOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
@@ -60,6 +61,7 @@ bundleConfigMap: spire-bundle
|
|||||||
server:
|
server:
|
||||||
address: ""
|
address: ""
|
||||||
port: 8081
|
port: 8081
|
||||||
|
namespaceOverride: ""
|
||||||
|
|
||||||
healthChecks:
|
healthChecks:
|
||||||
# -- override the host port used for health checking
|
# -- override the host port used for health checking
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ A Helm chart to install the SPIRE server.
|
|||||||
| jwtIssuer | string | `"oidc-discovery.example.org"` | |
|
| jwtIssuer | string | `"oidc-discovery.example.org"` | |
|
||||||
| logLevel | string | `"info"` | |
|
| logLevel | string | `"info"` | |
|
||||||
| nameOverride | string | `""` | |
|
| nameOverride | string | `""` | |
|
||||||
|
| namespaceOverride | string | `""` | |
|
||||||
| nodeAttestor.k8sPsat.enabled | bool | `true` | |
|
| nodeAttestor.k8sPsat.enabled | bool | `true` | |
|
||||||
| nodeAttestor.k8sPsat.serviceAccountAllowList | list | `[]` | |
|
| nodeAttestor.k8sPsat.serviceAccountAllowList | list | `[]` | |
|
||||||
| nodeSelector | object | `{}` | |
|
| nodeSelector | object | `{}` | |
|
||||||
|
|||||||
@@ -23,6 +23,17 @@ If release name contains chart name it will be used as a full name.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||||
|
*/}}
|
||||||
|
{{- define "spire-server.namespace" -}}
|
||||||
|
{{- if .Values.namespaceOverride -}}
|
||||||
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create chart name and version as used by the chart label.
|
Create chart name and version as used by the chart label.
|
||||||
*/}}
|
*/}}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
{{- $namespace := include "spire-server.namespace" . }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Values.bundleConfigMap }}
|
name: {{ .Values.bundleConfigMap }}
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default .Release.Namespace }}
|
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{{ $root := . }}
|
{{- $root := . }}
|
||||||
|
{{- $namespace := include "spire-server.namespace" . }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}
|
name: {{ include "spire-server.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
data:
|
data:
|
||||||
server.conf: |
|
server.conf: |
|
||||||
server {
|
server {
|
||||||
@@ -60,7 +61,7 @@ data:
|
|||||||
|
|
||||||
Notifier "k8sbundle" {
|
Notifier "k8sbundle" {
|
||||||
plugin_data {
|
plugin_data {
|
||||||
namespace = {{ .Values.notifier.k8sbundle.namespace | default .Release.Namespace | quote }}
|
namespace = {{ .Values.notifier.k8sbundle.namespace | default $namespace | quote }}
|
||||||
config_map = {{ .Values.bundleConfigMap | quote }}
|
config_map = {{ .Values.bundleConfigMap | quote }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ apiVersion: spire.spiffe.io/v1alpha1
|
|||||||
kind: ClusterSPIFFEID
|
kind: ClusterSPIFFEID
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" $root }}-service-account-based
|
name: {{ include "spire-controller-manager.fullname" $root }}-service-account-based
|
||||||
|
namespace: {{ include "spire-server.namespace" $root }}
|
||||||
spec:
|
spec:
|
||||||
spiffeIDTemplate: {{ .identities.spiffeIDTemplate | quote }}
|
spiffeIDTemplate: {{ .identities.spiffeIDTemplate | quote }}
|
||||||
{{- with .identities.podSelector }}
|
{{- with .identities.podSelector }}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ apiVersion: v1
|
|||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}
|
name: {{ include "spire-controller-manager.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
data:
|
data:
|
||||||
controller-manager-config.yaml: |
|
controller-manager-config.yaml: |
|
||||||
apiVersion: spire.spiffe.io/v1alpha1
|
apiVersion: spire.spiffe.io/v1alpha1
|
||||||
kind: ControllerManagerConfig
|
kind: ControllerManagerConfig
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}
|
name: {{ include "spire-controller-manager.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 8 }}
|
{{- include "spire-server.labels" . | nindent 8 }}
|
||||||
metrics:
|
metrics:
|
||||||
@@ -20,7 +20,7 @@ data:
|
|||||||
leaderElection:
|
leaderElection:
|
||||||
leaderElect: true
|
leaderElect: true
|
||||||
resourceName: {{ .Release.Name | sha256sum | trunc 8 }}.spiffe.io
|
resourceName: {{ .Release.Name | sha256sum | trunc 8 }}.spiffe.io
|
||||||
resourceNamespace: {{ .Release.Namespace }}
|
resourceNamespace: {{ include "spire-server.namespace" . }}
|
||||||
validatingWebhookConfigurationName: {{ include "spire-controller-manager.fullname" . }}-webhook
|
validatingWebhookConfigurationName: {{ include "spire-controller-manager.fullname" . }}-webhook
|
||||||
clusterName: {{ .Values.clusterName }}
|
clusterName: {{ .Values.clusterName }}
|
||||||
trustDomain: {{ .Values.trustDomain }}
|
trustDomain: {{ .Values.trustDomain }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}-leader-election
|
name: {{ include "spire-controller-manager.fullname" . }}-leader-election
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["configmaps"]
|
resources: ["configmaps"]
|
||||||
@@ -19,7 +19,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}-leader-election
|
name: {{ include "spire-controller-manager.fullname" . }}-leader-election
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: Role
|
kind: Role
|
||||||
@@ -27,7 +27,7 @@ roleRef:
|
|||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
@@ -76,5 +76,5 @@ roleRef:
|
|||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 4 }}
|
{{- include "spire-server.labels" . | nindent 4 }}
|
||||||
{{- with .Values.controllerManager.service.annotations }}
|
{{- with .Values.controllerManager.service.annotations }}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ webhooks:
|
|||||||
clientConfig:
|
clientConfig:
|
||||||
service:
|
service:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
path: /validate-spire-spiffe-io-v1alpha1-clusterfederatedtrustdomain
|
path: /validate-spire-spiffe-io-v1alpha1-clusterfederatedtrustdomain
|
||||||
failurePolicy: Fail
|
failurePolicy: Fail
|
||||||
name: vclusterfederatedtrustdomain.kb.io
|
name: vclusterfederatedtrustdomain.kb.io
|
||||||
@@ -22,7 +22,7 @@ webhooks:
|
|||||||
clientConfig:
|
clientConfig:
|
||||||
service:
|
service:
|
||||||
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
name: {{ include "spire-controller-manager.fullname" . }}-webhook
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
path: /validate-spire-spiffe-io-v1alpha1-clusterspiffeid
|
path: /validate-spire-spiffe-io-v1alpha1-clusterspiffeid
|
||||||
failurePolicy: Fail
|
failurePolicy: Fail
|
||||||
name: vclusterspiffeid.kb.io
|
name: vclusterspiffeid.kb.io
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ apiVersion: autoscaling/v2beta1
|
|||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}
|
name: {{ include "spire-server.fullname" . }}
|
||||||
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 4 }}
|
{{- include "spire-server.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
{{- $namespace := include "spire-server.namespace" . }}
|
||||||
# Role to be able to push certificate bundles to a configmap
|
# Role to be able to push certificate bundles to a configmap
|
||||||
kind: Role
|
kind: Role
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}-bundle
|
name: {{ include "spire-server.fullname" . }}-bundle
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default .Release.Namespace }}
|
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: [configmaps]
|
resources: [configmaps]
|
||||||
@@ -18,7 +19,7 @@ kind: Role
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}-cm
|
name: {{ include "spire-server.fullname" . }}-cm
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ $namespace }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: ["cert-manager.io"]
|
- apiGroups: ["cert-manager.io"]
|
||||||
resources:
|
resources:
|
||||||
@@ -35,11 +36,11 @@ kind: RoleBinding
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}-cm
|
name: {{ include "spire-server.fullname" . }}-cm
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ $namespace }}
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ $namespace }}
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: Role
|
kind: Role
|
||||||
name: {{ include "spire-server.fullname" . }}-cm
|
name: {{ include "spire-server.fullname" . }}-cm
|
||||||
@@ -50,11 +51,11 @@ kind: RoleBinding
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}-bundle
|
name: {{ include "spire-server.fullname" . }}-bundle
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default .Release.Namespace }}
|
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ $namespace }}
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: Role
|
kind: Role
|
||||||
name: {{ include "spire-server.fullname" . }}-bundle
|
name: {{ include "spire-server.fullname" . }}-bundle
|
||||||
@@ -89,7 +90,7 @@ metadata:
|
|||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ $namespace }}
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: {{ .Release.Namespace}}-{{ include "spire-server.fullname" . }}
|
name: {{ .Release.Namespace}}-{{ include "spire-server.fullname" . }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}
|
name: {{ include "spire-server.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
{{- with .Values.service.annotations }}
|
{{- with .Values.service.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 4 }}
|
{{- include "spire-server.labels" . | nindent 4 }}
|
||||||
{{- with .Values.serviceAccount.annotations }}
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ apiVersion: apps/v1
|
|||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.fullname" . }}
|
name: {{ include "spire-server.fullname" . }}
|
||||||
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 4 }}
|
{{- include "spire-server.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ include "spire-server.fullname" . }}-test-connection"
|
name: "{{ include "spire-server.fullname" . }}-test-connection"
|
||||||
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" . | nindent 4 }}
|
{{- include "spire-server.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ apiVersion: v1
|
|||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-server.upstream-ca-secret" $root }}
|
name: {{ include "spire-server.upstream-ca-secret" $root }}
|
||||||
namespace: {{ $root.Release.Namespace }}
|
namespace: {{ include "spire-server.namespace" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "spire-server.labels" $root | nindent 4 }}
|
{{- include "spire-server.labels" $root | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ image:
|
|||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
|
namespaceOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Install with something similar to:
|
||||||
|
|
||||||
|
kubectl create namespace "spire-system"
|
||||||
|
kubectl label namespace "spire-system" pod-security.kubernetes.io/enforce=privileged
|
||||||
|
kubectl create namespace "spire-server"
|
||||||
|
kubectl label namespace "spire-server" pod-security.kubernetes.io/enforce=restricted
|
||||||
|
|
||||||
|
helm upgrade --install --namespace spire-server spire charts/spire -f values.yaml
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
global:
|
||||||
|
telemetry:
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
spiffe-oidc-discovery-provider:
|
||||||
|
enabled: true
|
||||||
|
insecureScheme:
|
||||||
|
enabled: true
|
||||||
|
podSecurityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsNonRoot: true
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ALL]
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
|
||||||
|
spire-server:
|
||||||
|
nodeAttestor:
|
||||||
|
k8sPsat:
|
||||||
|
serviceAccountAllowList: ["spire-system:spire-agent"]
|
||||||
|
notifier:
|
||||||
|
k8sbundle:
|
||||||
|
namespace: spire-system
|
||||||
|
podSecurityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsNonRoot: true
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ALL]
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
controllerManager:
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsNonRoot: true
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ALL]
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
|
||||||
|
spiffe-csi-driver:
|
||||||
|
enabled: true
|
||||||
|
namespaceOverride: spire-system
|
||||||
|
|
||||||
|
spire-agent:
|
||||||
|
enabled: true
|
||||||
|
namespaceOverride: spire-system
|
||||||
|
serviceAccount:
|
||||||
|
name: spire-agent
|
||||||
|
server:
|
||||||
|
namespaceOverride: spire-server
|
||||||
Reference in New Issue
Block a user