From f702871fb9990adb82b7bf1f6bca63edc92e80f2 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Thu, 9 Sep 2021 14:37:31 -0700 Subject: [PATCH] Respond to feedback on cluster template docs (#3485) * Respond to feedback on cluster template docs * Respond to feedback on cluster template doc --- .../cluster-templates/_index.md | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/content/rancher/v2.6/en/admin-settings/cluster-templates/_index.md b/content/rancher/v2.6/en/admin-settings/cluster-templates/_index.md index 2be5e058afb..9173fe65f45 100644 --- a/content/rancher/v2.6/en/admin-settings/cluster-templates/_index.md +++ b/content/rancher/v2.6/en/admin-settings/cluster-templates/_index.md @@ -9,6 +9,8 @@ Cluster templates encompass both Kubernetes configuration and node pool configur - [RKE2 Cluster Template](#rke2-cluster-template) - [Adding a Cluster Template to Rancher](#adding-a-cluster-template-to-rancher) - [Creating a Cluster from a Cluster Template](#creating-a-cluster-from-a-cluster-template) +- [Updating a Cluster Created from a Cluster Template](#updating-a-cluster-created-from-a-cluster-template) +- [Deploying Clusters from a Template with Fleet](#deploying-clusters-from-a-template-with-fleet) - [Uninstalling Cluster Templates](#uninstalling-cluster-templates) - [Configuration Options](#configuration-options) @@ -32,11 +34,16 @@ The example repository for an RKE2 cluster template is [here](https://github.com # Adding a Cluster Template to Rancher -> **Prerequisite:** You will need permission to configure a Helm chart repository in Rancher. +In this section, you'll learn how to add the cluster template to the `local` cluster's chart repo list. The result is that Rancher will include the cluster template as an option when users install new Kubernetes clusters. + +> **Prerequisites:** +> +> - You will need permission to install Helm charts on the `local` Kubernetes cluster that Rancher is installed on. +> - In order for the chart to appear in the form for creating new clusters, the chart must have the annotation `catalog.cattle.io/type: cluster-template`. 1. Go to a cluster template example repository. Rancher's examples are in [this GitHub repository.](https://github.com/rancher/cluster-template-examples) As of Rancher v2.6.0, we provide an RKE2 cluster template and add to more in the future. 1. Fork the repository. -1. Optional: Edit the cluster options by editing the `values.yaml` file. For help editing the file, see the cluster template's Helm chart README. Note that in order for the chart to appear in the form for creating new clusters, the chart must have the annotation `catalog.cattle.io/type: cluster-template`. +1. Optional: Edit the cluster options by editing the `values.yaml` file. For help editing the file, see the cluster template's Helm chart README. 1. Add the chart repository to Rancher. Click **☰ > Cluster Management**. 1. Go to the `local` cluster and click **Explore.** 1. In the left navigation bar, click **Apps & Marketplace > Chart Repositories.** @@ -54,15 +61,36 @@ The example repository for an RKE2 cluster template is [here](https://github.com > **Prerequisites:** > > - You will need permission to provision new Kubernetes clusters. -> - You will need permission to install Helm charts on the `local` Kubernetes cluster that the Rancher management server is installed on. -> - In order to use a template as part of continuous delivery/GitOps, the cluster template needs to be deployed in the `fleet-local` namespace of the `local` cluster. +> - You will need cloud credentials for provisioning infrastructure using the template. > - In order to show in the form for creating new clusters, the cluster template's Helm chart must have the `catalog.cattle.io/type: cluster-template` annotation. +1. Click **☰ > Cluster Management**. +1. On the **Clusters** page, click **Create.** +1. Click the name of your cluster template. +1. Finish installing the Helm chart. + +**Result:** After Rancher provisions the new cluster, it is managed in the same way as any other Rancher-launched Kubernetes cluster. You can configure any options through the UI if the cluster template has options for the user to choose from. + +# Updating a Cluster Created from a Cluster Template + +You can update any clusters using a template from the **Apps & Marketplace > Installed Apps** page, given there is a new version of a template being used by those clusters. + +# Deploying Clusters from a Template with Fleet + +> **Prerequisites:** +> +> - You will need permission to provision new Kubernetes clusters. +> - You will need cloud credentials for provisioning infrastructure using the template. +> - In order to show in the form for creating new clusters, the cluster template's Helm chart must have the `catalog.cattle.io/type:cluster-template` annotation. +> - In order to use a template as part of continuous delivery/GitOps, the cluster template needs to be deployed in the `fleet-local` namespace of the `local` cluster. +> - All values must be set in the `values.yaml` of the template. +> - Fleet repositories must follow the guidelines on [this page.](http://fleet.rancher.io/gitrepo-structure/) For RKE2 cluster templates, that means a `fleet.yaml` file must be added to the repository. + 1. Click **☰ > Cluster Management**. 1. On the **Clusters** page, click **Create.** 1. Click **Create Cluster from Template.** -**Result:** After Rancher provisions the new cluster, it is managed in the same way as any other Rancher-launched Kubernetes cluster. +**Result:** After Rancher provisions the new cluster, it is managed by Fleet. # Uninstalling Cluster Templates @@ -73,6 +101,8 @@ The example repository for an RKE2 cluster template is [here](https://github.com **Result:** The cluster template is uninstalled. This action does not affect clusters created with the cluster template. +An admin with access to the `local` cluster can also remove a cluster deployed via cluster templates through the **Apps & Marketplace > Installed Apps** page. + # Configuration Options Cluster templates are flexible enough that they can be used to configure all of the following options: