Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hybrid nodes with different attestors or config #218

Merged
merged 104 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
fe16f5e
Add direct tpm support for spire-agent
kfox1111 Jan 26, 2024
938c736
Merge branch 'main' into direct-tpm-agent
kfox1111 Jan 27, 2024
9557216
Add fingerprinting support
kfox1111 Jan 27, 2024
6c3fce4
Merge remote-tracking branch 'refs/remotes/origin/direct-tpm-agent' i…
kfox1111 Jan 27, 2024
0c3c401
Add example
kfox1111 Jan 27, 2024
b79bd1c
Update charts/spire/charts/spire-agent/templates/configmap.yaml
kfox1111 Jan 28, 2024
d1f2991
Support hybrid nodes with different attestors
kfox1111 Jan 28, 2024
75a10c0
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Jan 28, 2024
765eee6
Remove extra slash
kfox1111 Jan 28, 2024
d84c11e
Merge branch 'direct-tpm-agent-hybrid' of https://github.com/spiffe/h…
kfox1111 Jan 28, 2024
49c5309
Update docs
kfox1111 Jan 28, 2024
ee3b021
Update charts/spire/charts/spire-agent/templates/configmap.yaml
kfox1111 Jan 29, 2024
35ee210
Merge branch 'main' into direct-tpm-agent
kfox1111 Jan 29, 2024
55c6f06
Fix broken tests
kfox1111 Jan 29, 2024
e7fe212
Add daemonset labels
kfox1111 Jan 29, 2024
7e3d3e5
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Jan 29, 2024
f763234
Add temporary upgrade hook
kfox1111 Jan 30, 2024
6a92626
Merge branch 'direct-tpm-agent-hybrid' of https://github.com/spiffe/h…
kfox1111 Jan 30, 2024
811307d
Fix docs
kfox1111 Jan 30, 2024
1dea9e7
Fix include
kfox1111 Jan 30, 2024
1592e16
Add missing values
kfox1111 Jan 30, 2024
0b9b4ce
Fix perms, add upgrade note
kfox1111 Jan 30, 2024
0c6be12
Fix hardcoded nodeAttestor and keyManager in spire-agent
kfox1111 Jan 30, 2024
85e2fed
Merge branch 'spire-agent-config-fix' into direct-tpm-agent
kfox1111 Jan 30, 2024
546d6cf
Fix merge issues
kfox1111 Jan 30, 2024
6a2fd7f
Fix unit tests
kfox1111 Jan 30, 2024
0b8f945
Merge branch 'spire-agent-config-fix' into direct-tpm-agent
kfox1111 Jan 30, 2024
6d971bf
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Jan 30, 2024
790d380
Merge branch 'main' into spire-agent-config-fix
kfox1111 Jan 30, 2024
331b100
Merge branch 'spire-agent-config-fix' into direct-tpm-agent
kfox1111 Jan 30, 2024
2e90089
Merge branch 'main' into direct-tpm-agent
kfox1111 Jan 30, 2024
dea1673
Pass the agent's securityContext on to Kubernetes
kfox1111 Jan 30, 2024
9d3ddc5
Merge branch 'main' into direct-tpm-agent
kfox1111 Jan 30, 2024
5ae0a23
Merge branch 'main' into direct-tpm-agent
kfox1111 Jan 30, 2024
609340a
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Jan 30, 2024
c9187d0
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 1, 2024
b33f2a3
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 1, 2024
7c9a123
Update example to be usable
kfox1111 Feb 2, 2024
1c68136
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 2, 2024
e104a44
Apply suggestions from code review
kfox1111 Feb 2, 2024
e3c8c3e
Update example
kfox1111 Feb 2, 2024
7e33954
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 2, 2024
507d311
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 3, 2024
10e2388
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 3, 2024
28f74dd
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 5, 2024
34e88b9
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 5, 2024
e6e7287
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 5, 2024
363c0db
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 5, 2024
b295a09
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 5, 2024
e4f44e6
Incorperate feedback
kfox1111 Feb 7, 2024
80dea1d
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 7, 2024
afa1e7b
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 7, 2024
99be90b
Incorperate feedback
kfox1111 Feb 9, 2024
1ddcddc
Merge branch 'direct-tpm-agent' of https://github.com/spiffe/helm-cha…
kfox1111 Feb 9, 2024
8047736
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 10, 2024
95ddb33
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 10, 2024
c6b9022
Fix merge conflict issue
kfox1111 Feb 10, 2024
8c9b201
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 12, 2024
1069949
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 12, 2024
7970396
Update to the newest release
kfox1111 Feb 13, 2024
6d1ffa1
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 13, 2024
cab4b4f
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 15, 2024
5f10114
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 15, 2024
437e4e5
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 19, 2024
47339b8
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 19, 2024
0c91884
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 19, 2024
7e44b8c
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 19, 2024
d1c39f2
Incorperate feedback
kfox1111 Feb 20, 2024
0dbcc95
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 20, 2024
d53e529
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 20, 2024
8e55dc0
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 20, 2024
61ddf8a
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 21, 2024
5ba7817
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 21, 2024
71b260b
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 22, 2024
fd854a4
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 22, 2024
0f8faca
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 22, 2024
d881dfb
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 22, 2024
254b455
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 22, 2024
d07bbb0
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 22, 2024
57355b5
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 26, 2024
c6b5041
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 26, 2024
ac6c84b
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 28, 2024
7e2e99e
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 28, 2024
0ee6545
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 28, 2024
f06dced
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 28, 2024
676f8cb
Incorperate feedback
kfox1111 Feb 28, 2024
fef9e9a
Merge branch 'main' into direct-tpm-agent
kfox1111 Feb 28, 2024
c4a687a
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 28, 2024
4f14281
Apply suggestions from code review
kfox1111 Feb 29, 2024
48413cb
Merge branch 'main' into direct-tpm-agent
faisal-memon Feb 29, 2024
80b35dc
Merge branch 'direct-tpm-agent' into direct-tpm-agent-hybrid
kfox1111 Feb 29, 2024
f2f6bfb
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Feb 29, 2024
010056a
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 1, 2024
c278328
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 4, 2024
b867ea0
Apply suggestions from code review
kfox1111 Mar 7, 2024
18bcef0
Fix version numbers in docs
kfox1111 Mar 8, 2024
0349562
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 8, 2024
9435bdc
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 12, 2024
23852ce
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 13, 2024
88e50d7
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 13, 2024
3d7f05b
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 15, 2024
1799ce1
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 18, 2024
578081f
Merge branch 'main' into direct-tpm-agent-hybrid
kfox1111 Mar 19, 2024
19f1de6
Remove merge conflicted extra code
kfox1111 Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion charts/spire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ kubectl delete crds clusterfederatedtrustdomains.spire.spiffe.io clusterspiffeid

