├── .github └── workflows │ ├── pr.yaml │ └── release.yml ├── .gitignore ├── Dockerfile.dapper ├── LICENSE ├── Makefile ├── README.md └── charts ├── rancher-aws-cluster-template ├── Chart.yaml ├── README.md ├── questions.yaml ├── templates │ ├── cluster.yaml │ ├── nodeconfig-controlplane.yaml │ └── nodeconfig-worker.yaml └── values.yaml ├── rancher-do-cluster-template ├── Chart.yaml ├── questions.yaml ├── templates │ ├── cluster.yaml │ └── nodeconfig.yaml └── values.yaml └── rancher-equinix-cluster-template ├── Chart.yaml ├── README.md ├── questions.yaml ├── templates ├── cluster.yaml ├── clusterroletemplatebinding.yaml └── nodeconfig.yaml └── values.yaml /.github/workflows/pr.yaml: -------------------------------------------------------------------------------- 1 | name: Lint and Test Charts 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | lint-test: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout 10 | uses: actions/checkout@v2 11 | with: 12 | fetch-depth: 0 13 | 14 | - name: Set up Helm 15 | uses: azure/setup-helm@v1 16 | with: 17 | version: v3.5.4 18 | 19 | - uses: actions/setup-python@v2 20 | with: 21 | python-version: 3.7 22 | 23 | - name: Set up chart-testing 24 | uses: helm/chart-testing-action@v2.0.1 25 | 26 | - name: Run chart-testing (list-changed) 27 | id: list-changed 28 | run: | 29 | changed=$(ct list-changed) 30 | if [[ -n "$changed" ]]; then 31 | echo "::set-output name=changed::true" 32 | fi 33 | 34 | - name: Run chart-testing (lint) 35 | run: ct lint 36 | # 37 | # - name: Create kind cluster 38 | # uses: helm/kind-action@v1.0.0 39 | # if: steps.list-changed.outputs.changed == 'true' 40 | # 41 | # - name: Run chart-testing (install) 42 | # run: ct install -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Charts 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | 17 | - name: Configure Git 18 | run: | 19 | git config user.name "$GITHUB_ACTOR" 20 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 21 | 22 | - name: Install Helm 23 | uses: azure/setup-helm@v1 24 | with: 25 | version: v3.5.4 26 | 27 | - name: Run chart-releaser 28 | uses: helm/chart-releaser-action@v1.2.1 29 | env: 30 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 31 | 32 | - uses: actions/checkout@v2 33 | with: 34 | ref: gh-pages 35 | 36 | - name: Setup Go 37 | uses: actions/setup-go@v2 38 | with: 39 | go-version: 1.17 40 | 41 | - name: Generate index.html 42 | run: | 43 | go install github.com/halkeye/helm-repo-html@v0.0.8 44 | /home/runner/go/bin/helm-repo-html 45 | 46 | - uses: stefanzweifel/git-auto-commit-action@v4 47 | with: 48 | commit_message: "Update index.html" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project Files 2 | ########### 3 | 4 | 5 | # Compiled source # 6 | ################### 7 | *.com 8 | *.class 9 | *.dll 10 | *.exe 11 | *.o 12 | *.so 13 | *.pyc 14 | 15 | # Packages # 16 | ############ 17 | # it's better to unpack these files and commit the raw source 18 | # git has its own built in compression methods 19 | *.7z 20 | *.dmg 21 | *.gz 22 | *.iso 23 | *.jar 24 | *.rar 25 | *.tar 26 | *.zip 27 | 28 | # Logs and databases # 29 | ###################### 30 | *.log 31 | *.sql 32 | *.sqlite 33 | 34 | # OS generated files # 35 | ###################### 36 | .DS_Store 37 | .DS_Store? 38 | ._* 39 | .Spotlight-V100 40 | .Trashes 41 | ehthumbs.db 42 | Thumbs.db 43 | *.swp 44 | 45 | # Sublime Text 46 | ############ 47 | *.sublime-workspace 48 | 49 | # Virtualenv 50 | ########## 51 | venv/ 52 | 53 | # Other 54 | ######## 55 | *.bak 56 | .vagrant 57 | 58 | -------------------------------------------------------------------------------- /Dockerfile.dapper: -------------------------------------------------------------------------------- 1 | FROM quay.io/helmpack/chart-testing:latest 2 | 3 | RUN apk add make 4 | 5 | ENV DAPPER_SOURCE /repo 6 | WORKDIR ${DAPPER_SOURCE} 7 | 8 | ENTRYPOINT ["make"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | lint: 2 | ct lint 3 | 4 | install: 5 | ct install 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rancher-cluster-templates 2 | 3 | Rancher Cluster Templates to provision RKE2 Kubernetes clusters 4 | 5 | ## How to Use 6 | 7 | * Go to the Apps Marketplace in the `local` cluster in Rancher 8 | * Add a new Chart Repository to the HTTP(S) URL `https://bashofmann.github.io/rancher-cluster-templates` without authentication 9 | * For Equinix clusters: Activate the Equinix Metal Node Driver 10 | -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: rancher-aws-cluster-template 3 | description: RKE2 Cluster template for AWS 4 | version: 0.2.1 5 | icon: https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Amazon_Web_Services_Logo.svg/512px-Amazon_Web_Services_Logo.svg.png 6 | annotations: 7 | catalog.cattle.io/type: cluster-template 8 | catalog.cattle.io/namespace: fleet-default -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/README.md: -------------------------------------------------------------------------------- 1 | # RKE2 Cluster template for AWS 2 | 3 | Helm chart that can be used as RKE2 cluster template in Rancher to provision clusters easily on AWS. 4 | -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/questions.yaml: -------------------------------------------------------------------------------- 1 | questions: 2 | - variable: cluster.name 3 | description: "Specify the name of the cluster" 4 | label: "Cluster Name" 5 | required: true 6 | type: string 7 | group: "General" 8 | - variable: cloudCredentialSecretName 9 | description: "CloudCredentialName for provisioning cluster" 10 | label: "CloudCredential Name" 11 | type: cloudcredential 12 | group: "General" -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/templates/cluster.yaml: -------------------------------------------------------------------------------- 1 | {{- $clustername := .Values.cluster.name }} 2 | apiVersion: provisioning.cattle.io/v1 3 | kind: Cluster 4 | metadata: 5 | {{- if .Values.cluster.labels }} 6 | labels: 7 | {{ toYaml .Values.cluster.labels | indent 4 }} 8 | {{- end }} 9 | {{- if .Values.cluster.annotations }} 10 | annotations: 11 | {{ toYaml .Values.cluster.annotations | indent 4 }} 12 | {{- end }} 13 | name: {{ $clustername }} 14 | namespace: fleet-default 15 | spec: 16 | {{- if .Values.cloudCredentialSecretName }} 17 | cloudCredentialSecretName: {{ .Values.cloudCredentialSecretName }} 18 | {{- end }} 19 | kubernetesVersion: v1.22.6+rke2r1 20 | rkeConfig: 21 | machinePools: 22 | - controlPlaneRole: true 23 | etcdRole: true 24 | workerRole: false 25 | quantity: 3 26 | name: {{ $clustername }}-controlplane 27 | machineConfigRef: 28 | kind: Amazonec2Config 29 | name: {{ $clustername }}-controlplane 30 | paused: false 31 | displayName: {{ $clustername }}-controlplane 32 | - controlPlaneRole: false 33 | etcdRole: false 34 | workerRole: true 35 | quantity: 2 36 | name: {{ $clustername }}-worker 37 | machineConfigRef: 38 | kind: Amazonec2Config 39 | name: {{ $clustername }}-worker 40 | paused: false 41 | displayName: {{ $clustername }}-worker 42 | machineGlobalConfig: 43 | cni: calico 44 | -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/templates/nodeconfig-controlplane.yaml: -------------------------------------------------------------------------------- 1 | {{- $clustername := .Values.cluster.name }} 2 | apiVersion: rke-machine-config.cattle.io/v1 3 | kind: Amazonec2Config 4 | metadata: 5 | name: {{ $clustername }}-controlplane 6 | namespace: fleet-default 7 | instanceType: t3a.medium 8 | region: eu-central-1 9 | subnetId: subnet-0984ae232db1d4391 10 | vpcId: vpc-0c7c6085a97724ca9 11 | zone: a 12 | sshUser: ubuntu 13 | -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/templates/nodeconfig-worker.yaml: -------------------------------------------------------------------------------- 1 | {{- $clustername := .Values.cluster.name }} 2 | apiVersion: rke-machine-config.cattle.io/v1 3 | kind: Amazonec2Config 4 | metadata: 5 | name: {{ $clustername }}-worker 6 | namespace: fleet-default 7 | instanceType: t3a.large 8 | region: eu-central-1 9 | subnetId: subnet-0984ae232db1d4391 10 | vpcId: vpc-0c7c6085a97724ca9 11 | zone: a 12 | sshUser: ubuntu 13 | -------------------------------------------------------------------------------- /charts/rancher-aws-cluster-template/values.yaml: -------------------------------------------------------------------------------- 1 | # cluster specific values 2 | cluster: 3 | # specify cluster name 4 | name: aws-cluster 5 | 6 | # specify cluster labels 7 | labels: {} 8 | 9 | # specify cluster annotations 10 | annotations: {} 11 | 12 | # specify cloud credential secret name, do not need to be provided if using custom driver 13 | cloudCredentialSecretName: "" 14 | 15 | -------------------------------------------------------------------------------- /charts/rancher-do-cluster-template/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: rancher-do-cluster-template 3 | description: RKE2 Cluster template for DO 4 | version: 0.3.1 5 | annotations: 6 | catalog.cattle.io/type: cluster-template 7 | catalog.cattle.io/namespace: fleet-default -------------------------------------------------------------------------------- /charts/rancher-do-cluster-template/questions.yaml: -------------------------------------------------------------------------------- 1 | questions: 2 | - variable: cluster.name 3 | description: "Specify the name of the cluster" 4 | label: "Cluster Name" 5 | required: true 6 | type: string 7 | group: "General" 8 | - variable: cloudCredentialSecretName 9 | description: "CloudCredentialName for provisioning cluster" 10 | label: "CloudCredential Name" 11 | type: cloudcredential 12 | group: "General" 13 | - variable: nodepool.size 14 | label: "VM Size" 15 | type: enum 16 | options: 17 | - s-2vcpu-4gb 18 | - s-4vcpu-8gb 19 | - s-6vcpu-16gb 20 | description: "Size of each VM" 21 | group: "Nodepools" 22 | - variable: nodepool.count 23 | description: "Specify node count" 24 | type: int 25 | required: true 26 | label: "Node count" 27 | group: "Nodepools" -------------------------------------------------------------------------------- /charts/rancher-do-cluster-template/templates/cluster.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: provisioning.cattle.io/v1 2 | kind: Cluster 3 | metadata: 4 | name: {{ .Values.cluster.name }} 5 | namespace: fleet-default 6 | spec: 7 | {{- if .Values.cloudCredentialSecretName }} 8 | cloudCredentialSecretName: {{ .Values.cloudCredentialSecretName }} 9 | {{- end }} 10 | kubernetesVersion: v1.21.10+rke2r1 11 | rkeConfig: 12 | machinePools: 13 | - controlPlaneRole: true 14 | etcdRole: true 15 | workerRole: true 16 | quantity: {{ .Values.nodepool.count }} 17 | name: {{ .Values.cluster.name }}-nodes 18 | machineConfigRef: 19 | kind: DigitaloceanConfig 20 | name: {{ .Values.cluster.name }}-nodes 21 | paused: false 22 | displayName: {{ .Values.cluster.name }}-nodes 23 | machineGlobalConfig: 24 | cni: calico 25 | -------------------------------------------------------------------------------- /charts/rancher-do-cluster-template/templates/nodeconfig.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rke-machine-config.cattle.io/v1 2 | kind: DigitaloceanConfig 3 | metadata: 4 | name: {{ .Values.cluster.name }}-nodes 5 | namespace: fleet-default 6 | region: fra1 7 | size: {{ .Values.nodepool.size }} 8 | sshUser: root 9 | image: ubuntu-20-04-x64 10 | -------------------------------------------------------------------------------- /charts/rancher-do-cluster-template/values.yaml: -------------------------------------------------------------------------------- 1 | cluster: 2 | name: do-cluster 3 | 4 | cloudCredentialSecretName: "" 5 | 6 | nodepool: 7 | size: s-2vcpu-4gb 8 | count: 1 -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: rancher-equinix-cluster-template 3 | description: RKE2 Cluster template for Equinix Metal 4 | version: 0.1.3 5 | icon: https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Equinix_logo.svg/1024px-Equinix_logo.svg.png 6 | annotations: 7 | catalog.cattle.io/type: cluster-template 8 | catalog.cattle.io/namespace: fleet-default -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/README.md: -------------------------------------------------------------------------------- 1 | # RKE2 Cluster template for Equinix Metal 2 | 3 | Helm chart that can be used as RKE2 cluster template in Rancher to provision clusters easily on Equinix Metal. 4 | 5 | The Equinix Metal Node Driver must be activated. 6 | -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/questions.yaml: -------------------------------------------------------------------------------- 1 | questions: 2 | - variable: cluster.name 3 | default: equinix-cluster 4 | description: "Specify the name of the cluster" 5 | label: "Cluster Name" 6 | required: true 7 | type: string 8 | group: "General" 9 | - variable: cloudCredentialSecretName 10 | default: 11 | description: "CloudCredentialName for provisioning cluster" 12 | label: "CloudCredential Name" 13 | type: cloudcredential 14 | group: "General" 15 | - variable: kubernetesVersion 16 | default: v1.21.3-rc5+rke2r2 17 | description: "Specify Kubernetes version" 18 | label: "Kubernetes Version" 19 | type: enum 20 | required: true 21 | options: 22 | - v1.21.5+rke2r2 23 | - v1.21.6+rke2r1 24 | group: "General" 25 | - variable: rke.localClusterAuthEndpoint.enabled 26 | default: false 27 | label: "Local Auth endpoint" 28 | description: "Enable local auth access endpoint" 29 | type: boolean 30 | group: "Auth Access Endpoint" 31 | show_subquestion_if: true 32 | subquestions: 33 | - variable: rke.localClusterAuthEndpoint.fqdn 34 | default: 35 | description: "Local auth access endpoint FQDN" 36 | label: "Auth Endpoint FQDN" 37 | type: hostname 38 | group: "Auth Access Endpoint" 39 | - variable: rke.localClusterAuthEndpoint.caCerts 40 | default: 41 | label: "Auth Endpoint Cacerts" 42 | description: "Local auth access endpoint CACerts" 43 | type: multiline 44 | group: "Auth Access Endpoint" 45 | - variable: nodepools.0.name 46 | default: 47 | description: "Specify nodepool name" 48 | type: string 49 | label: "Nodepool name" 50 | required: true 51 | group: "Nodepools" 52 | - variable: nodepools.0.quantity 53 | default: 1 54 | description: "Specify node count" 55 | type: int 56 | required: true 57 | label: "Node count" 58 | group: "Nodepools" 59 | - variable: nodepools.0.etcd 60 | default: true 61 | label: etcd 62 | type: boolean 63 | group: "Nodepools" 64 | - variable: nodepools.0.worker 65 | default: true 66 | label: worker 67 | type: boolean 68 | group: "Nodepools" 69 | - variable: nodepools.0.controlplane 70 | label: controlplane 71 | default: true 72 | type: boolean 73 | group: "Nodepools" 74 | - variable: nodepools.0.billingCycle 75 | label: "Billing Cycle" 76 | default: "hourly" 77 | type: enum 78 | options: 79 | - hourly 80 | - daily 81 | - weekly 82 | description: "Billing cycle for VMs" 83 | group: "Nodepools" 84 | - variable: nodepools.0.facilityCode 85 | label: "Equinix Facility" 86 | default: "am6" 87 | type: enum 88 | options: 89 | - am6 90 | - fr2 91 | - dc13 92 | - sv15 93 | description: "Datacenter to deploy VMs in" 94 | group: "Nodepools" 95 | - variable: nodepools.0.hwReservationId 96 | label: "Hardware reservation ID" 97 | default: "" 98 | type: string 99 | description: "ID of reserved Hardware instance" 100 | group: "Nodepools" 101 | - variable: nodepools.0.os 102 | label: "OS" 103 | default: "ubuntu_20_04" 104 | type: enum 105 | options: 106 | - ubuntu_20_04 107 | - ubuntu_20_10 108 | - centos_8 109 | description: "VM Operating System" 110 | group: "Nodepools" 111 | - variable: nodepools.0.plan 112 | label: "VM Plan" 113 | default: "c3.small.x86" 114 | type: enum 115 | options: 116 | - c3.small.x86 117 | - c3.medium.x86 118 | description: "Size ov VMs" 119 | group: "Nodepools" 120 | - variable: nodepools.0.projectId 121 | label: "Project ID" 122 | default: "" 123 | type: string 124 | description: "Equinix Project ID" 125 | group: "Nodepools" 126 | - variable: nodepools.0.spotInstance 127 | label: "Use Spot Instance" 128 | default: false 129 | type: boolean 130 | description: "Use spot instances" 131 | group: "Nodepools" 132 | - variable: nodepools.0.spotPriceMax 133 | label: "Max Sport Price" 134 | default: "" 135 | type: string 136 | description: "Maximum VM price for spot instances" 137 | group: "Nodepools" 138 | - variable: nodepools.0.terminationTime 139 | label: "Termination Time" 140 | default: "" 141 | type: string 142 | description: "Termination time for instance" 143 | group: "Nodepools" 144 | - variable: nodepools.0.userdata 145 | label: "User Data" 146 | default: "" 147 | type: multiline 148 | description: "cloud-init user data fro VM" 149 | group: "Nodepools" 150 | -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/templates/cluster.yaml: -------------------------------------------------------------------------------- 1 | {{- $clustername := .Values.cluster.name }} 2 | apiVersion: provisioning.cattle.io/v1 3 | kind: Cluster 4 | metadata: 5 | {{- if .Values.cluster.labels }} 6 | labels: 7 | {{ toYaml .Values.cluster.labels | indent 4 }} 8 | {{- end }} 9 | {{- if .Values.cluster.annotations }} 10 | annotations: 11 | {{ toYaml .Values.cluster.annotations | indent 4 }} 12 | {{- end }} 13 | name: {{ .Values.cluster.name }} 14 | namespace: fleet-default 15 | spec: 16 | {{- if .Values.cloudCredentialSecretName }} 17 | cloudCredentialSecretName: {{ .Values.cloudCredentialSecretName }} 18 | {{- end }} 19 | {{- if .Values.kubernetesVersion }} 20 | kubernetesVersion: {{ .Values.kubernetesVersion }} 21 | {{- end }} 22 | rkeConfig: 23 | machinePools: 24 | {{- if .Values.nodepools }} {{ range $index, $nodepool := .Values.nodepools }} 25 | - controlPlaneRole: {{ $nodepool.controlplane }} 26 | etcdRole: {{ $nodepool.etcd }} 27 | workerRole: {{ $nodepool.worker }} 28 | quantity: {{ $nodepool.quantity }} 29 | name: {{ $clustername }}-{{ $nodepool.name }} 30 | machineConfigRef: 31 | kind: PacketConfig 32 | name: {{ $clustername }}-{{ $nodepool.name }} 33 | paused: false 34 | displayName: {{ $nodepool.displayName }} 35 | {{- if $nodepool.machineDeploymentLabels }} 36 | machineDeploymentLabels: 37 | {{ toYaml $nodepool.machineDeploymentLabels | indent 8 }} 38 | {{- end }} 39 | {{- if $nodepool.machineDeploymentAnnotations }} 40 | machineDeploymentAnnotations: 41 | {{ toYaml $nodepool.machineDeploymentAnnotations | indent 8 }} 42 | {{- end }} 43 | {{- end }} 44 | {{- end }} 45 | machineGlobalConfig: 46 | cni: calico 47 | {{- if .Values.rke.localClusterAuthEndpoint.enabled }} 48 | localClusterAuthEndpoint: 49 | enabled: {{ .Values.rke.localClusterAuthEndpoint.enabled }} 50 | fqdn: {{ .Values.rke.localClusterAuthEndpoint.fqdn }} 51 | caCerts: {{ .Values.rke.localClusterAuthEndpoint.caCerts }} 52 | {{- end }} 53 | upgradeStrategy: 54 | controlPlaneDrainOptions: 55 | enabled: false 56 | workerDrainOptions: 57 | enabled: false 58 | workerConcurrency: "10%" 59 | controlPlaneConcurrency: "10%" 60 | {{- if .Values.agentEnvs }} 61 | agentEnvVars: 62 | {{ toYaml .Values.agentEnvs | indent 4 }} 63 | {{- end }} -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/templates/clusterroletemplatebinding.yaml: -------------------------------------------------------------------------------- 1 | {{ $root := . }} 2 | {{- range $index, $member := .Values.clusterMembers }} 3 | apiVersion: management.cattle.io/v3 4 | clusterName: c-m-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $root.Values.cluster.name)) }} 5 | kind: ClusterRoleTemplateBinding 6 | metadata: 7 | name: ctrb-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $member.principalName )) }} 8 | namespace: c-m-{{ trunc 8 (sha256sum (printf "%s/%s" $root.Release.Namespace $root.Values.cluster.name)) }} 9 | roleTemplateName: {{ $member.roleTemplateName }} 10 | userPrincipalName: {{ $member.principalName }} 11 | {{- end }} -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/templates/nodeconfig.yaml: -------------------------------------------------------------------------------- 1 | {{- $clustername := .Values.cluster.name }} 2 | {{- range $index, $nodepool := .Values.nodepools }} 3 | apiVersion: rke-machine-config.cattle.io/v1 4 | kind: PacketConfig 5 | metadata: 6 | name: {{ $clustername }}-{{ $nodepool.name }} 7 | namespace: fleet-default 8 | {{- if $nodepool.billingCycle }} 9 | billingCycle: {{ $nodepool.billingCycle }} 10 | {{- end }} 11 | {{- if $nodepool.facilityCode }} 12 | facilityCode: {{ $nodepool.facilityCode }} 13 | {{- end }} 14 | {{- if $nodepool.hwReservationId }} 15 | hwReservationId: {{ $nodepool.hwReservationId }} 16 | {{- end }} 17 | {{- if $nodepool.os }} 18 | os: {{ $nodepool.os }} 19 | {{- end }} 20 | {{- if $nodepool.plan }} 21 | plan: {{ $nodepool.plan }} 22 | {{- end }} 23 | {{- if $nodepool.projectId }} 24 | projectId: {{ $nodepool.projectId }} 25 | {{- end }} 26 | {{- if $nodepool.spotInstance }} 27 | spotInstance: {{ $nodepool.spotInstance }} 28 | {{- end }} 29 | {{- if $nodepool.spotPriceMax }} 30 | spotPriceMax: {{ $nodepool.spotPriceMax }} 31 | {{- end }} 32 | {{- if $nodepool.terminationTime }} 33 | terminationTime: {{ $nodepool.terminationTime }} 34 | {{- end }} 35 | {{- if $nodepool.userdata }} 36 | userdata: {{ $nodepool.userdata }} 37 | {{- end }} 38 | common: 39 | {{- if $nodepool.labels }} 40 | labels: 41 | {{ toYaml $nodepool.labels | indent 4 }} 42 | {{- end }} 43 | {{- if $nodepool.taints }} 44 | taints: 45 | {{ toYaml $nodepool.taints | indent 4 }} 46 | {{- end }} 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /charts/rancher-equinix-cluster-template/values.yaml: -------------------------------------------------------------------------------- 1 | # cluster specific values 2 | cluster: 3 | # specify cluster name 4 | name: equinix-cluster 5 | 6 | # specify cluster labels 7 | labels: {} 8 | 9 | # specify cluster annotations 10 | annotations: {} 11 | 12 | # specify cloud credential secret name, do not need to be provided if using custom driver 13 | cloudCredentialSecretName: "" 14 | 15 | kubernetesVersion: "" 16 | 17 | # general RKE options 18 | rke: 19 | # enable local auth endpoint 20 | localClusterAuthEndpoint: 21 | enabled: false 22 | # specify fqdn of local access endpoint 23 | fqdn: "" 24 | # specify cacert of local access endpoint 25 | caCerts: "" 26 | 27 | # specify user principal ids to be assiged as cluster members 28 | # clusterMembers: 29 | # - principalName: "local://u-z8zl5" 30 | # roleTemplateName: "cluster-member" 31 | 32 | # Specify nodepool options. Can add multiple node groups, specify etcd, controlplane and worker roles. 33 | nodepools: 34 | - etcd: true 35 | controlplane: true 36 | worker: true 37 | 38 | # specify node labels 39 | labels: {} 40 | 41 | # specify node taints 42 | taints: {} 43 | 44 | # specify nodepool size 45 | quantity: 1 46 | 47 | # specify displayName 48 | displayName: "" 49 | 50 | # specify nodepool name 51 | name: equinix-nodepool-1 52 | 53 | billingCycle: hourly 54 | facilityCode: am6 55 | hwReservationId: "" 56 | os: ubuntu_20_04 57 | plan: c3.small.x86 58 | projectId: "" 59 | spotInstance: false 60 | spotPriceMax: "" 61 | terminationTime: "" 62 | userdata: "" 63 | machineDeploymentLabels: {} 64 | machineDeploymentAnnotations: {} 65 | 66 | agentEnvs: [] --------------------------------------------------------------------------------