Skip to content

Commit 9a67b7b

Browse files
committed
deploy: add spire manifests in helm and kustomize
Signed-off-by: TessaIO <[email protected]> Signed-off-by: AhmedGrati <[email protected]>
1 parent c77c370 commit 9a67b7b

File tree

14 files changed

+275
-119
lines changed

14 files changed

+275
-119
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: spire
3+
repository: https://spiffe.github.io/helm-charts-hardened/
4+
version: 0.24.1
5+
digest: sha256:f3b4dc973a59682bf3aa5ca9b53322f57935dd093081e82a37b8082e00becbe9
6+
generated: "2024-12-20T16:52:40.180416+01:00"

deployment/helm/node-feature-discovery/Chart.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ keywords:
1313
- node-labels
1414
type: application
1515
version: 0.2.1
16+
dependencies:
17+
- name: spire
18+
version: 0.24.1
19+
repository: https://spiffe.github.io/helm-charts-hardened/
20+
condition: spire.enabled
Binary file not shown.

deployment/helm/node-feature-discovery/templates/master.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,25 @@ spec:
145145
{{- with .Values.master.extraArgs }}
146146
{{- toYaml . | nindent 12 }}
147147
{{- end }}
148+
{{- if .Values.spire.enabled }}
149+
- "-enable-spiffe"
150+
{{- end }}
148151
volumeMounts:
152+
{{- if .Values.spire.enabled }}
153+
- name: spire-agent-socket
154+
mountPath: /run/spire/agent-sockets/api.sock
155+
readOnly: true
156+
{{- end }}
149157
- name: nfd-master-conf
150158
mountPath: "/etc/kubernetes/node-feature-discovery"
151159
readOnly: true
152160
volumes:
161+
{{- if .Values.spire.enabled }}
162+
- name: spire-agent-socket
163+
hostPath:
164+
path: /run/spire/agent-sockets/api.sock
165+
type: Socket
166+
{{- end }}
153167
- name: nfd-master-conf
154168
configMap:
155169
name: {{ include "node-feature-discovery.fullname" . }}-master-conf

deployment/helm/node-feature-discovery/templates/worker.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,18 @@ spec:
110110
{{- with .Values.worker.extraArgs }}
111111
{{- toYaml . | nindent 8 }}
112112
{{- end }}
113+
{{- if .Values.spire.enabled }}
114+
- "-enable-spiffe"
115+
{{- end }}
113116
ports:
114117
- containerPort: {{ .Values.worker.port | default "8080"}}
115118
name: http
116119
volumeMounts:
120+
{{- if .Values.spire.enabled }}
121+
- name: spire-agent-socket
122+
mountPath: /run/spire/agent-sockets/api.sock
123+
readOnly: true
124+
{{- end }}
117125
- name: host-boot
118126
mountPath: "/host-boot"
119127
readOnly: true
@@ -144,6 +152,12 @@ spec:
144152
mountPath: "/etc/kubernetes/node-feature-discovery"
145153
readOnly: true
146154
volumes:
155+
{{- if .Values.spire.enabled }}
156+
- name: spire-agent-socket
157+
hostPath:
158+
path: /run/spire/agent-sockets/api.sock
159+
type: Socket
160+
{{- end }}
147161
- name: host-boot
148162
hostPath:
149163
path: "/boot"

deployment/helm/node-feature-discovery/values.yaml

+56-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
image:
2-
repository: gcr.io/k8s-staging-nfd/node-feature-discovery
2+
repository: docker.io/ahmedgrati/node-feature-discovery
33
# This should be set to 'IfNotPresent' for released version
44
pullPolicy: Always
55
# tag, if defined will use the given image tag, else Chart.AppVersion will be used
6-
# tag
6+
tag: v0.18.0-devel-105-gb1d33c2b2-dirty
77
imagePullSecrets: []
88

