From 1b48dbaadda6ecfeda0b76923a72d21416fe5a84 Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Tue, 30 Sep 2025 14:01:20 +0200 Subject: [PATCH 1/3] Add documentation for migrating an existing cluster to CCM --- .../ROOT/pages/how-tos/deploy_ocp.adoc | 54 +++++++++++++++++++ docs/modules/ROOT/partials/nav.adoc | 1 + 2 files changed, 55 insertions(+) create mode 100644 docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc diff --git a/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc b/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc new file mode 100644 index 0000000..cf4e990 --- /dev/null +++ b/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc @@ -0,0 +1,54 @@ += Deploy on existing OpenShift cluster + +This guide describes how to deploy exoscale CCM on an existing cluster. + +== Step-by-step guide + +. Deploy component-exoscale-cloud-controller-manager + +. Patch infrastructure config ++ +IMPORTANT: This step triggers node reboots to apply the Kubelet flag `--cloud-provider=external`. ++ +[source,bash] +---- +kubectl --as cluster-admin patch infrastructure.config cluster --type=merge -p '{"spec":{"platformSpec":{"external":{"platformName":"exoscale"},"type":"External"}}}' +---- ++ +[source,bash] +---- +kubectl proxy & +curl -XPATCH -H"Content-Type: application/merge-patch+json" http://localhost:8001/apis/config.openshift.io/v1/infrastructures/cluster/status -d '{"status":{"platform":"External","platformStatus":{"external":{"cloudControllerManager":{"state":"External"}},"type":"External"}}}' +---- + +. Taint nodes with `node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule` ++ +[source,bash] +---- +kubectl --as cluster-admin taint node --all node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule +---- + +. Check if instance-type is applied ++ +[source,bash] +---- +kubectl get nodes -ocustom-columns='NAME:.metadata.name,INSTANCE_TYPE:.metadata.labels.node\.kubernetes\.io/instance-type' +---- ++ +[source,bash] +---- +NAME INSTANCE_TYPE +infra-032a standard.extra-large +infra-7b8b standard.extra-large +infra-f8e1 standard.extra-large +infra-fa1a standard.extra-large +master-03b1 standard.extra-large +master-4386 standard.extra-large +master-a662 standard.extra-large +storage-11b9 cpu.extra-large +storage-2764 cpu.extra-large +storage-5d24 cpu.extra-large +worker-e6e75-drjgz standard.extra-large +worker-e6e75-ikhpr standard.extra-large +worker-e6e75-nypky standard.extra-large +---- diff --git a/docs/modules/ROOT/partials/nav.adoc b/docs/modules/ROOT/partials/nav.adoc index 08f9283..7608451 100644 --- a/docs/modules/ROOT/partials/nav.adoc +++ b/docs/modules/ROOT/partials/nav.adoc @@ -1,2 +1,3 @@ * xref:index.adoc[Home] * xref:references/parameters.adoc[Parameters] +* xref:how-tos/deploy_ocp.adoc[Install on Existing OpenShift Cluster] From 3f1999e1c260e284e24aec195c9332773d1c0964 Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Tue, 30 Sep 2025 14:08:18 +0200 Subject: [PATCH 2/3] Update from template Template version: main (8f2273c) --- .cruft.json | 4 ++-- .github/workflows/release.yaml | 2 +- .github/workflows/test.yaml | 8 ++++---- Makefile.vars.mk | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.cruft.json b/.cruft.json index cdaa45d..797b895 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/projectsyn/commodore-component-template.git", - "commit": "98d16f99766e6c6d97322dbe42e058f0e2bf73d0", + "commit": "8f2273cd8ab13c55eb0f6dd621c70c4c9e4786fd", "checkout": "main", "context": { "cookiecutter": { @@ -25,7 +25,7 @@ "github_name": "component-exoscale-cloud-controller-manager", "github_url": "https://github.com/projectsyn/component-exoscale-cloud-controller-manager", "_template": "https://github.com/projectsyn/commodore-component-template.git", - "_commit": "98d16f99766e6c6d97322dbe42e058f0e2bf73d0" + "_commit": "8f2273cd8ab13c55eb0f6dd621c70c4c9e4786fd" } }, "directory": null diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8cf7be4..b0eac75 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: "0" - name: Build changelog from PRs with labels diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 354cb97..706a0e5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,13 +17,13 @@ jobs: - lint_yaml - lint_adoc steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Run ${{ matrix.command }} run: make ${{ matrix.command }} editorconfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: snow-actions/eclint@v1.0.1 with: args: 'check' @@ -38,7 +38,7 @@ jobs: run: working-directory: ${{ env.COMPONENT_NAME }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: path: ${{ env.COMPONENT_NAME }} - name: Compile component @@ -54,7 +54,7 @@ jobs: run: working-directory: ${{ env.COMPONENT_NAME }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: path: ${{ env.COMPONENT_NAME }} - name: Golden diff diff --git a/Makefile.vars.mk b/Makefile.vars.mk index 44ce000..6fde2d4 100644 --- a/Makefile.vars.mk +++ b/Makefile.vars.mk @@ -26,7 +26,7 @@ DOCKER_ARGS ?= run --rm -u "$$(id -u):$$(id -g)" --userns=$(DOCKER_USERNS) -w /$ JSONNET_FILES ?= $(shell find . -type f -not -path './vendor/*' \( -name '*.*jsonnet' -or -name '*.libsonnet' \)) JSONNETFMT_ARGS ?= --in-place --pad-arrays -JSONNET_IMAGE ?= docker.io/bitnami/jsonnet:latest +JSONNET_IMAGE ?= ghcr.io/projectsyn/jsonnet:latest JSONNET_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) --entrypoint=jsonnetfmt $(JSONNET_IMAGE) YAMLLINT_ARGS ?= --no-warnings From 3d20a30001090a37547bc5799de6f1018152db8a Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Wed, 1 Oct 2025 11:26:42 +0200 Subject: [PATCH 3/3] Improve instructions based on code review --- .../ROOT/pages/how-tos/deploy_ocp.adoc | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc b/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc index cf4e990..3368997 100644 --- a/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc +++ b/docs/modules/ROOT/pages/how-tos/deploy_ocp.adoc @@ -1,10 +1,25 @@ = Deploy on existing OpenShift cluster -This guide describes how to deploy exoscale CCM on an existing cluster. +This guide describes how to deploy the Exoscale cloud-controller-manager (CCM) on an existing cluster. + +We recommend that you migrate your cluster to use https://kb.vshn.ch/oc4/how-tos/exoscale/migrate_to_instancepool.html[instancepools for the worker nodes] before deploying the CCM. + + +== Prerequisites +* cluster-admin access to the cluster to migrate +* `kubectl` +* Write access to the cluster's Syn tenant repository == Step-by-step guide -. Deploy component-exoscale-cloud-controller-manager +. Deploy component-exoscale-cloud-controller-manager. +Add the following to your cluster's Project Syn configuration: ++ +[source,yaml] +---- +applications: + - exoscale-cloud-controller-manager +---- . Patch infrastructure config + @@ -17,8 +32,8 @@ kubectl --as cluster-admin patch infrastructure.config cluster --type=merge -p + [source,bash] ---- -kubectl proxy & -curl -XPATCH -H"Content-Type: application/merge-patch+json" http://localhost:8001/apis/config.openshift.io/v1/infrastructures/cluster/status -d '{"status":{"platform":"External","platformStatus":{"external":{"cloudControllerManager":{"state":"External"}},"type":"External"}}}' +kubectl --as=cluster-admin patch infrastructure.config cluster --type=merge --subresource=status \ + -p '{"status":{"platform":"External","platformStatus":{"external":{"cloudControllerManager":{"state":"External"}},"type":"External"}}}' ---- . Taint nodes with `node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule`