Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9fa9c85
enable multiple control plane classes
Dhairya-Arora01 Feb 25, 2026
dfca86c
fixup! enable multiple control plane classes
Dhairya-Arora01 Feb 25, 2026
a9f7b13
fixup! fixup! enable multiple control plane classes
Dhairya-Arora01 Feb 25, 2026
0751739
add the class name for control plane that should be patched
Dhairya-Arora01 Feb 26, 2026
06378fb
fixup! add the class name for control plane that should be patched
Dhairya-Arora01 Feb 26, 2026
7fdfc6e
added GOMODCACHE so packages are not downloaded again for each ARCH
guettli Feb 26, 2026
9b64c2a
...
guettli Feb 26, 2026
210d0ea
...
guettli Feb 26, 2026
2a66dbf
...
guettli Feb 26, 2026
2e8b08f
pass in GOMODCACHE
guettli Feb 26, 2026
e2a5dae
only amd64
guettli Feb 26, 2026
96448a8
handle git dirty in our script.
guettli Feb 26, 2026
9f4fa4d
set STAGING_REGISTRY, too.
guettli Feb 26, 2026
5adff1b
...
guettli Feb 26, 2026
611ec9f
..
guettli Feb 26, 2026
d66cefa
set REGISTRY, too.
guettli Feb 26, 2026
d48d386
call docker push.
guettli Feb 26, 2026
a9db246
build before push.
guettli Feb 26, 2026
7d7c63f
add syself new field comment on the cpclass patch selector match
Dhairya-Arora01 Feb 26, 2026
973f37e
add: hack/create-capi-op-yaml.sh to create yaml for capi-operator.
guettli Feb 26, 2026
df7a08c
run create-capi-op-yaml.sh directly in release.sh
guettli Feb 26, 2026
2ef631c
make class default to "" in clusterclass.spec.controlplaneclasses
Dhairya-Arora01 Feb 26, 2026
32c00a3
build and push only core images
Dhairya-Arora01 Feb 26, 2026
6932aa4
fixup! build and push only core images
Dhairya-Arora01 Feb 26, 2026
d942b0c
enable cluster topology feature gate in capi-operator
Dhairya-Arora01 Feb 26, 2026
5a32330
fix var expansion in script.
guettli Feb 27, 2026
1a39734
add our local release/development flow to docs
Dhairya-Arora01 Feb 27, 2026
c11e765
fixup! add our local release/development flow to docs
Dhairya-Arora01 Feb 27, 2026
3a9b32a
allow machine infrastructured to be changed for control-plane
Dhairya-Arora01 Feb 27, 2026
95a06b4
fixup! allow machine infrastructured to be changed for control-plane
Dhairya-Arora01 Feb 27, 2026
faf11dd
fixup! fixup! allow machine infrastructured to be changed for control…
Dhairya-Arora01 Feb 27, 2026
975113e
fixup! fixup! fixup! allow machine infrastructured to be changed for …
Dhairya-Arora01 Feb 27, 2026
97941e6
fixup! fixup! fixup! fixup! allow machine infrastructured to be chang…
Dhairya-Arora01 Feb 27, 2026
d40d2ee
fixup! fixup! fixup! fixup! fixup! allow machine infrastructured to b…
Dhairya-Arora01 Feb 27, 2026
1c8b9c3
fixup! fixup! fixup! fixup! fixup! fixup! allow machine infrastructur…
Dhairya-Arora01 Feb 28, 2026
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
54 changes: 31 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ TILT_PREPARE_BIN := tilt-prepare
TILT_PREPARE := $(abspath $(TOOLS_BIN_DIR)/$(TILT_PREPARE_BIN))

# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
REGISTRY ?= gcr.io/xxxxxx

# For string inside YAML files (in "out" directory)
PROD_REGISTRY ?= registry.k8s.io/cluster-api

# For string inside YAML files (in "out" directory)
STAGING_REGISTRY ?= gcr.io/k8s-staging-cluster-api
STAGING_BUCKET ?= k8s-staging-cluster-api
#STAGING_BUCKET ?= k8s-staging-cluster-api

# core
IMAGE_NAME ?= cluster-api-controller
Expand Down Expand Up @@ -242,7 +245,7 @@ CAPI_KIND_CLUSTER_NAME ?= capi-test

