|
| 1 | +--- |
| 2 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 3 | +kind: ClusterClass |
| 4 | +metadata: |
| 5 | + name: quick-start |
| 6 | +spec: |
| 7 | + controlPlane: |
| 8 | + ref: |
| 9 | + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 10 | + kind: KubeadmControlPlaneTemplate |
| 11 | + name: quick-start-control-plane |
| 12 | + machineInfrastructure: |
| 13 | + ref: |
| 14 | + kind: GCPMachineTemplate |
| 15 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 16 | + name: quick-start-control-plane |
| 17 | + infrastructure: |
| 18 | + ref: |
| 19 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 20 | + kind: GCPClusterTemplate |
| 21 | + name: quick-start |
| 22 | + workers: |
| 23 | + machineDeployments: |
| 24 | + - class: default-worker |
| 25 | + template: |
| 26 | + bootstrap: |
| 27 | + ref: |
| 28 | + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 |
| 29 | + kind: KubeadmConfigTemplate |
| 30 | + name: quick-start-worker-bootstraptemplate |
| 31 | + infrastructure: |
| 32 | + ref: |
| 33 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 34 | + kind: GCPMachineTemplate |
| 35 | + name: quick-start-worker-machinetemplate |
| 36 | + variables: |
| 37 | + - name: region |
| 38 | + required: true |
| 39 | + schema: |
| 40 | + openAPIV3Schema: |
| 41 | + type: string |
| 42 | + default: us-west1 |
| 43 | + - name: controlPlaneMachineType |
| 44 | + required: true |
| 45 | + schema: |
| 46 | + openAPIV3Schema: |
| 47 | + type: string |
| 48 | + default: n1-standard-2 |
| 49 | + - name: workerMachineType |
| 50 | + required: true |
| 51 | + schema: |
| 52 | + openAPIV3Schema: |
| 53 | + type: string |
| 54 | + default: n1-standard-2 |
| 55 | + patches: |
| 56 | + - name: region |
| 57 | + definitions: |
| 58 | + - selector: |
| 59 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 60 | + kind: GCPClusterTemplate |
| 61 | + matchResources: |
| 62 | + infrastructureCluster: true |
| 63 | + jsonPatches: |
| 64 | + - op: add |
| 65 | + path: /spec/template/spec/region |
| 66 | + valueFrom: |
| 67 | + variable: region |
| 68 | + - name: controlPlaneMachineType |
| 69 | + definitions: |
| 70 | + - selector: |
| 71 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 72 | + kind: GCPMachineTemplate |
| 73 | + matchResources: |
| 74 | + controlPlane: true |
| 75 | + jsonPatches: |
| 76 | + - op: replace |
| 77 | + path: /spec/template/spec/instanceType |
| 78 | + valueFrom: |
| 79 | + variable: controlPlaneMachineType |
| 80 | + - name: workerMachineType |
| 81 | + definitions: |
| 82 | + - selector: |
| 83 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 84 | + kind: GCPMachineTemplate |
| 85 | + matchResources: |
| 86 | + machineDeploymentClass: |
| 87 | + names: |
| 88 | + - default-worker |
| 89 | + jsonPatches: |
| 90 | + - op: replace |
| 91 | + path: /spec/template/spec/instanceType |
| 92 | + valueFrom: |
| 93 | + variable: workerMachineType |
| 94 | +--- |
| 95 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 96 | +kind: GCPClusterTemplate |
| 97 | +metadata: |
| 98 | + name: quick-start |
| 99 | +spec: |
| 100 | + template: |
| 101 | + spec: |
| 102 | + project: "${GCP_PROJECT}" |
| 103 | + region: "${GCP_REGION}" |
| 104 | + network: |
| 105 | + name: "${GCP_NETWORK_NAME}" |
| 106 | +--- |
| 107 | +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 108 | +kind: KubeadmControlPlaneTemplate |
| 109 | +metadata: |
| 110 | + name: quick-start-control-plane |
| 111 | +spec: |
| 112 | + template: |
| 113 | + spec: |
| 114 | + kubeadmConfigSpec: |
| 115 | + useExperimentalRetryJoin: true |
| 116 | + initConfiguration: |
| 117 | + nodeRegistration: |
| 118 | + name: '{{ ds.meta_data.local_hostname.split(".")[0] }}' |
| 119 | + kubeletExtraArgs: |
| 120 | + cloud-provider: gce |
| 121 | + clusterConfiguration: |
| 122 | + apiServer: |
| 123 | + timeoutForControlPlane: 20m |
| 124 | + extraArgs: |
| 125 | + cloud-provider: gce |
| 126 | + controllerManager: |
| 127 | + extraArgs: |
| 128 | + cloud-provider: gce |
| 129 | + allocate-node-cidrs: "false" |
| 130 | + joinConfiguration: |
| 131 | + nodeRegistration: |
| 132 | + name: '{{ ds.meta_data.local_hostname.split(".")[0] }}' |
| 133 | + kubeletExtraArgs: |
| 134 | + cloud-provider: gce |
| 135 | +--- |
| 136 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 137 | +kind: GCPMachineTemplate |
| 138 | +metadata: |
| 139 | + name: quick-start-control-plane |
| 140 | +spec: |
| 141 | + template: |
| 142 | + spec: |
| 143 | + instanceType: REPLACEME |
| 144 | + image: "${IMAGE_ID}" |
| 145 | +--- |
| 146 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 147 | +kind: GCPMachineTemplate |
| 148 | +metadata: |
| 149 | + name: quick-start-worker-machinetemplate |
| 150 | +spec: |
| 151 | + template: |
| 152 | + spec: |
| 153 | + instanceType: REPLACEME |
| 154 | + image: "${IMAGE_ID}" |
| 155 | +--- |
| 156 | +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 |
| 157 | +kind: KubeadmConfigTemplate |
| 158 | +metadata: |
| 159 | + name: quick-start-worker-bootstraptemplate |
| 160 | +spec: |
| 161 | + template: |
| 162 | + spec: |
| 163 | + joinConfiguration: |
| 164 | + nodeRegistration: |
| 165 | + name: '{{ ds.meta_data.local_hostname.split(".")[0] }}' |
| 166 | + kubeletExtraArgs: |
| 167 | + cloud-provider: gce |
| 168 | +--- |
| 169 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 170 | +kind: Cluster |
| 171 | +metadata: |
| 172 | + name: "${CLUSTER_NAME}" |
| 173 | + labels: |
| 174 | + cni: "${CLUSTER_NAME}-crs-cni" |
| 175 | +spec: |
| 176 | + clusterNetwork: |
| 177 | + pods: |
| 178 | + cidrBlocks: ["192.168.0.0/16"] |
| 179 | + topology: |
| 180 | + class: quick-start |
| 181 | + version: "${KUBERNETES_VERSION}" |
| 182 | + controlPlane: |
| 183 | + replicas: ${CONTROL_PLANE_MACHINE_COUNT} |
| 184 | + workers: |
| 185 | + machineDeployments: |
| 186 | + - class: "default-worker" |
| 187 | + name: "md-0" |
| 188 | + replicas: ${WORKER_MACHINE_COUNT} |
| 189 | + variables: |
| 190 | + - name: region |
| 191 | + value: ${GCP_REGION} |
| 192 | + - name: controlPlaneMachineType |
| 193 | + value: ${GCP_CONTROL_PLANE_MACHINE_TYPE} |
| 194 | + - name: workerMachineType |
| 195 | + value: ${GCP_NODE_MACHINE_TYPE} |
| 196 | +--- |
| 197 | +apiVersion: v1 |
| 198 | +kind: ConfigMap |
| 199 | +metadata: |
| 200 | + name: "${CLUSTER_NAME}-crs-cni" |
| 201 | +data: ${CNI_RESOURCES} |
| 202 | +--- |
| 203 | +apiVersion: addons.cluster.x-k8s.io/v1beta1 |
| 204 | +kind: ClusterResourceSet |
| 205 | +metadata: |
| 206 | + name: "${CLUSTER_NAME}-crs-cni" |
| 207 | +spec: |
| 208 | + strategy: ApplyOnce |
| 209 | + clusterSelector: |
| 210 | + matchLabels: |
| 211 | + cni: "${CLUSTER_NAME}-crs-cni" |
| 212 | + resources: |
| 213 | + - name: "${CLUSTER_NAME}-crs-cni" |
| 214 | + kind: ConfigMap |
0 commit comments