Add recommendation for namespaceLayout (#127)
Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
co-authored by
Marco Franssen
parent
2496c71164
commit
49beb64584
@@ -159,6 +159,7 @@ Now you can interact with the Spire agent socket from your own application. The
|
|||||||
| `global.spire.trustDomain` | The trust domain for Spire install | `example.org` |
|
| `global.spire.trustDomain` | The trust domain for Spire install | `example.org` |
|
||||||
| `global.spire.upstreamServerAddress` | Set what address to use for the upstream server when using nested spire | `""` |
|
| `global.spire.upstreamServerAddress` | Set what address to use for the upstream server when using nested spire | `""` |
|
||||||
| `global.spire.recommendations.enabled` | Use recommended settings for production deployments. Default is off. | `false` |
|
| `global.spire.recommendations.enabled` | Use recommended settings for production deployments. Default is off. | `false` |
|
||||||
|
| `global.spire.recommendations.namespaceLayout` | Set to true to use recommended values for installing across namespaces | `true` |
|
||||||
| `global.spire.recommendations.priorityClassName` | Set to true to use recommended values for Pod Priority Class Names | `true` |
|
| `global.spire.recommendations.priorityClassName` | Set to true to use recommended values for Pod Priority Class Names | `true` |
|
||||||
| `global.spire.recommendations.strictMode` | Check values, such as trustDomain, are overridden with a suitable value for production. | `true` |
|
| `global.spire.recommendations.strictMode` | Check values, such as trustDomain, are overridden with a suitable value for production. | `true` |
|
||||||
| `global.spire.recommendations.securityContexts` | Set to true to use recommended values for Pod and Container Security Contexts | `true` |
|
| `global.spire.recommendations.securityContexts` | Set to true to use recommended values for Pod and Container Security Contexts | `true` |
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "spiffe-csi-driver.namespace" -}}
|
{{- define "spiffe-csi-driver.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- if .Values.namespaceOverride -}}
|
||||||
{{- .Values.namespaceOverride -}}
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "system" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.system.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-system" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "spiffe-oidc-discovery-provider.namespace" -}}
|
{{- define "spiffe-oidc-discovery-provider.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- if .Values.namespaceOverride -}}
|
||||||
{{- .Values.namespaceOverride -}}
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "server" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.server.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-server" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "spire-agent.namespace" -}}
|
{{- define "spire-agent.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- if .Values.namespaceOverride -}}
|
||||||
{{- .Values.namespaceOverride -}}
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "system" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.system.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-system" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -37,6 +43,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "spire-agent.server.namespace" -}}
|
{{- define "spire-agent.server.namespace" -}}
|
||||||
{{- if .Values.server.namespaceOverride -}}
|
{{- if .Values.server.namespaceOverride -}}
|
||||||
{{- .Values.server.namespaceOverride -}}
|
{{- .Values.server.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "server" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.server.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-server" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -83,11 +95,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "spire-agent.serviceAccountName" -}}
|
{{- define "spire-agent.serviceAccountName" -}}
|
||||||
{{- if .Values.serviceAccount.create }}
|
{{- default (printf "%s-agent" .Release.Name) .Values.serviceAccount.name }}
|
||||||
{{- default (include "spire-agent.fullname" .) .Values.serviceAccount.name }}
|
|
||||||
{{- else }}
|
|
||||||
{{- default "default" .Values.serviceAccount.name }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "spire-agent.server-address" }}
|
{{- define "spire-agent.server-address" }}
|
||||||
|
|||||||
@@ -29,6 +29,42 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "spire-server.namespace" -}}
|
{{- define "spire-server.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- if .Values.namespaceOverride -}}
|
||||||
{{- .Values.namespaceOverride -}}
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "server" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.server.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-server" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "spire-server.agent-namespace" -}}
|
||||||
|
{{- if .Values.namespaceOverride -}}
|
||||||
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "system" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.system.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-system" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Release.Namespace -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "spire-server.bundle-namespace" -}}
|
||||||
|
{{- if .Values.notifier.k8sbundle.namespace }}
|
||||||
|
{{- .Values.notifier.k8sbundle.namespace }}
|
||||||
|
{{- else if .Values.namespaceOverride -}}
|
||||||
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "system" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.system.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-system" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -101,7 +137,7 @@ Create the name of the service account to use
|
|||||||
{{- if ne (len .Values.nodeAttestor.k8sPsat.serviceAccountAllowList) 0 }}
|
{{- if ne (len .Values.nodeAttestor.k8sPsat.serviceAccountAllowList) 0 }}
|
||||||
{{- .Values.nodeAttestor.k8sPsat.serviceAccountAllowList | toJson }}
|
{{- .Values.nodeAttestor.k8sPsat.serviceAccountAllowList | toJson }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
[{{ printf "%s:%s-agent" .Release.Namespace .Release.Name | quote }}]
|
[{{ printf "%s:%s-agent" (include "spire-server.agent-namespace" .) .Release.Name | quote }}]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{{- $namespace := include "spire-server.namespace" . }}
|
{{- $namespace := include "spire-server.bundle-namespace" . }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-lib.bundle-configmap" . }}
|
name: {{ include "spire-lib.bundle-configmap" . }}
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
namespace: {{ $namespace }}
|
||||||
{{- with .Values.configMap.annotations }}
|
{{- with .Values.configMap.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ plugins:
|
|||||||
Notifier:
|
Notifier:
|
||||||
k8sbundle:
|
k8sbundle:
|
||||||
plugin_data:
|
plugin_data:
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default (include "spire-server.namespace" .) | quote }}
|
namespace: {{ include "spire-server.bundle-namespace" . | quote }}
|
||||||
config_map: {{ include "spire-lib.bundle-configmap" . | quote }}
|
config_map: {{ include "spire-lib.bundle-configmap" . | quote }}
|
||||||
|
|
||||||
{{- with .Values.upstreamAuthority.disk }}
|
{{- with .Values.upstreamAuthority.disk }}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{{- $namespace := include "spire-server.namespace" . }}
|
{{- $namespace := include "spire-server.namespace" . }}
|
||||||
|
{{- $bundleNamespace := include "spire-server.bundle-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-lib.bundle-configmap" . }}
|
name: {{ include "spire-lib.bundle-configmap" . }}
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
namespace: {{ $bundleNamespace }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: [configmaps]
|
resources: [configmaps]
|
||||||
@@ -52,7 +53,7 @@ kind: RoleBinding
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "spire-lib.bundle-configmap" . }}
|
name: {{ include "spire-lib.bundle-configmap" . }}
|
||||||
namespace: {{ .Values.notifier.k8sbundle.namespace | default $namespace }}
|
namespace: {{ $bundleNamespace }}
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "spire-server.serviceAccountName" . }}
|
name: {{ include "spire-server.serviceAccountName" . }}
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ Allow the release namespace to be overridden for multi-namespace deployments in
|
|||||||
{{- define "tornjak-frontend.namespace" -}}
|
{{- define "tornjak-frontend.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- if .Values.namespaceOverride -}}
|
||||||
{{- .Values.namespaceOverride -}}
|
{{- .Values.namespaceOverride -}}
|
||||||
|
{{- else if and (dig "spire" "recommendations" "enabled" false .Values.global) (dig "spire" "recommendations" "namespaceLayout" true .Values.global) }}
|
||||||
|
{{- if ne (len (dig "spire" "namespaces" "server" "name" "" .Values.global)) 0 }}
|
||||||
|
{{- .Values.global.spire.namespaces.server.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "spire-server" }}
|
||||||
|
{{- end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- .Release.Namespace -}}
|
{{- .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -22,12 +22,14 @@ global:
|
|||||||
upstreamServerAddress: ""
|
upstreamServerAddress: ""
|
||||||
|
|
||||||
## @param global.spire.recommendations.enabled Use recommended settings for production deployments. Default is off.
|
## @param global.spire.recommendations.enabled Use recommended settings for production deployments. Default is off.
|
||||||
|
## @param global.spire.recommendations.namespaceLayout Set to true to use recommended values for installing across namespaces
|
||||||
## @param global.spire.recommendations.priorityClassName Set to true to use recommended values for Pod Priority Class Names
|
## @param global.spire.recommendations.priorityClassName Set to true to use recommended values for Pod Priority Class Names
|
||||||
## @param global.spire.recommendations.strictMode Check values, such as trustDomain, are overridden with a suitable value for production.
|
## @param global.spire.recommendations.strictMode Check values, such as trustDomain, are overridden with a suitable value for production.
|
||||||
## @param global.spire.recommendations.securityContexts Set to true to use recommended values for Pod and Container Security Contexts
|
## @param global.spire.recommendations.securityContexts Set to true to use recommended values for Pod and Container Security Contexts
|
||||||
## @param global.spire.recommendations.prometheus Enable prometheus exporters for monitoring
|
## @param global.spire.recommendations.prometheus Enable prometheus exporters for monitoring
|
||||||
recommendations:
|
recommendations:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
namespaceLayout: true
|
||||||
priorityClassName: true
|
priorityClassName: true
|
||||||
strictMode: true
|
strictMode: true
|
||||||
securityContexts: true
|
securityContexts: true
|
||||||
|
|||||||
@@ -4,28 +4,10 @@ global:
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
spire-server:
|
spire-server:
|
||||||
nodeAttestor:
|
|
||||||
k8sPsat:
|
|
||||||
serviceAccountAllowList: ["spire-system:spire-agent"]
|
|
||||||
notifier:
|
|
||||||
k8sbundle:
|
|
||||||
namespace: spire-system
|
|
||||||
|
|
||||||
spiffe-csi-driver:
|
|
||||||
namespaceOverride: spire-system
|
|
||||||
|
|
||||||
upstream-spiffe-csi-driver:
|
|
||||||
namespaceOverride: spire-system
|
|
||||||
|
|
||||||
spire-agent:
|
spire-agent:
|
||||||
namespaceOverride: spire-system
|
|
||||||
serviceAccount:
|
|
||||||
name: spire-agent
|
|
||||||
server:
|
|
||||||
namespaceOverride: spire-server
|
|
||||||
|
|
||||||
upstream-spire-agent:
|
upstream-spire-agent:
|
||||||
namespaceOverride: spire-system
|
|
||||||
|
|
||||||
spiffe-oidc-discovery-provider:
|
spiffe-oidc-discovery-provider:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
Reference in New Issue
Block a user