TAG ?= dev
ARCH ?= $(shell go env GOARCH)
ALL_ARCH ?= amd64 arm arm64 ppc64le s390x
ALL_ARCH ?= amd64

# Allow overriding the imagePullPolicy
PULL_POLICY ?= Always
Expand Down Expand Up @@ -819,10 +822,11 @@ docker-build-%:

# Choice of images to build/push
ALL_DOCKER_BUILD ?= core kubeadm-bootstrap kubeadm-control-plane docker-infrastructure test-extension clusterctl
SYSELF_RELEVANT_DOCKER_BUILD ?= core

.PHONY: docker-build
docker-build: docker-pull-prerequisites ## Run docker-build-* targets for all the images
$(MAKE) ARCH=$(ARCH) $(addprefix docker-build-,$(ALL_DOCKER_BUILD))
$(MAKE) ARCH=$(ARCH) $(addprefix docker-build-,$(SYSELF_RELEVANT_DOCKER_BUILD))

ALL_DOCKER_BUILD_E2E = core kubeadm-bootstrap kubeadm-control-plane docker-infrastructure test-extension

Expand Down Expand Up @@ -1013,9 +1017,9 @@ $(RELEASE_NOTES_DIR):

.PHONY: release
release: clean-release ## Build and push container images using the latest git tag for the commit
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
@if ! [ -z "$$(git status --porcelain)" ]; then echo "Your local git repository contains uncommitted changes, use git clean before proceeding."; exit 1; fi
git checkout "${RELEASE_TAG}"
#@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
#@if ! [ -z "$$(git status --porcelain)" ]; then echo "Your local git repository contains uncommitted changes, use git clean before proceeding."; exit 1; fi
#git checkout "${RELEASE_TAG}"
# Build binaries first.
GIT_VERSION=$(RELEASE_TAG) $(MAKE) release-binaries
# Set the manifest images to the staging/production bucket and Builds the manifests to publish with a release.
Expand Down Expand Up @@ -1091,11 +1095,11 @@ release-manifests-dev: $(RELEASE_DIR) $(KUSTOMIZE) ## Build the development mani
.PHONY: release-binaries
release-binaries: ## Build the binaries to publish with a release
RELEASE_BINARY=clusterctl-linux-amd64 BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=amd64 $(MAKE) release-binary
RELEASE_BINARY=clusterctl-linux-arm64 BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=arm64 $(MAKE) release-binary
RELEASE_BINARY=clusterctl-darwin-amd64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=amd64 $(MAKE) release-binary
RELEASE_BINARY=clusterctl-darwin-arm64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=arm64 $(MAKE) release-binary
RELEASE_BINARY=clusterctl-windows-amd64.exe BUILD_PATH=./cmd/clusterctl GOOS=windows GOARCH=amd64 $(MAKE) release-binary
RELEASE_BINARY=clusterctl-linux-ppc64le BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=ppc64le $(MAKE) release-binary
# RELEASE_BINARY=clusterctl-linux-arm64 BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=arm64 $(MAKE) release-binary
# RELEASE_BINARY=clusterctl-darwin-amd64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=amd64 $(MAKE) release-binary
# RELEASE_BINARY=clusterctl-darwin-arm64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=arm64 $(MAKE) release-binary
# RELEASE_BINARY=clusterctl-windows-amd64.exe BUILD_PATH=./cmd/clusterctl GOOS=windows GOARCH=amd64 $(MAKE) release-binary
# RELEASE_BINARY=clusterctl-linux-ppc64le BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=ppc64le $(MAKE) release-binary

