Skip to content

Commit

Permalink
Remove user-data plugins from machine-controller (#1789)
Browse files Browse the repository at this point in the history
* Remove userdata plugins

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Code cleanup

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Update scripts

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Remove pipelines for testing userdata

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* deprecate use-external-bootstrap

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Update Dockerfile

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Cleanup for pipelines

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* More cleanup

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* More cleanup

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Update README

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Fix formatting for scripts

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* Make use-external-bootstrap no-op

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

* More cleanup

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>

---------

Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
  • Loading branch information
ahmedwaleedmalik committed May 2, 2024
1 parent eaccda7 commit 0231d55
Show file tree
Hide file tree
Showing 137 changed files with 283 additions and 36,308 deletions.
35 changes: 0 additions & 35 deletions .prow/provider-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,6 @@ presubmits:
limits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-spot-instance-legacy-userdata
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
decorate: true
clone_uri: "ssh://git@github.com/kubermatic/machine-controller.git"
labels:
preset-aws: "true"
preset-hetzner: "true"
preset-e2e-ssh: "true"
preset-rhel: "true"
preset-goproxy: "true"
preset-kind-volume-mounts: "true"
preset-docker-mirror: "true"
preset-kubeconfig-ci: "true"
spec:
containers:
- image: quay.io/kubermatic/build:go-1.22-node-20-kind-0.22-3
env:
- name: OPERATING_SYSTEM_MANAGER
value: "false"
- name: CLOUD_PROVIDER
value: aws
command:
- "./hack/ci/run-e2e-tests.sh"
args:
- "TestAWSSpotInstanceProvisioningE2E"
securityContext:
privileged: true
resources:
requests:
memory: 7Gi
cpu: 2
limits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-arm
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
Expand Down
34 changes: 0 additions & 34 deletions .prow/provider-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,3 @@ presubmits:
cpu: 2
limits:
memory: 7Gi

- name: pull-machine-controller-e2e-gce-legacy-userdata
always_run: true
decorate: true
clone_uri: "ssh://git@github.com/kubermatic/machine-controller.git"
labels:
preset-gce: "true"
preset-hetzner: "true"
preset-e2e-ssh: "true"
preset-rhel: "true"
preset-goproxy: "true"
preset-kind-volume-mounts: "true"
preset-docker-mirror: "true"
preset-kubeconfig-ci: "true"
spec:
containers:
- image: quay.io/kubermatic/build:go-1.22-node-20-kind-0.22-3
command:
- "./hack/ci/run-e2e-tests.sh"
args:
- "TestGCEProvisioningE2E"
env:
- name: OPERATING_SYSTEM_MANAGER
value: "false"
- name: CLOUD_PROVIDER
value: gce
securityContext:
privileged: true
resources:
requests:
memory: 7Gi
cpu: 2
limits:
memory: 7Gi
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ RUN apk add --no-cache ca-certificates cdrkit

COPY --from=builder \
/go/src/github.com/kubermatic/machine-controller/machine-controller \
/go/src/github.com/kubermatic/machine-controller/machine-controller-userdata-* \
/go/src/github.com/kubermatic/machine-controller/webhook \
/usr/local/bin/
USER nobody
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ IMAGE_TAG = \
IMAGE_NAME ?= $(REGISTRY)/$(REGISTRY_NAMESPACE)/machine-controller:$(IMAGE_TAG)

OS = amzn2 centos ubuntu rhel flatcar rockylinux
USERDATA_BIN = $(patsubst %, machine-controller-userdata-%, $(OS))

BASE64_ENC = \
$(shell if base64 -w0 <(echo "") &> /dev/null; then echo "base64 -w0"; else echo "base64 -b0"; fi)
Expand All @@ -43,13 +42,7 @@ BASE64_ENC = \
all: build-machine-controller webhook

.PHONY: build-machine-controller
build-machine-controller: machine-controller $(USERDATA_BIN)

machine-controller-userdata-%: cmd/userdata/% $(shell find cmd/userdata/$* pkg -name '*.go')
GOOS=$(GOOS) go build -v \
$(LDFLAGS) \
-o $@ \
github.com/kubermatic/machine-controller/cmd/userdata/$*
build-machine-controller: machine-controller

%: cmd/% $(shell find cmd/$* pkg -name '*.go')
GOOS=$(GOOS) go build -v \
Expand All @@ -60,8 +53,7 @@ machine-controller-userdata-%: cmd/userdata/% $(shell find cmd/userdata/$* pkg -
.PHONY: clean
clean:
rm -f machine-controller \
webhook \
$(USERDATA_BIN)
webhook

.PHONY: lint
lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kubermatic machine-controller

**Important Note: User data plugins for machine-controller are deprecated and will soon be removed. [Operating System Manager](https://github.com/kubermatic/operating-system-manager) is the successor of user data plugins. It's responsible for creating and managing the required configurations for worker nodes in a Kubernetes cluster with better modularity and extensibility. Please refer to [Operating System Manager][8] for more details.**
**Important Note: User data plugins for machine-controller have been removed. [Operating System Manager](https://github.com/kubermatic/operating-system-manager) is the successor of user data plugins. It's responsible for creating and managing the required configurations for worker nodes in a Kubernetes cluster with better modularity and extensibility. Please refer to [Operating System Manager][8] for more details.**

## Table of Contents

Expand Down
7 changes: 1 addition & 6 deletions cmd/machine-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ type controllerRunOptions struct {

node machinecontroller.NodeSettings

// Enable external bootstrap management by consuming secrets that are used to configure an instance's user-data.
useExternalBootstrap bool

// A port range to reserve for services with NodePort visibility.
nodePortRange string

Expand Down Expand Up @@ -188,7 +185,7 @@ func main() {
flag.StringVar(&nodePortRange, "node-port-range", "30000-32767", "A port range to reserve for services with NodePort visibility")
flag.StringVar(&nodeRegistryCredentialsSecret, "node-registry-credentials-secret", "", "A Secret object reference, that contains auth info for image registry in namespace/secret-name form, example: kube-system/registry-credentials. See doc at https://github.com/kubermaric/machine-controller/blob/main/docs/registry-authentication.md")
flag.BoolVar(&useOSM, "use-osm", false, "DEPRECATED: use osm controller for node bootstrap [use use-external-bootstrap instead]")
flag.BoolVar(&useExternalBootstrap, "use-external-bootstrap", false, "use an external bootstrap provider for instance user-data (e.g. operating-system-manager, also known as OSM)")
flag.BoolVar(&useExternalBootstrap, "use-external-bootstrap", true, "DEPRECATED: This flag is no-op and will have no effect since machine-controller only supports external bootstrap mechanism. This flag is only kept for backwards compatibility and will be removed in the future")
flag.StringVar(&overrideBootstrapKubeletAPIServer, "override-bootstrap-kubelet-apiserver", "", "Override for the API server address used in worker nodes bootstrap-kubelet.conf")

flag.Parse()
Expand Down Expand Up @@ -296,7 +293,6 @@ func main() {
RegistryCredentialsSecretRef: nodeRegistryCredentialsSecret,
ContainerRuntime: containerRuntimeConfig,
},
useExternalBootstrap: useExternalBootstrap || useOSM,
nodePortRange: nodePortRange,
overrideBootstrapKubeletAPIServer: overrideBootstrapKubeletAPIServer,
}
Expand Down Expand Up @@ -437,7 +433,6 @@ func (bs *controllerBootstrap) Start(ctx context.Context) error {
bs.opt.bootstrapTokenServiceAccountName,
bs.opt.skipEvictionAfter,
bs.opt.node,
bs.opt.useExternalBootstrap,
bs.opt.nodePortRange,
bs.opt.overrideBootstrapKubeletAPIServer,
); err != nil {
Expand Down
58 changes: 0 additions & 58 deletions cmd/userdata/amzn2/main.go

This file was deleted.

58 changes: 0 additions & 58 deletions cmd/userdata/centos/main.go

This file was deleted.

58 changes: 0 additions & 58 deletions cmd/userdata/flatcar/main.go

This file was deleted.

58 changes: 0 additions & 58 deletions cmd/userdata/rhel/main.go

This file was deleted.

Loading

0 comments on commit 0231d55

Please sign in to comment.