Skip to content

Commit c087f5b

Browse files
committed
feat: Refactor node bootstrap
* Generate Distribution specific userdata * Require distribution: - rke2 - rke2airgapped - kubeadm (WIP) * If rke2 is specifified, require rke2 version to download. * Validate kube-distro and kube-version Signed-off-by: Dinar Valeev <[email protected]>
1 parent a07a961 commit c087f5b

18 files changed

+486
-240
lines changed

.gitignore

Whitespace-only changes.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
KARPENTER_CORE_DIR = $(shell go list -m -f '{{ .Dir }}' sigs.k8s.io/karpenter)
2+
BINARY_FILENAME ?= "karpenter-provider-vsphere"
23

34
LDFLAGS ?= -ldflags=-X=sigs.k8s.io/karpenter/pkg/operator.Version=$(shell git describe --tags --always | cut -d"v" -f2)
45

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Karpenter provider for VMWare Vsphere
88

99
| Flag | Environment variable | Required |
1010
|------------------|----------------------|----------|
11-
|cluster-name | CLUSTER_NAME | true |
11+
| cluster-name | CLUSTER_NAME | true |
1212
| vsphere-endpoint | GOVC_URL | true |
1313
| vsphere-username | GOVC_USERNAME | true |
1414
| vsphere-password | GOVC_PASSWORD | true |
15-
| vsphere-path | VSPHERE_PATH | true |
16-
| vsphere-insecure | VSPHERE_INSECURE | false |
15+
| vsphere-path | VSPHERE_FOLDER | true |
16+
| vsphere-insecure | GOVC_INSECURE | false |
1717

1818
# VsphereNodeClass API
19-
Besides `VSPHERE_PATH` (vsphere folder to place virtulal machines on), all placement settings are defined in `VsphereNodeClass` resource. This is done via selectors:
19+
Besides `VSPHERE_FOLDER` (vsphere folder to place virtulal machines on), all placement settings are defined in `VsphereNodeClass` resource. This is done via selectors:
2020
* `.spec.computeSelector` - defines how to search for desired resourcePool
2121
* `.spec.datastoreSelector` - defines how to search for desired datastore
2222
* `.spec.networkSelector` - difines how to discover network
@@ -40,8 +40,7 @@ All selectors have `tag` and `name` properties, those are mutually exclusive. Ka
4040

4141

4242
* `.spec.userdata`:
43-
- `type` - Either `ignition` or `cloud-init`
44-
- `templateBase64` - A base64 encoded template
45-
- `values` - a v1.Secret reference (name/namespace) to key/values used in a template
43+
- `type` - Either `ignition` or `cloud-config`
44+
- `additionalUserdata` - extra init data to be merged with distribution specific
4645

4746
[!NOTE] user-data should hanndle `karpenter.sh/unregistered` taint to the node

go.mod

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,82 @@
11
module github.com/absaoss/karpenter-provider-vsphere
22

3-
go 1.24.2
4-
5-
toolchain go1.24.3
3+
go 1.24.5
64

75
require (
8-
github.com/awslabs/operatorpkg v0.0.0-20250603063504-c7c4c980c091
6+
github.com/awslabs/operatorpkg v0.0.0-20250624064700-e9977193119b
7+
github.com/blang/semver/v4 v4.0.0
98
github.com/go-logr/zapr v1.3.0
9+
github.com/mitchellh/hashstructure/v2 v2.0.2
10+
github.com/patrickmn/go-cache v2.1.0+incompatible
1011
github.com/pkg/errors v0.9.1
11-
github.com/samber/lo v1.50.0
12-
github.com/vmware/govmomi v0.50.0
13-
k8s.io/api v0.33.1
14-
k8s.io/apimachinery v0.33.1
15-
k8s.io/client-go v0.33.1
16-
sigs.k8s.io/controller-runtime v0.21.0
17-
sigs.k8s.io/karpenter v1.4.0
12+
github.com/samber/lo v1.51.0
13+
github.com/stretchr/testify v1.11.1
14+
github.com/vmware/govmomi v0.52.0
15+
go.uber.org/multierr v1.11.0
16+
k8s.io/api v0.34.1
17+
k8s.io/apiextensions-apiserver v0.34.1
18+
k8s.io/apimachinery v0.34.1
19+
k8s.io/client-go v0.34.1
20+
sigs.k8s.io/controller-runtime v0.22.1
21+
sigs.k8s.io/karpenter v1.6.2
22+
sigs.k8s.io/yaml v1.6.0
1823
)
1924

2025
require (
2126
github.com/beorn7/perks v1.0.1 // indirect
22-
github.com/blang/semver/v4 v4.0.0
2327
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2428
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
25-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
29+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
2630
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
27-
github.com/fsnotify/fsnotify v1.7.0 // indirect
28-
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
31+
github.com/fsnotify/fsnotify v1.9.0 // indirect
32+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
2933
github.com/go-logr/logr v1.4.3 // indirect
3034
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3135
github.com/go-openapi/jsonreference v0.20.2 // indirect
3236
github.com/go-openapi/swag v0.23.0 // indirect
3337
github.com/gogo/protobuf v1.3.2 // indirect
3438
github.com/google/btree v1.1.3 // indirect
35-
github.com/google/gnostic-models v0.6.9 // indirect
39+
github.com/google/gnostic-models v0.7.0 // indirect
3640
github.com/google/go-cmp v0.7.0 // indirect
3741
github.com/google/uuid v1.6.0 // indirect
3842
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3943
github.com/josharian/intern v1.0.0 // indirect
4044
github.com/json-iterator/go v1.1.12 // indirect
4145
github.com/mailru/easyjson v0.7.7 // indirect
42-
github.com/mitchellh/hashstructure/v2 v2.0.2
4346
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
44-
github.com/modern-go/reflect2 v1.0.2 // indirect
47+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
4548
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
46-
github.com/patrickmn/go-cache v2.1.0+incompatible
47-
github.com/prometheus/client_golang v1.22.0 // indirect
49+
github.com/pmezard/go-difflib v1.0.0 // indirect
50+
github.com/prometheus/client_golang v1.23.2 // indirect
4851
github.com/prometheus/client_model v0.6.2 // indirect
49-
github.com/prometheus/common v0.62.0 // indirect
50-
github.com/prometheus/procfs v0.15.1 // indirect
52+
github.com/prometheus/common v0.66.1 // indirect
53+
github.com/prometheus/procfs v0.16.1 // indirect
5154
github.com/robfig/cron/v3 v3.0.1 // indirect
52-
github.com/spf13/cobra v1.8.1 // indirect
55+
github.com/spf13/cobra v1.9.1 // indirect
5356
github.com/spf13/pflag v1.0.6 // indirect
5457
github.com/x448/float16 v0.8.4 // indirect
55-
go.uber.org/multierr v1.11.0
5658
go.uber.org/zap v1.27.0 // indirect
57-
golang.org/x/net v0.38.0 // indirect
58-
golang.org/x/oauth2 v0.27.0 // indirect
59-
golang.org/x/sync v0.13.0 // indirect
60-
golang.org/x/sys v0.32.0 // indirect
61-
golang.org/x/term v0.30.0 // indirect
62-
golang.org/x/text v0.24.0 // indirect
63-
golang.org/x/time v0.11.0 // indirect
59+
go.yaml.in/yaml/v2 v2.4.2 // indirect
60+
go.yaml.in/yaml/v3 v3.0.4 // indirect
61+
golang.org/x/net v0.43.0 // indirect
62+
golang.org/x/oauth2 v0.30.0 // indirect
63+
golang.org/x/sync v0.16.0 // indirect
64+
golang.org/x/sys v0.35.0 // indirect
65+
golang.org/x/term v0.34.0 // indirect
66+
golang.org/x/text v0.28.0 // indirect
67+
golang.org/x/time v0.13.0 // indirect
6468
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
65-
google.golang.org/protobuf v1.36.6 // indirect
69+
google.golang.org/protobuf v1.36.8 // indirect
6670
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
6771
gopkg.in/inf.v0 v0.9.1 // indirect
6872
gopkg.in/yaml.v3 v3.0.1 // indirect
69-
k8s.io/apiextensions-apiserver v0.33.0
70-
k8s.io/cloud-provider v0.32.3 // indirect
71-
k8s.io/component-base v0.33.0 // indirect
72-
k8s.io/csi-translation-lib v0.32.3 // indirect
73+
k8s.io/cloud-provider v0.33.2 // indirect
74+
k8s.io/component-base v0.34.1 // indirect
75+
k8s.io/csi-translation-lib v0.33.2 // indirect
7376
k8s.io/klog/v2 v2.130.1 // indirect
74-
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
75-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
76-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
77+
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
78+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
79+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
7780
sigs.k8s.io/randfill v1.0.0 // indirect
78-
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
79-
sigs.k8s.io/yaml v1.4.0 // indirect
81+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
8082
)

0 commit comments

Comments
 (0)