From db3f5ba8cc7e83b1c7ef3a4e139f135287a8253e Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Wed, 1 May 2024 17:34:10 +0100 Subject: [PATCH 1/3] docs: Add how to create clusters --- .goreleaser.yml | 1 + ...-runtime-extensions-nutanix.code-workspace | 11 +++- .../getting-started/create-cluster/_index.md | 8 +++ .../getting-started/create-cluster/aws.md | 47 +++++++++++++++ .../getting-started/create-cluster/docker.md | 39 +++++++++++++ .../getting-started/create-cluster/nutanix.md | 57 +++++++++++++++++++ .../getting-started/deployment/_index.md | 1 + docs/hugo.toml | 4 +- docs/layouts/shortcodes/param.html | 3 + release-please-config.json | 9 ++- 10 files changed, 176 insertions(+), 4 deletions(-) create mode 100644 docs/content/getting-started/create-cluster/_index.md create mode 100644 docs/content/getting-started/create-cluster/aws.md create mode 100644 docs/content/getting-started/create-cluster/docker.md create mode 100644 docs/content/getting-started/create-cluster/nutanix.md create mode 100644 docs/layouts/shortcodes/param.html diff --git a/.goreleaser.yml b/.goreleaser.yml index cdfc93809..a89e39f41 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -26,6 +26,7 @@ release: - glob: ./examples/capi-quick-start/*.yaml - glob: metadata.yaml - glob: runtime-extension-components.yaml + - glob: ./charts/{{ .ProjectName }}/defaultclusterclasses/*.yaml before: hooks: diff --git a/cluster-api-runtime-extensions-nutanix.code-workspace b/cluster-api-runtime-extensions-nutanix.code-workspace index 77040605e..159a06f9f 100644 --- a/cluster-api-runtime-extensions-nutanix.code-workspace +++ b/cluster-api-runtime-extensions-nutanix.code-workspace @@ -15,5 +15,14 @@ ], "settings": { "go.buildTags": "e2e", - } + "json.schemaDownload.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "/release-please-config.json" + ], + "url": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" + }, + ], + }, } diff --git a/docs/content/getting-started/create-cluster/_index.md b/docs/content/getting-started/create-cluster/_index.md new file mode 100644 index 000000000..0094743cf --- /dev/null +++ b/docs/content/getting-started/create-cluster/_index.md @@ -0,0 +1,8 @@ ++++ +title = "Creating clusters" +icon = "fa-solid fa-industry" +weight = 2 ++++ + +CAREN currently supports clusters for the providers below (follow the links below to see instructions on how to use +CAREN with these providers). diff --git a/docs/content/getting-started/create-cluster/aws.md b/docs/content/getting-started/create-cluster/aws.md new file mode 100644 index 000000000..fb8786a51 --- /dev/null +++ b/docs/content/getting-started/create-cluster/aws.md @@ -0,0 +1,47 @@ ++++ +title = "AWS" +icon = "fa-brands fa-aws" +weight = 1 ++++ + +Cluster API requires that `ClusterClasses` referenced by a `Cluster` reside in the same namespace as the `Cluster`. To +create the necessary `ClusterClass`, run: + +```shell +kubectl apply --server-side \ + -f https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-class.yaml +``` + +You can then create your cluster. First, let's list the required variables: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml \ + --list-variables +``` + +Export the required variables and any optional variables that you may want to set: + +```shell +export AMI_LOOKUP_BASEOS= \ + AMI_LOOKUP_FORMAT= \ + AMI_LOOKUP_ORG= +``` + +And create your cluster: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f - +``` + +To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/aws-cluster-cilium-helm-addon.yaml >mycluster.yaml + +# EDIT mycluster.yaml + +kubectl apply --server-side -f mycluster.yaml +``` diff --git a/docs/content/getting-started/create-cluster/docker.md b/docs/content/getting-started/create-cluster/docker.md new file mode 100644 index 000000000..bb9d49019 --- /dev/null +++ b/docs/content/getting-started/create-cluster/docker.md @@ -0,0 +1,39 @@ ++++ +title = "Docker" +icon = "fa-brands fa-docker" +weight = 3 ++++ + +Cluster API requires that `ClusterClasses` referenced by a `Cluster` reside in the same namespace as the `Cluster`. To +create the necessary `ClusterClass`, run: + +```shell +kubectl apply --server-side \ + -f https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-class.yaml +``` + +You can then create your cluster. First, let's list the required variables: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml \ + --list-variables +``` + +Export the required variables and any optional variables that you may want to set and then create your cluster: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f - +``` + +To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/docker-cluster-cilium-helm-addon.yaml >mycluster.yaml + +# EDIT mycluster.yaml + +kubectl apply --server-side -f mycluster.yaml +``` diff --git a/docs/content/getting-started/create-cluster/nutanix.md b/docs/content/getting-started/create-cluster/nutanix.md new file mode 100644 index 000000000..30ea59c78 --- /dev/null +++ b/docs/content/getting-started/create-cluster/nutanix.md @@ -0,0 +1,57 @@ ++++ +title = "Nutanix" +icon = "fa-solid fa-server" +weight = 2 ++++ + + +Cluster API requires that `ClusterClasses` referenced by a `Cluster` reside in the same namespace as the `Cluster`. To +create the necessary `ClusterClass`, run: + +```shell +kubectl apply --server-side \ + -f https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-class.yaml +``` + +You can then create your cluster. First, let's list the required variables: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml \ + --list-variables +``` + +Export the required variables and any optional variables that you may want to set: + +```shell +export CONTROL_PLANE_ENDPOINT_IP= \ + DOCKER_HUB_PASSWORD= \ + DOCKER_HUB_USERNAME= \ + NUTANIX_ENDPOINT= \ + NUTANIX_INSECURE= \ + NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME= \ + NUTANIX_PASSWORD= \ + NUTANIX_PORT= \ + NUTANIX_PRISM_ELEMENT_CLUSTER_NAME= \ + NUTANIX_STORAGE_CONTAINER_NAME= \ + NUTANIX_SUBNET_NAME= \ + NUTANIX_USER +``` + +And create your cluster: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml | kubectl apply --server-side -f - +``` + +To customize your cluster configuration prior to creation, generate the cluster definition to a file and edit it before applying: + +```shell +clusterctl generate cluster my-cluster \ + --from https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/releases/download/v{{< param "version" >}}/nutanix-cluster-cilium-helm-addon.yaml >mycluster.yaml + +# EDIT mycluster.yaml + +kubectl apply --server-side -f mycluster.yaml +``` diff --git a/docs/content/getting-started/deployment/_index.md b/docs/content/getting-started/deployment/_index.md index 7b5412987..ed64b6cce 100644 --- a/docs/content/getting-started/deployment/_index.md +++ b/docs/content/getting-started/deployment/_index.md @@ -1,6 +1,7 @@ +++ title = "Deploying CAREN" icon = "fa-solid fa-truck-fast" +weight = 1 +++ CAREN is implemented as a CAPI runtime extension provider, which means it can be deployed alongside all other CAPI diff --git a/docs/hugo.toml b/docs/hugo.toml index df01f0a04..768b78e3f 100644 --- a/docs/hugo.toml +++ b/docs/hugo.toml @@ -1,5 +1,5 @@ baseURL = "https://nutanix-cloud-native.github.io/cluster-api-runtime-extensions-nutanix" -title = "CAPI Runtime Extensions | D2iQ Labs" +title = "Cluster API Runtime Extensions | Nutanix" enableRobotsTXT = true @@ -70,7 +70,7 @@ archived_version = false # The version number for the version of the docs represented in this doc set. # Used in the "version-banner" partial to display a version number for the # current doc set. -version = "0.0" +version = "0.8.1" # A link to latest version of the docs. Used in the "version-banner" partial to # point people to the main doc site. diff --git a/docs/layouts/shortcodes/param.html b/docs/layouts/shortcodes/param.html new file mode 100644 index 000000000..8a1cc4312 --- /dev/null +++ b/docs/layouts/shortcodes/param.html @@ -0,0 +1,3 @@ +{{- $v := .Site.Params -}} +{{- range (split (.Get 0) ".") }}{{ $v = index $v (.) }}{{- end -}} +{{- $v -}} diff --git a/release-please-config.json b/release-please-config.json index a7e133033..24445aa63 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -3,7 +3,14 @@ ".": { "release-type": "go", "pull-request-title-pattern": "release${scope}: ${component} v${version}", - "changelog-type": "github" + "changelog-type": "github", + "extra-files": [ + { + "type": "toml", + "path": "docs/hugo.toml", + "jsonpath": "$.params.version" + } + ] } } } From db3f7a9ff96fbc13068dd0f20e7d66305cf929bd Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Wed, 1 May 2024 19:03:48 +0100 Subject: [PATCH 2/3] fixup! docs: Add comma --- docs/content/getting-started/deployment/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/getting-started/deployment/_index.md b/docs/content/getting-started/deployment/_index.md index ed64b6cce..a6f3e0573 100644 --- a/docs/content/getting-started/deployment/_index.md +++ b/docs/content/getting-started/deployment/_index.md @@ -8,5 +8,5 @@ CAREN is implemented as a CAPI runtime extension provider, which means it can be providers in the same way [using `clusterctl`]({{< ref "via-clusterctl" >}}). However, as CAREN is not yet integrated into `clusterctl`, it is necessary to first configure `clusterctl` to know about CAREN before we can deploy it. -Alternatively you can install CAREN [via Helm]({{< ref "via-helm" >}}). Installing via Helm will provide default some +Alternatively, you can install CAREN [via Helm]({{< ref "via-helm" >}}). Installing via Helm will provide default some default `ClusterClasses` and allow for further customization of the CAREN deployment. From 0d833466162f4e021d7afcac6effc1f98f1e1e60 Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Thu, 2 May 2024 13:42:29 +0100 Subject: [PATCH 3/3] fixup! refactor: Apply review suggestions --- docs/content/getting-started/deployment/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/getting-started/deployment/_index.md b/docs/content/getting-started/deployment/_index.md index a6f3e0573..a9cbef8a0 100644 --- a/docs/content/getting-started/deployment/_index.md +++ b/docs/content/getting-started/deployment/_index.md @@ -8,5 +8,5 @@ CAREN is implemented as a CAPI runtime extension provider, which means it can be providers in the same way [using `clusterctl`]({{< ref "via-clusterctl" >}}). However, as CAREN is not yet integrated into `clusterctl`, it is necessary to first configure `clusterctl` to know about CAREN before we can deploy it. -Alternatively, you can install CAREN [via Helm]({{< ref "via-helm" >}}). Installing via Helm will provide default some -default `ClusterClasses` and allow for further customization of the CAREN deployment. +Alternatively, you can install CAREN [via Helm]({{< ref "via-helm" >}}). Installing via Helm will provide some default +`ClusterClasses` and allow for further customization of the CAREN deployment.