.PHONY: release-binary
release-binary: $(RELEASE_DIR)
Expand All @@ -1104,9 +1108,11 @@ release-binary: $(RELEASE_DIR)
-e CGO_ENABLED=0 \
-e GOOS=$(GOOS) \
-e GOARCH=$(GOARCH) \
-e GOCACHE=/tmp/ \
-e GOCACHE=/go/build-cache/ \
--user $$(id -u):$$(id -g) \
-v "$$(pwd):/workspace$(DOCKER_VOL_OPTS)" \
-v "$$(go env GOMODCACHE):/go/pkg/mod" \
-v "$$(go env GOCACHE):/go/build-cache" \
-w /workspace \
golang:$(GO_VERSION) \
go build -a -trimpath -ldflags "$(LDFLAGS) -extldflags '-static'" \
Expand All @@ -1128,7 +1134,8 @@ release-staging: ## Build and push container images to the staging bucket
$(MAKE) release-manifests-dev
# Example manifest location: https://storage.googleapis.com/k8s-staging-cluster-api/components/main/core-components.yaml
# Please note that these files are deleted after a certain period, at the time of this writing 60 days after file creation.
gsutil cp $(RELEASE_DIR)/* gs://$(STAGING_BUCKET)/components/$(RELEASE_ALIAS_TAG)

##gsutil cp $(RELEASE_DIR)/* gs://$(STAGING_BUCKET)/components/$(RELEASE_ALIAS_TAG)

.PHONY: release-staging-nightly
release-staging-nightly: ## Tag and push container images to the staging bucket. Example image tag: cluster-api-controller:nightly_main_20210121
Expand All @@ -1145,16 +1152,17 @@ release-staging-nightly: ## Tag and push container images to the staging bucket.
$(MAKE) release-manifests-dev
# Example manifest location: https://storage.googleapis.com/k8s-staging-cluster-api/components/nightly_main_20240425/core-components.yaml
# Please note that these files are deleted after a certain period, at the time of this writing 60 days after file creation.
gsutil cp $(RELEASE_DIR)/* gs://$(STAGING_BUCKET)/components/$(NEW_RELEASE_ALIAS_TAG)
#gsutil cp $(RELEASE_DIR)/* gs://$(STAGING_BUCKET)/components/$(NEW_RELEASE_ALIAS_TAG)

.PHONY: release-alias-tag
release-alias-tag: ## Add the release alias tag to the last build tag
gcloud container images add-tag $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG):$(TAG) $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG):$(TAG) $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag $(CLUSTERCTL_IMG):$(TAG) $(CLUSTERCTL_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag $(CAPD_CONTROLLER_IMG):$(TAG) $(CAPD_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
gcloud container images add-tag $(TEST_EXTENSION_IMG):$(TAG) $(TEST_EXTENSION_IMG):$(RELEASE_ALIAS_TAG)
echo "Syself: skipping"
# gcloud container images add-tag $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
# gcloud container images add-tag $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG):$(TAG) $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
# gcloud container images add-tag $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG):$(TAG) $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
# gcloud container images add-tag $(CLUSTERCTL_IMG):$(TAG) $(CLUSTERCTL_IMG):$(RELEASE_ALIAS_TAG)
# gcloud container images add-tag $(CAPD_CONTROLLER_IMG):$(TAG) $(CAPD_CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
# gcloud container images add-tag $(TEST_EXTENSION_IMG):$(TAG) $(TEST_EXTENSION_IMG):$(RELEASE_ALIAS_TAG)

.PHONY: release-notes-tool
release-notes-tool:
Expand Down Expand Up @@ -1190,13 +1198,13 @@ docker-image-verify: ## Verifies all built images to contain the correct binary

.PHONY: docker-push-all
docker-push-all: $(addprefix docker-push-,$(ALL_ARCH)) ## Push the docker images to be included in the release for all architectures + related multiarch manifests
$(MAKE) ALL_ARCH="$(ALL_ARCH)" $(addprefix docker-push-manifest-,$(ALL_DOCKER_BUILD))
$(MAKE) ALL_ARCH="$(ALL_ARCH)" $(addprefix docker-push-manifest-,$(SYSELF_RELEVANT_DOCKER_BUILD))

docker-push-%:
$(MAKE) ARCH=$* docker-push

.PHONY: docker-push
docker-push: $(addprefix docker-push-,$(ALL_DOCKER_BUILD)) ## Push the docker images to be included in the release
docker-push: $(addprefix docker-push-,$(SYSELF_RELEVANT_DOCKER_BUILD)) ## Push the docker images to be included in the release

.PHONY: docker-push-core
docker-push-core: ## Push the core docker image
Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,37 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
[Good first issue]: https://github.com/kubernetes-sigs/cluster-api/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
[Help wanted]: https://github.com/kubernetes-sigs/cluster-api/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+

<!-- ANCHOR_END: Community -->
# Release/Development (Syself Fork)

1. Create the git tag for the release.
```shell
git tag v1.10.7-syself.8
```

2. Export the release tag.
```shell
export RELEASE_TAG=v1.10.7-syself.8
```

3. Run the release script.
```shell
./hack/release.sh
```
This will create the manifests in the `out/` directory. And push the CAPI controller-image to http://ghcr.io/syself/cluster-api-prod/cluster-api-controller-amd64:v1.10.7-syself.8

4. You can apply the generated `out/operator-configmaps.yaml` and `out/operator-provider-patches.yaml` to the management cluster.
```shell
k apply -f ../cluster-api/out/operator-configmaps.yaml
k apply -f ../cluster-api/out/operator-provider-patches.yaml
```

5. Ensure that the configured `--source` flag in CSO and CSPH deployments is set as `oci`. If its not set as `oci`, edit the same in `addonprovider` for `cso` and `csph`.
```shell
k edit addonproviders.operator.cluster.x-k8s.io -n mgt-system cso
k edit addonproviders.operator.cluster.x-k8s.io -n mgt-system csph
```

6. Ensure that the secret `cluster-stack` containing Github and OCI credentials exist and is same as that of testing-cluster. Otherwise modify it and copy the values from the secret present in testing cluster.
```shell
kubectl-modify-secret -n mgt-system cluster-stack
```
8 changes: 8 additions & 0 deletions api/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@ type ControlPlaneTopology struct {
// +optional
Metadata ObjectMeta `json:"metadata,omitempty"`

// class is the name of the ControlPlaneClass used to create the set of control plane nodes.
// This should match one of the control plane classes defined in the ClusterClass object.
// syself new field.
// +optional
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
Class string `json:"class,omitempty"`

// replicas is the number of control plane nodes.
// If the value is nil, the ControlPlane object is created without the number of Replicas
// and it's assumed that the control plane controller does not implement support for this field.
Expand Down
36 changes: 36 additions & 0 deletions api/v1beta1/clusterclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ type ClusterClassSpec struct {
// +optional
ControlPlane ControlPlaneClass `json:"controlPlane,omitempty"`

// controlPlaneClasses is a list of named control plane classes that can be referenced
// from the Cluster topology. Each class defines a distinct control plane
// configuration. The class name MUST be unique within this list.
// When classes is defined, the Cluster topology can reference a specific
// control plane class by name.
// syself new field.
// +optional
// +listType=map
// +listMapKey=class
// +kubebuilder:validation:MaxItems=100
ControlPlaneClasses []ControlPlaneClass `json:"controlPlaneClasses,omitempty"`

// workers describes the worker nodes for the cluster.
// It is a collection of node types which can be used to create
// the worker nodes of the cluster.
Expand Down Expand Up @@ -148,6 +160,13 @@ type ControlPlaneClass struct {
// +optional
Metadata ObjectMeta `json:"metadata,omitempty"`

// class denotes a type of control-plane node present in the cluster.
// When used in ControlPlaneTopologyClass.Classes, this name MUST be unique
// within the list and can be referenced from the Cluster topology.
// +optional
// +default=""
Class string `json:"class,omitempty"`

// LocalObjectTemplate contains the reference to the control plane provider.
LocalObjectTemplate `json:",inline"`

Expand Down Expand Up @@ -1013,6 +1032,12 @@ type PatchSelectorMatch struct {
// +optional
InfrastructureCluster bool `json:"infrastructureCluster,omitempty"`

// controlPlaneClass selects templates referenced in specific ControlPlaneClasses in
// .spec.controlPlane.classes.
// syself new field.
// +optional
ControlPlaneClass *PatchSelectorMatchControlPlaneClass `json:"controlPlaneClass,omitempty"`

// machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in
// .spec.workers.machineDeployments.
// +optional
Expand All @@ -1024,6 +1049,17 @@ type PatchSelectorMatch struct {
MachinePoolClass *PatchSelectorMatchMachinePoolClass `json:"machinePoolClass,omitempty"`
}

// PatchSelectorMatchControlPlaneClass selects templates referenced
// in specific ControlPlaneClasses in .spec.controlPlane.classes.
type PatchSelectorMatchControlPlaneClass struct {
// names selects templates by class names.
// +optional
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:items:MinLength=1
// +kubebuilder:validation:items:MaxLength=256
Names []string `json:"names,omitempty"`
}

// PatchSelectorMatchMachineDeploymentClass selects templates referenced
// in specific MachineDeploymentClasses in .spec.workers.machineDeployments.
type PatchSelectorMatchMachineDeploymentClass struct {
Expand Down
32 changes: 32 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading