Skip to content

Commit 05e90d0

Browse files
committed
feat: add spiffe integration in master and worker
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>
1 parent 624c02e commit 05e90d0

File tree

8 files changed

+400
-40
lines changed

8 files changed

+400
-40
lines changed

cmd/nfd-master/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ func main() {
9191
klog.InfoS("-port is deprecated, will be removed in a future release along with the deprecated gRPC API")
9292
case "verify-node-name":
9393
klog.InfoS("-verify-node-name is deprecated, will be removed in a future release along with the deprecated gRPC API")
94+
case "enable-spiffe":
95+
args.Overrides.EnableSpiffe = overrides.EnableSpiffe
9496
}
9597
})
9698

@@ -188,6 +190,8 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs)
188190
"It does not have effect when the NodeFeature API has been disabled (with -feature-gates NodeFeatureAPI=false).")
189191
overrides.NfdApiParallelism = flagset.Int("nfd-api-parallelism", 10, "Defines the maximum number of goroutines responsible of updating nodes. "+
190192
"Can be used for the throttling mechanism. It does not have effect if NodeFeatureAPI feature gate is disabled.")
193+
overrides.EnableSpiffe = flagset.Bool("enable-spiffe", false,
194+
"Enables the Spiffe signature verification of created CRDs. This is still an EXPERIMENTAL feature.")
191195

192196
return args, overrides
193197
}

cmd/nfd-worker/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ func parseArgs(flags *flag.FlagSet, osArgs ...string) *worker.Args {
112112
args.Overrides.FeatureSources = overrides.FeatureSources
113113
case "label-sources":
114114
args.Overrides.LabelSources = overrides.LabelSources
115+
case "enable-spiffe":
116+
args.Overrides.EnableSpiffe = overrides.EnableSpiffe
115117
}
116118
})
117119

@@ -163,6 +165,8 @@ func initFlags(flagset *flag.FlagSet) (*worker.Args, *worker.ConfigOverrideArgs)
163165
flagset.Var(overrides.LabelSources, "label-sources",
164166
"Comma separated list of label sources. Special value 'all' enables all sources. "+
165167
"Prefix the source name with '-' to disable it.")
168+
overrides.EnableSpiffe = flagset.Bool("enable-spiffe", false,
169+
"Enables the Spiffe signature verification of created CRDs. This is still an EXPERIMENTAL feature.")
166170

167171
return args, overrides
168172
}

go.mod

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/fsnotify/fsnotify v1.7.0
77
github.com/golang/protobuf v1.5.4
88
github.com/google/go-cmp v0.6.0
9-
github.com/google/uuid v1.5.0
9+
github.com/google/uuid v1.6.0
1010
github.com/jaypipes/ghw v0.8.1-0.20210827132705-c7224150a17e
1111
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.0
1212
github.com/k8stopologyawareschedwg/podfingerprint v0.1.2
@@ -17,12 +17,13 @@ require (
1717
github.com/prometheus/client_golang v1.18.0
1818
github.com/smartystreets/goconvey v1.8.1
1919
github.com/spf13/cobra v1.8.0
20-
github.com/stretchr/testify v1.8.4
20+
github.com/spiffe/go-spiffe/v2 v2.2.0
21+
github.com/stretchr/testify v1.9.0
2122
github.com/vektra/errors v0.0.0-20140903201135-c64d83aba85a
2223
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
2324
golang.org/x/net v0.20.0
2425
golang.org/x/time v0.5.0
25-
google.golang.org/grpc v1.60.1
26+
google.golang.org/grpc v1.62.1
2627
google.golang.org/protobuf v1.33.0
2728
k8s.io/api v0.29.0
2829
k8s.io/apiextensions-apiserver v0.29.0
@@ -54,7 +55,7 @@ require (
5455
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
5556
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b // indirect
5657
github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab // indirect
57-
github.com/Microsoft/go-winio v0.6.0 // indirect
58+
github.com/Microsoft/go-winio v0.6.1 // indirect
5859
github.com/Microsoft/hcsshim v0.8.25 // indirect
5960
github.com/NYTimes/gziphandler v1.1.1 // indirect
6061
github.com/OneOfOne/xxhash v1.2.8 // indirect
@@ -83,6 +84,7 @@ require (
8384
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
8485
github.com/felixge/httpsnoop v1.0.4 // indirect
8586
github.com/ghodss/yaml v1.0.0 // indirect
87+
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
8688
github.com/go-logr/logr v1.3.0 // indirect
8789
github.com/go-logr/stdr v1.2.2 // indirect
8890
github.com/go-ole/go-ole v1.2.4 // indirect
@@ -142,11 +144,12 @@ require (
142144
github.com/smarty/assertions v1.15.1 // indirect
143145
github.com/spf13/pflag v1.0.5 // indirect
144146
github.com/stoewer/go-strcase v1.2.0 // indirect
145-
github.com/stretchr/objx v0.5.0 // indirect
147+
github.com/stretchr/objx v0.5.2 // indirect
146148
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
147149
github.com/vishvananda/netlink v1.1.0 // indirect
148150
github.com/vishvananda/netns v0.0.4 // indirect
149151
github.com/vmware/govmomi v0.30.6 // indirect
152+
github.com/zeebo/errs v1.3.0 // indirect
150153
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
151154
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
152155
go.etcd.io/etcd/client/v3 v3.5.10 // indirect
@@ -164,19 +167,19 @@ require (
164167
go.uber.org/atomic v1.10.0 // indirect
165168
go.uber.org/multierr v1.11.0 // indirect
166169
go.uber.org/zap v1.24.0 // indirect
167-
golang.org/x/crypto v0.18.0 // indirect
170+
golang.org/x/crypto v0.19.0 // indirect
168171
golang.org/x/mod v0.14.0 // indirect
169-
golang.org/x/oauth2 v0.14.0 // indirect
172+
golang.org/x/oauth2 v0.16.0 // indirect
170173
golang.org/x/sync v0.6.0 // indirect
171-
golang.org/x/sys v0.16.0 // indirect
172-
golang.org/x/term v0.16.0 // indirect
174+
golang.org/x/sys v0.17.0 // indirect
175+
golang.org/x/term v0.17.0 // indirect
173176
golang.org/x/text v0.14.0 // indirect
174177
golang.org/x/tools v0.17.0 // indirect
175178
google.golang.org/api v0.149.0 // indirect
176179
google.golang.org/appengine v1.6.8 // indirect
177-
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect
178-
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect
179-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
180+
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
181+
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
182+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
180183
gopkg.in/gcfg.v1 v1.2.3 // indirect
181184
gopkg.in/inf.v0 v0.9.1 // indirect
182185
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect

0 commit comments

Comments
 (0)