We only support upgrading one major version at a time. Version skipping isn't supported.

### 0.18.x
### 0.19.X

- The spire-agent daemonset gained a new label. For those disabling the upgrade hooks, you need to delete the spire-agent daemonset before issuing the helm upgrade.

### 0.18.X

- SPIRE no longer emits x509UniqueIdentifiers in x509-SVIDS by default. The old behavior can be reenabled with spire-server.credentialComposer.uniqueID.enabled=true. See https://github.com/spiffe/spire/pull/4862 for details.
- SPIRE agents will now automatically reattest when they can. The old behavior can be reenabled with spire-agent.disableReattestToRenew=true. See https://github.com/spiffe/spire/pull/4791 for details.
Expand Down
6 changes: 6 additions & 0 deletions charts/spire/charts/spire-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ A Helm chart to install the SPIRE agent.
| `experimental.enabled` | Allow configuration of experimental features | `false` |
| `experimental.syncInterval` | Sync interval with SPIRE server with exponential backoff | `5s` |
| `experimental.featureFlags` | List of developer feature flags | `[]` |
| `agents` | Configure multiple agent DaemonSets. Useful when you have different node types and nodeAttestors | `{}` |
| `installAndUpgradeHook.enabled` | Enable Helm hook to autofix common install/upgrade issues (should be disabled when using `helm template`) | `true` |
| `tools.kubectl.image.registry` | The OCI registry to pull the image from | `docker.io` |
| `tools.kubectl.image.repository` | The repository within the registry | `rancher/kubectl` |
| `tools.kubectl.image.pullPolicy` | The image pull policy | `IfNotPresent` |
| `tools.kubectl.image.tag` | Overrides the image tag whose default is the chart appVersion | `""` |
| `sockets.hostBasePath` | Path on which the agent socket is made available when admin.mountOnHost is true | `/run/spire/agent/sockets` |
| `sockets.admin.enabled` | Enable the admin socket. Useful for admin tasks or the Delegated Identity API. | `false` |
| `sockets.admin.mountOnHost` | Enable the admin socket to be visible on the host. | `false` |
18 changes: 17 additions & 1 deletion charts/spire/charts/spire-agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- define "spire-agent.check-config-values" -}}
{{- include "spire-lib.check-strict-mode" (list . "clusterName must be set" (eq (include "spire-lib.cluster-name" .) "example-cluster"))}}
{{- include "spire-lib.check-strict-mode" (list . "trustDomain must be set" (eq (include "spire-lib.trust-domain" .) "example.org"))}}
{{- range $type, $tvals := .Values.customPlugins }}
Expand All @@ -21,6 +22,7 @@
{{- if hasPrefix (.Values.socketPath | dir | clean) (.Values.sockets.hostBasePath | clean) }}
{{- fail "The sockets.hostBasePath can not be located under the socketPath direcotry" }}
{{- end }}
{{- end }}
{{- define "spire-agent.yaml-config" -}}
agent:
{{- if .Values.disableReattestToRenew }}
Expand Down Expand Up @@ -132,10 +134,22 @@ telemetry:
port: {{ .Values.telemetry.prometheus.port }}
{{- end }}
{{- end }}
{{- $root := . }}
{{- range $name := (concat (list "default") (keys .Values.agents)) | uniq }}
{{- with (dict "Release" $root.Release "Chart" $root.Chart "Values" (deepCopy $root.Values)) }}
{{- $nameSuffix := "" }}
{{- if ne $name "default" }}
{{- $nameSuffix = printf "-%s" $name }}
{{- end }}
{{- if hasKey $root.Values.agents $name }}
{{- $_ := set . "Values" (mergeOverwrite .Values (index $root.Values.agents $name)) }}
{{- end }}
{{- include "spire-agent.check-config-values" . }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "spire-agent.fullname" . }}
name: {{ include "spire-agent.fullname" . }}{{ $nameSuffix }}
namespace: {{ include "spire-agent.namespace" . }}
{{- with .Values.configMap.annotations }}
annotations:
Expand All @@ -144,3 +158,5 @@ metadata:
data:
agent.conf: |
{{- include "spire-lib.reformat-and-yaml2json" (dict "config" (include "spire-agent.yaml-config" .) "root" .) | nindent 4 }}
{{- end }}
{{- end }}
24 changes: 22 additions & 2 deletions charts/spire/charts/spire-agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{{- $configSum := (include (print $.Template.BasePath "/configmap.yaml") . | sha256sum) }}
{{- $root := . }}
{{- range $name := (concat (list "default") (keys .Values.agents)) | uniq }}
{{- with (dict "Release" $root.Release "Chart" $root.Chart "Values" (deepCopy $root.Values)) }}
{{- $nameSuffix := "" }}
{{- if ne $name "default" }}
{{- $nameSuffix = printf "-%s" $name }}
{{- end }}
{{- if hasKey $root.Values.agents $name }}
{{- $_ := set . "Values" (mergeOverwrite .Values (index $root.Values.agents $name)) }}
{{- end }}
{{- $podSecurityContext := fromYaml (include "spire-lib.podsecuritycontext" .) }}
{{- $mainSecurityContext := deepCopy .Values.securityContext }}
{{- if .Values.nodeAttestor.tpmDirect.enabled }}
Expand All @@ -8,17 +18,20 @@
{{- $cbh := eq (include "spire-agent.connect-by-hostname" .) "true" }}
{{- $socketAlternateNames := index (include "spire-agent.socket-alternate-names" . | fromYaml) "names" }}
{{- $socketPath := include "spire-agent.socket-path" . }}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "spire-agent.fullname" . }}
name: {{ include "spire-agent.fullname" . }}{{ $nameSuffix }}
namespace: {{ include "spire-agent.namespace" . }}
labels:
{{- include "spire-agent.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ $name }}
spec:
selector:
matchLabels:
{{- include "spire-agent.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: {{ $name }}
{{- with .Values.updateStrategy }}
updateStrategy:
{{- if not (has .type (list "RollingUpdate" "OnDelete")) }}
Expand All @@ -40,6 +53,7 @@ spec:
{{- end }}
labels:
{{- include "spire-agent.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: {{ $name }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -257,7 +271,11 @@ spec:
{{- if eq (len .Values.trustBundleURL) 0 }}
- name: spire-bundle
configMap:
name: {{ include "spire-lib.bundle-configmap" . }}
name: {{ include "spire-lib.bundle-configmap" . }}{{ $nameSuffix }}
{{- end }}
{{- if .Values.nodeAttestor.tpmDirect.enabled }}
- name: tpm-direct
emptyDir: {}
{{- end }}
{{- if .Values.nodeAttestor.tpmDirect.enabled }}
- name: tpm-direct
Expand Down Expand Up @@ -287,3 +305,5 @@ spec:
{{- if gt (len .Values.extraVolumes) 0 }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
77 changes: 77 additions & 0 deletions charts/spire/charts/spire-agent/templates/pre-upgrade-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{- if eq ((dig "installAndUpgradeHooks" "enabled" .Values.installAndUpgradeHook.enabled .Values.global) | toString) "true" }}
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
{{- $ds := lookup "apps/v1" "DaemonSet" (include "spire-agent.namespace" .) (include "spire-agent.fullname" .) }}
{{- if and $ds (not (hasKey $ds.metadata.labels "app.kubernetes.io/component")) }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "spire-agent.serviceAccountName" . }}-pre-upgrade
namespace: {{ include "spire-agent.namespace" . }}
labels:
{{- include "spire-agent.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "spire-agent.fullname" . }}-pre-upgrade
namespace: {{ include "spire-agent.namespace" . }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed
rules:
- apiGroups: ["apps"]
resources: ["daemonsets"]
resourceNames: [{{ include "spire-agent.fullname" . | quote }}]
verbs: ["get", "delete"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "spire-agent.fullname" . }}-pre-upgrade
namespace: {{ include "spire-agent.namespace" . }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed
subjects:
- kind: ServiceAccount
name: {{ include "spire-agent.serviceAccountName" . }}-pre-upgrade
namespace: {{ include "spire-agent.namespace" . }}
roleRef:
kind: Role
name: {{ include "spire-agent.fullname" . }}-pre-upgrade
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "spire-agent.fullname" . }}-pre-upgrade
namespace: {{ include "spire-agent.namespace" . }}
labels:
{{- include "spire-agent.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed
spec:
template:
metadata:
name: {{ include "spire-agent.fullname" . }}-pre-upgrade
spec:
restartPolicy: Never
serviceAccountName: {{ include "spire-agent.serviceAccountName" . }}-pre-upgrade
securityContext:
{{- include "spire-lib.podsecuritycontext" . | nindent 8 }}
containers:
- name: pre-upgrade
securityContext:
{{- include "spire-lib.securitycontext" . | nindent 10 }}
image: {{ template "spire-lib.kubectl-image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tools.kubectl.image "global" .Values.global "KubeVersion" .Capabilities.KubeVersion.Version) }}
args:
- delete
- daemonset
- {{ include "spire-agent.fullname" . }}
- -n
- {{ include "spire-agent.namespace" . }}
{{- end }}
{{- end }}
31 changes: 31 additions & 0 deletions charts/spire/charts/spire-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,37 @@ experimental:
## @param experimental.featureFlags [array] List of developer feature flags
featureFlags: []

## @param agents Configure multiple agent DaemonSets. Useful when you have different node types and nodeAttestors
agents: {}
# default:
# nodeSelector:
# tpm: without
# tpm:
# nodeSelector:
# tpm: with
# nodeAttestor:
# k8sPsat:
# enabled: false
# tpmDirect:
# enabled: true

installAndUpgradeHook:
## @param installAndUpgradeHook.enabled Enable Helm hook to autofix common install/upgrade issues (should be disabled when using `helm template`)
enabled: true

tools:
kubectl:
## @param tools.kubectl.image.registry The OCI registry to pull the image from
## @param tools.kubectl.image.repository The repository within the registry
## @param tools.kubectl.image.pullPolicy The image pull policy
## @param tools.kubectl.image.tag Overrides the image tag whose default is the chart appVersion
##
image:
registry: docker.io
repository: rancher/kubectl
pullPolicy: IfNotPresent
tag: ""

sockets:
## @param sockets.hostBasePath Path on which the agent socket is made available when admin.mountOnHost is true
hostBasePath: /run/spire/agent/sockets
Expand Down
22 changes: 22 additions & 0 deletions examples/tpm-direct/different-nodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
spire-agent:
agents:
default:
nodeSelector:
tpm: without
tpm:
nodeSelector:
tpm: with
nodeAttestor:
k8sPsat:
enabled: false
tpmDirect:
enabled: true

spire-server:
controllerManager:
# K8s labels have a 63 character limit. TPM hashes are 64 chars. So you need to label the node with two labels with half of the tpm's hash each. The 'node-restriction.kubernetes.io/' prefix is so that the
# nodes can't update the hash themselves, an important security constraint.
parentIDTemplate: 'spiffe://{{ .TrustDomain }}/spire/agent/{{if index .NodeMeta.Labels "node-restriction.kubernetes.io/tpm-pubhash"}}tpm/{{ index .NodeMeta.Labels "node-restriction.kubernetes.io/tpm-pubhash" }}{{ index .NodeMeta.Labels "node-restriction.kubernetes.io/tpm-pubhash2" }}{{ else }}spire/agent/k8s_psat/{{ .ClusterName }}/{{ .NodeMeta.UID }}{{ end }}'
nodeAttestor:
tpmDirect:
enabled: true
15 changes: 15 additions & 0 deletions examples/tpm-direct/same-nodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spire-agent:
nodeAttestor:
k8sPsat:
enabled: false
tpmDirect:
enabled: true

spire-server:
controllerManager:
# K8s labels have a 63 character limit. TPM hashes are 64 chars. So you need to label the node with two labels with half of the tpm's hash each. The 'node-restriction.kubernetes.io/' prefix is so that the
# nodes can't update the hash themselves, an important security constraint.
parentIDTemplate: 'spiffe://{{ .TrustDomain }}/spire/agent/tpm/{{ index .NodeMeta.Labels "node-restriction.kubernetes.io/tpm-pubhash" }}{{ index .NodeMeta.Labels "node-restriction.kubernetes.io/tpm-pubhash2" }}'
nodeAttestor:
tpmDirect:
enabled: true
Loading