|
| 1 | +--- |
| 2 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 3 | +kind: ClusterClass |
| 4 | +metadata: |
| 5 | + name: ${CLUSTER_CLASS_NAME} |
| 6 | +spec: |
| 7 | + controlPlane: |
| 8 | + ref: |
| 9 | + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 10 | + kind: KubeadmControlPlaneTemplate |
| 11 | + name: ${CLUSTER_CLASS_NAME}-control-plane |
| 12 | + machineInfrastructure: |
| 13 | + ref: |
| 14 | + kind: GCPMachineTemplate |
| 15 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 16 | + name: ${CLUSTER_CLASS_NAME}-control-plane |
| 17 | + infrastructure: |
| 18 | + ref: |
| 19 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 20 | + kind: GCPClusterTemplate |
| 21 | + name: ${CLUSTER_CLASS_NAME} |
| 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: ${CLUSTER_CLASS_NAME}-worker-bootstraptemplate |
| 31 | + infrastructure: |
| 32 | + ref: |
| 33 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 34 | + kind: GCPMachineTemplate |
| 35 | + name: ${CLUSTER_CLASS_NAME}-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: ${CLUSTER_CLASS_NAME} |
| 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: ${CLUSTER_CLASS_NAME}-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: ${CLUSTER_CLASS_NAME}-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: ${CLUSTER_CLASS_NAME}-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: ${CLUSTER_CLASS_NAME}-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 |
0 commit comments