99
nameOverride: ""
@@ -574,3 +574,57 @@ prometheus:
574574
enable: false
575575
scrapeInterval: 10s
576576
labels: {}
577+
578+
spire:
579+
enabled: true
580+
global:
581+
spire:
582+
clusterName: "nfd"
583+
trustDomain: "nfd.k8s-sigs.io"
584+
system:
585+
name: "spire-system"
586+
create: false
587+
server:
588+
name: "spire-server"
589+
create: false
590+
spire-agent:
591+
nameOverride: "spire-agent"
592+
kubeletConnectByHostname: "true"
593+
server:
594+
address: "nfd-spire-server.nfd"
595+
workloadAttestors:
596+
unix:
597+
enabled: true
598+
spire-server:
599+
nameOverride: "spire-server"
600+
controllerManager:
601+
enabled: true
602+
identities:
603+
clusterStaticEntries:
604+
node:
605+
parentID: spiffe://nfd.k8s-sigs.io/spire/server
606+
spiffeID: spiffe://nfd.k8s-sigs.io/root
607+
selectors:
608+
- k8s_psat:agent_ns:nfd
609+
- k8s_psat:agent_sa:nfd-agent
610+
- k8s_psat:cluster:nfd
611+
nfd:
612+
parentID: spiffe://nfd.k8s-sigs.io/root
613+
spiffeID: spiffe://nfd.k8s-sigs.io/worker
614+
selectors:
615+
- k8s:pod-label:app.kubernetes.io/name:node-feature-discovery
616+
617+
618+
caSubject:
619+
commonName: "nfd.k8s-sigs.io"
620+
country: "US"
621+
organization: "SPIFFE"
622+
623+
upstream:
624+
enabled: false
625+
spiffe-csi-driver:
626+
enabled: false
627+
spiffe-oidc-discovery-provider:
628+
enabled: false
629+
tornjak-frontend:
630+
enabled: false

docs/reference/master-commandline-reference.md

+16
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,19 @@ Example:
306306
```bash
307307
nfd-master -resync-period=2h
308308
```
309+
310+
### -enable-spiffe
311+
312+
the `-enable-spiffe` flag enables SPIFFE verification for the created NodeFeature
313+
objects created by the worker. When enabled, master verifies the signature that
314+
is put on the annotations part of the NodeFeature object, and updates
315+
Kubernetes nodes if the signature is verified. The feature should be enabled,
316+
after deploying SPIFFE, and you can do it through the Helm chart.
317+
318+
Default: false.
319+
320+
Example:
321+
322+
```bash
323+
nfd-master -enable-spiffe
324+
```

docs/reference/worker-commandline-reference.md

+16
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,19 @@ Default: 0
273273
Comma-separated list of `pattern=N` settings for file-filtered logging.
274274

275275
Default: *empty*
276+
277+
### -enable-spiffe
278+
279+
the `-enable-spiffe` flag enables signing NodeFeature spec on the worker side
280+
and puts the signature in the annotations side of the NodeFeature object.
281+
The signature is verified afterwards by the master. The feature
282+
should be enabled, after deploying SPIFFE, and you can do it through
283+
the Helm chart.
284+
285+
Default: false.
286+
287+
Example:
288+
289+
```bash
290+
nfd-master -enable-spiffe
291+
```

go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/prometheus/client_golang v1.21.0
2020
github.com/smartystreets/goconvey v1.8.1
2121
github.com/spf13/cobra v1.9.1
22+
github.com/spiffe/go-spiffe/v2 v2.5.0
2223
github.com/stretchr/testify v1.10.0
2324
github.com/vektra/errors v0.0.0-20140903201135-c64d83aba85a
2425
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
@@ -71,6 +72,7 @@ require (
7172
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
7273
github.com/felixge/httpsnoop v1.0.4 // indirect
7374
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
75+
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
7476
github.com/go-logr/logr v1.4.2 // indirect
7577
github.com/go-logr/stdr v1.2.2 // indirect
7678
github.com/go-ole/go-ole v1.2.6 // indirect
@@ -131,6 +133,7 @@ require (
131133
github.com/stoewer/go-strcase v1.3.0 // indirect
132134
github.com/stretchr/objx v0.5.2 // indirect
133135
github.com/x448/float16 v0.8.4 // indirect
136+
github.com/zeebo/errs v1.4.0 // indirect
134137
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
135138
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
136139
go.etcd.io/etcd/client/v3 v3.5.16 // indirect

go.sum

+6-22
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
7676
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
7777
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
7878
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
79+
github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E=
80+
github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc=
7981
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
8082
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
8183
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
@@ -123,27 +125,6 @@ github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/Z
123125
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
124126
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
125127
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
126-
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
127-
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
128-
github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
129-
github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
130-
github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
131-
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
132-
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
133-
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
134-
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
135-
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
136-
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
137-
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
138-
github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
139-
github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
140-
github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8=
141-
github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
142-
github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
143-
github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw=
144-
github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI=
145-
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
146-
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
147128
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
148129
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
149130
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
@@ -276,14 +257,15 @@ github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
276257
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
277258
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
278259
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
260+
github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE=
261+
github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g=
279262
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
280263
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
281264
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
282265
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
283266
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
284267
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
285268
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
286-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
287269
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
288270
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
289271
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -301,6 +283,8 @@ github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chq
301283
github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
302284
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
303285
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
286+
github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM=
287+
github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
304288
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
305289
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
306290
go.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0=

0 commit comments

Comments
 (0)