mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-05-19 11:25:15 +00:00
making edits at Will's request
This commit is contained in:
@@ -7,17 +7,17 @@ If you have a cluster in Rancher that you want to use as a template for creating
|
||||
|
||||
## Caveats
|
||||
|
||||
Only [cluster types]({{< baseurl >}}/content/rancher/v2.x/en/cluster-provisioning) that interact with cloud hosts over API can be duplicated. Duplication of imported clusters and custom clusters provisioned using Docker machine is not supported.
|
||||
|
||||
<figcaption>Compatible Cluster Types</figcaption>
|
||||
|
||||
| Cluster Type | Cloneable? |
|
||||
| -------------------------------- | ------------- |
|
||||
| [Hosted Kubernetes Providers][1] | ✓ |
|
||||
| [Nodes Hosted by IaaS][2] | ✓ |
|
||||
| [Custom Cluster][3] | |
|
||||
| [Imported Cluster][4] | |
|
||||
- Only [cluster types]({{< baseurl >}}/content/rancher/v2.x/en/cluster-provisioning) that interact with cloud hosts over API can be duplicated. Duplication of imported clusters and custom clusters provisioned using Docker machine is not supported.
|
||||
|
||||
|
||||
| Cluster Type | Cloneable? |
|
||||
| -------------------------------- | ------------- |
|
||||
| [Hosted Kubernetes Providers][1] | ✓ |
|
||||
| [Nodes Hosted by IaaS][2] | ✓ |
|
||||
| [Custom Cluster][3] | |
|
||||
| [Imported Cluster][4] | |
|
||||
|
||||
- During the process of duplicating a cluster, you will edit a config file full of cluster settings. However, we recommend editing only values explicitly listed in this document, as cluster duplication is designed for simple cluster copying, _not_ wide scale configuration changes. Editing other values may invalidate the config file, which will lead to cluster deployment failure.
|
||||
|
||||
[1]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/hosted-kubernetes-clusters/
|
||||
[2]: {{< baseurl >}}/rancher/v2.x/en/cluster-provisioning/rke-clusters/node-pools/
|
||||
@@ -57,27 +57,94 @@ Use your favorite text editor to modify the cluster configuration in `cluster-te
|
||||
|
||||
1. Open `cluster-template.yml` (or whatever you named your config) in your favorite test editor.
|
||||
|
||||
1. Change the name of your cluster (`<CLUSTER_NAME>`). If your cloned configuration has the same cluster name as its source, the cluster will not provision.
|
||||
>**Warning:** Only edit the cluster config values explicitly called out below. Many of the values listed in this file are used to provision your duplicate cluster, and editing their values may break the provisioning process.
|
||||
|
||||
```yml
|
||||
Version: v3
|
||||
clusters:
|
||||
<CLUSTER_NAME>: # CHANGE THIS NAME
|
||||
amazonElasticContainerServiceConfig:
|
||||
accessKey: 00000000000000000000
|
||||
associateWorkerNodePublicIp: true
|
||||
instanceType: t2.medium
|
||||
maximumNodes: 3
|
||||
minimumNodes: 1
|
||||
region: us-west-2
|
||||
secretKey: 0000000000000000000000000000000000000000
|
||||
dockerRootDir: /var/lib/docker
|
||||
enableNetworkPolicy: false
|
||||
|
||||
1. As depicted in one of the examples below, at the `<CLUSTER_NAME>` placeholder, replace your original cluster's name with a unique name (`<CLUSTER_NAME>`). If your cloned cluster has a duplicate name, the cluster will not provision successfully.
|
||||
{{% accordion id="gke" label="GKE" %}}
|
||||
```
|
||||
Version: v3
|
||||
clusters:
|
||||
<CLUSTER_NAME>: # ENTER UNIQUE NAME
|
||||
dockerRootDir: /var/lib/docker
|
||||
enableNetworkPolicy: false
|
||||
googleKubernetesEngineConfig:
|
||||
credential: |-
|
||||
{
|
||||
"type": "service_account",
|
||||
"project_id": "gke-cluster-221300",
|
||||
"private_key_id": "1d210afae352bc298bde1b3e680ec0c8b22cdd61"
|
||||
```
|
||||
{{% /accordion %}}
|
||||
{{% accordion id="eks" label="EKS" %}}
|
||||
```yml
|
||||
Version: v3
|
||||
clusters:
|
||||
<CLUSTER_NAME>: # ENTER UNIQUE NAME
|
||||
amazonElasticContainerServiceConfig:
|
||||
accessKey: 00000000000000000000
|
||||
associateWorkerNodePublicIp: true
|
||||
instanceType: t2.medium
|
||||
maximumNodes: 3
|
||||
minimumNodes: 1
|
||||
region: us-west-2
|
||||
secretKey: 0000000000000000000000000000000000000000
|
||||
dockerRootDir: /var/lib/docker
|
||||
enableNetworkPolicy: false
|
||||
```
|
||||
{{% /accordion %}}
|
||||
{{% accordion id="aks" label="AKS" %}}
|
||||
```yml
|
||||
Version: v3
|
||||
clusters:
|
||||
<CLUSTER_NAME>: # ENTER UNIQUE NAME
|
||||
azureKubernetesServiceConfig:
|
||||
adminUsername: azureuser
|
||||
agentPoolName: rancher
|
||||
agentVmSize: Standard_D5_v2
|
||||
clientId: 00000000-0000-0000-0000-000000000000
|
||||
clientSecret: 00000000000000000000000000000000000000000000
|
||||
count: 3
|
||||
kubernetesVersion: 1.11.2
|
||||
location: westus
|
||||
osDiskSizeGb: 100
|
||||
resourceGroup: docker-machine
|
||||
sshPublicKeyContents: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJc2kDExgRaDLD
|
||||
```
|
||||
{{% /accordion %}}
|
||||
{{% accordion id="ec2" label="IaaS Clusters (EC2, Azure, or DigitalOcean )" %}}
|
||||
```yml
|
||||
Version: v3
|
||||
clusters:
|
||||
<CLUSTER_NAME>: # ENTER UNIQUE NAME
|
||||
dockerRootDir: /var/lib/docker
|
||||
enableNetworkPolicy: false
|
||||
rancherKubernetesEngineConfig:
|
||||
addonJobTimeout: 30
|
||||
authentication:
|
||||
strategy: x509
|
||||
authorization: {}
|
||||
bastionHost: {}
|
||||
cloudProvider: {}
|
||||
ignoreDockerVersion: true
|
||||
```
|
||||
{{% /accordion %}}
|
||||
|
||||
1. **IaaS Clusters Only:** For each `nodePools` section, replace the original nodepool name with a unique name at the `<NODEPOOL_NAME>` placeholder. If your cloned cluster has a duplicate nodepool name, the cluster will not provision successfully.
|
||||
|
||||
```yml
|
||||
nodePools:
|
||||
<NODEPOOL_NAME>:
|
||||
clusterId: do
|
||||
controlPlane: true
|
||||
etcd: true
|
||||
hostnamePrefix: mark-do
|
||||
nodeTemplateId: do
|
||||
quantity: 1
|
||||
worker: true
|
||||
```
|
||||
|
||||
1. Edit any other configuration values to customize the cloned cluster. Save the configuration when you're done.
|
||||
|
||||
For information on how to make these edits, see the official [Kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).
|
||||
1. When you're done, save and close the configuration.
|
||||
|
||||
## 3. Launch Duplicate Cluster
|
||||
|
||||
|
||||
Reference in New Issue
Block a user