Skip to content

add gcp kubeadm clusterclass example #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

salasberryfin
Copy link
Contributor

Description

Add guide on how to provision a GCP self-managed clusters based on new ClusterClass template for CAPG/Kubeadm.

Fixes #322

@salasberryfin salasberryfin requested a review from a team as a code owner June 25, 2025 10:59
@salasberryfin salasberryfin added area/documentation Improvements or additions to documentation kind/enhancement New feature or request labels Jun 25, 2025
@salasberryfin salasberryfin force-pushed the add-capg-kubeadm-example branch from 73baf4f to 78b258e Compare June 25, 2025 11:01
@salasberryfin salasberryfin force-pushed the add-capg-kubeadm-example branch 2 times, most recently from 91c3eb9 to e27d0b6 Compare June 25, 2025 11:04
Copy link
Contributor

@anmazzotti anmazzotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small change requested to align the correct k8s version.
Rest looks all great!

@salasberryfin salasberryfin force-pushed the add-capg-kubeadm-example branch from e27d0b6 to 1f7219d Compare June 26, 2025 09:48
@salasberryfin salasberryfin requested review from anmazzotti and a team June 26, 2025 09:49
Copy link
Contributor

@valaparthvi valaparthvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. I just have a few suggestions.

----
+
* For this example we are also going to install https://docs.tigera.io/calico/latest/about/[Calico] as the default CNI. +
* The https://github.com/kubernetes/cloud-provider-gcp[Cloud Controller Manager GCP] will need to be installed on each downstream Cluster for the nodes to be functional. +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
Can we call it GCP Cloud Controller Manager instead of Cloud Controller Manager GCP? It seems easier to me to read and contemplate.

* Create the GCP Cluster from the example ClusterClass +
+
Note that some variables are left to the user to substitute. +
The default configuration of Cloud Controller Manager GCP is configured to use a single zone cluster, so the `clusterFailureDomains` variable is set to a single zone. If you need to provision a multi-zone cluster, we recommend you inspect the parameters provided by https://github.com/kubernetes/cloud-provider-gcp/blob/12f93cb23a5af58bfb7fb453bebff3eb2f81755c/providers/gce/gce.go#L120[Cloud Controller Manager GCP] and how https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/6518ef9b44cfc4f8c3f7139b2ce4ae71523deff6/test/e2e/data/infrastructure-gcp/cluster-template-ci.yaml#L59[CAPG leverages these variables] to create cluster-specific configurations. +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
The default configuration of Cloud Controller Manager GCP is configured to use a single zone cluster, so the `clusterFailureDomains` variable is set to a single zone. If you need to provision a multi-zone cluster, we recommend you inspect the parameters provided by https://github.com/kubernetes/cloud-provider-gcp/blob/12f93cb23a5af58bfb7fb453bebff3eb2f81755c/providers/gce/gce.go#L120[Cloud Controller Manager GCP] and how https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/6518ef9b44cfc4f8c3f7139b2ce4ae71523deff6/test/e2e/data/infrastructure-gcp/cluster-template-ci.yaml#L59[CAPG leverages these variables] to create cluster-specific configurations. +
The default configuration of Cloud Controller Manager GCP is configured to use a single zone cluster, so the `clusterFailureDomains` variable is set to a single zone. If you need to provision a multi-zone cluster, we recommend you inspect the parameters provided by https://github.com/kubernetes/cloud-provider-gcp/blob/master/providers/gce/gce.go#L120[Cloud Controller Manager GCP] and how https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/main/test/e2e/data/infrastructure-gcp/cluster-template-ci.yaml#L59[CAPG leverages these variables] to create cluster-specific configurations. +

@@ -191,6 +191,73 @@ spec:
matchLabels: {}
----
GCP::
+
To prepare the management Cluster, we are going to install the https://cluster-api-gcp.sigs.k8s.io/[Cluster API Provider GCP], and create a secret with the required credentials to provision a new Cluster on GCP. +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
To prepare the management Cluster, we are going to install the https://cluster-api-gcp.sigs.k8s.io/[Cluster API Provider GCP], and create a secret with the required credentials to provision a new Cluster on GCP. +
To prepare the management Cluster, we are going to install the https://cluster-api-gcp.sigs.k8s.io/[Cluster API Provider GCP], and create a secret with the credentials required to provision a new Cluster on GCP. +

spec:
type: infrastructure
variables:
GCP_B64ENCODED_CREDENTIALS: ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is a little unclear to me. Do I pass the encoded value to this variable or leave it empty?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, this should be filled and we should tell the user.
I was also wondering whether we should give an example loading vars from a secret, rather than in clear text like this.

@salasberryfin you can maybe copy from the AWS docs (that are now changed due to ClusterIdentity usage): https://github.com/rancher/turtles-docs/blob/main/docs/v0.20/modules/en/pages/user/clusterclass.adoc?plain=1#L83

+
[source,bash]
----
kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/heads/main/examples/applications/cni/aws/calico/helm-chart.yaml
Copy link
Contributor

@valaparthvi valaparthvi Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/heads/main/examples/applications/cni/aws/calico/helm-chart.yaml
kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/heads/main/examples/applications/cni/calico/helm-chart.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GCP self-managed example
3 participants