|
| 1 | +--- |
| 2 | +apiVersion: cluster.x-k8s.io/v1alpha4 |
| 3 | +kind: Cluster |
| 4 | +metadata: |
| 5 | + name: ${CLUSTER_NAME} |
| 6 | + labels: |
| 7 | + cni: "${CLUSTER_NAME}-crs-0" |
| 8 | +spec: |
| 9 | + clusterNetwork: |
| 10 | + pods: |
| 11 | + cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. |
| 12 | + serviceDomain: "cluster.local" |
| 13 | + infrastructureRef: |
| 14 | + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 15 | + kind: OpenStackCluster |
| 16 | + name: ${CLUSTER_NAME} |
| 17 | + controlPlaneRef: |
| 18 | + kind: KubeadmControlPlane |
| 19 | + apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 |
| 20 | + name: ${CLUSTER_NAME}-control-plane |
| 21 | +--- |
| 22 | +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 23 | +kind: OpenStackCluster |
| 24 | +metadata: |
| 25 | + name: ${CLUSTER_NAME} |
| 26 | +spec: |
| 27 | + cloudName: ${OPENSTACK_CLOUD} |
| 28 | + identityRef: |
| 29 | + name: ${CLUSTER_NAME}-cloud-config |
| 30 | + kind: Secret |
| 31 | + managedAPIServerLoadBalancer: true |
| 32 | + managedSecurityGroups: true |
| 33 | + nodeCidr: 10.6.0.0/24 |
| 34 | + dnsNameservers: |
| 35 | + - ${OPENSTACK_DNS_NAMESERVERS} |
| 36 | + bastion: |
| 37 | + enabled: true |
| 38 | + instance: |
| 39 | + flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR} |
| 40 | + image: ${OPENSTACK_BASTION_IMAGE_NAME} |
| 41 | + sshKeyName: ${OPENSTACK_SSH_KEY_NAME} |
| 42 | + externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID} |
| 43 | +--- |
| 44 | +kind: KubeadmControlPlane |
| 45 | +apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 |
| 46 | +metadata: |
| 47 | + name: "${CLUSTER_NAME}-control-plane" |
| 48 | +spec: |
| 49 | + replicas: ${CONTROL_PLANE_MACHINE_COUNT} |
| 50 | + machineTemplate: |
| 51 | + infrastructureRef: |
| 52 | + kind: OpenStackMachineTemplate |
| 53 | + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 54 | + name: "${CLUSTER_NAME}-control-plane" |
| 55 | + kubeadmConfigSpec: |
| 56 | + initConfiguration: |
| 57 | + nodeRegistration: |
| 58 | + name: '{{ local_hostname }}' |
| 59 | + kubeletExtraArgs: |
| 60 | + cloud-provider: openstack |
| 61 | + cloud-config: /etc/kubernetes/cloud.conf |
| 62 | + clusterConfiguration: |
| 63 | + imageRepository: k8s.gcr.io |
| 64 | + apiServer: |
| 65 | + extraArgs: |
| 66 | + cloud-provider: openstack |
| 67 | + cloud-config: /etc/kubernetes/cloud.conf |
| 68 | + extraVolumes: |
| 69 | + - name: cloud |
| 70 | + hostPath: /etc/kubernetes/cloud.conf |
| 71 | + mountPath: /etc/kubernetes/cloud.conf |
| 72 | + readOnly: true |
| 73 | + controllerManager: |
| 74 | + extraArgs: |
| 75 | + cloud-provider: openstack |
| 76 | + cloud-config: /etc/kubernetes/cloud.conf |
| 77 | + extraVolumes: |
| 78 | + - name: cloud |
| 79 | + hostPath: /etc/kubernetes/cloud.conf |
| 80 | + mountPath: /etc/kubernetes/cloud.conf |
| 81 | + readOnly: true |
| 82 | + - name: cacerts |
| 83 | + hostPath: /etc/certs/cacert |
| 84 | + mountPath: /etc/certs/cacert |
| 85 | + readOnly: true |
| 86 | + joinConfiguration: |
| 87 | + nodeRegistration: |
| 88 | + name: '{{ local_hostname }}' |
| 89 | + kubeletExtraArgs: |
| 90 | + cloud-config: /etc/kubernetes/cloud.conf |
| 91 | + cloud-provider: openstack |
| 92 | + files: |
| 93 | + - path: /etc/kubernetes/cloud.conf |
| 94 | + owner: root |
| 95 | + permissions: "0600" |
| 96 | + content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} |
| 97 | + encoding: base64 |
| 98 | + - path: /etc/certs/cacert |
| 99 | + owner: root |
| 100 | + permissions: "0600" |
| 101 | + content: ${OPENSTACK_CLOUD_CACERT_B64} |
| 102 | + encoding: base64 |
| 103 | + version: "${KUBERNETES_VERSION}" |
| 104 | +--- |
| 105 | +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 106 | +kind: OpenStackMachineTemplate |
| 107 | +metadata: |
| 108 | + name: ${CLUSTER_NAME}-control-plane |
| 109 | +spec: |
| 110 | + template: |
| 111 | + spec: |
| 112 | + flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} |
| 113 | + image: ${OPENSTACK_IMAGE_NAME} |
| 114 | + sshKeyName: ${OPENSTACK_SSH_KEY_NAME} |
| 115 | + cloudName: ${OPENSTACK_CLOUD} |
| 116 | + identityRef: |
| 117 | + name: ${CLUSTER_NAME}-cloud-config |
| 118 | + kind: Secret |
| 119 | + ports: |
| 120 | + - description: "primary" |
| 121 | + - description: "Extra Network 1" |
| 122 | + networkId: "${CLUSTER_EXTRA_NET_1}" |
| 123 | + - description: "Extra Network 2" |
| 124 | + networkId: "${CLUSTER_EXTRA_NET_2}" |
| 125 | +--- |
| 126 | +apiVersion: cluster.x-k8s.io/v1alpha4 |
| 127 | +kind: MachineDeployment |
| 128 | +metadata: |
| 129 | + name: "${CLUSTER_NAME}-md-0" |
| 130 | +spec: |
| 131 | + clusterName: "${CLUSTER_NAME}" |
| 132 | + replicas: ${WORKER_MACHINE_COUNT} |
| 133 | + selector: |
| 134 | + matchLabels: |
| 135 | + template: |
| 136 | + spec: |
| 137 | + clusterName: "${CLUSTER_NAME}" |
| 138 | + version: "${KUBERNETES_VERSION}" |
| 139 | + failureDomain: ${OPENSTACK_FAILURE_DOMAIN} |
| 140 | + bootstrap: |
| 141 | + configRef: |
| 142 | + name: "${CLUSTER_NAME}-md-0" |
| 143 | + apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 |
| 144 | + kind: KubeadmConfigTemplate |
| 145 | + infrastructureRef: |
| 146 | + name: "${CLUSTER_NAME}-md-0" |
| 147 | + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 148 | + kind: OpenStackMachineTemplate |
| 149 | +--- |
| 150 | +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 |
| 151 | +kind: OpenStackMachineTemplate |
| 152 | +metadata: |
| 153 | + name: ${CLUSTER_NAME}-md-0 |
| 154 | +spec: |
| 155 | + template: |
| 156 | + spec: |
| 157 | + cloudName: ${OPENSTACK_CLOUD} |
| 158 | + identityRef: |
| 159 | + name: ${CLUSTER_NAME}-cloud-config |
| 160 | + kind: Secret |
| 161 | + flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} |
| 162 | + image: ${OPENSTACK_IMAGE_NAME} |
| 163 | + sshKeyName: ${OPENSTACK_SSH_KEY_NAME} |
| 164 | + ports: |
| 165 | + - description: "primary" |
| 166 | + - description: "Extra Network 1" |
| 167 | + networkId: "${CLUSTER_EXTRA_NET_1}" |
| 168 | + - description: "Extra Network 2" |
| 169 | + networkId: "${CLUSTER_EXTRA_NET_2}" |
| 170 | +--- |
| 171 | +apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 |
| 172 | +kind: KubeadmConfigTemplate |
| 173 | +metadata: |
| 174 | + name: ${CLUSTER_NAME}-md-0 |
| 175 | +spec: |
| 176 | + template: |
| 177 | + spec: |
| 178 | + files: |
| 179 | + - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} |
| 180 | + encoding: base64 |
| 181 | + owner: root |
| 182 | + path: /etc/kubernetes/cloud.conf |
| 183 | + permissions: "0600" |
| 184 | + - content: ${OPENSTACK_CLOUD_CACERT_B64} |
| 185 | + encoding: base64 |
| 186 | + owner: root |
| 187 | + path: /etc/certs/cacert |
| 188 | + permissions: "0600" |
| 189 | + joinConfiguration: |
| 190 | + nodeRegistration: |
| 191 | + name: '{{ local_hostname }}' |
| 192 | + kubeletExtraArgs: |
| 193 | + cloud-config: /etc/kubernetes/cloud.conf |
| 194 | + cloud-provider: openstack |
| 195 | +--- |
| 196 | +apiVersion: v1 |
| 197 | +kind: Secret |
| 198 | +metadata: |
| 199 | + name: ${CLUSTER_NAME}-cloud-config |
| 200 | + labels: |
| 201 | + clusterctl.cluster.x-k8s.io/move: "true" |
| 202 | +data: |
| 203 | + clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64} |
| 204 | + cacert: ${OPENSTACK_CLOUD_CACERT_B64} |
| 205 | +--- |
| 206 | +apiVersion: v1 |
| 207 | +kind: ConfigMap |
| 208 | +metadata: |
| 209 | + name: "cni-${CLUSTER_NAME}-crs-0" |
| 210 | +data: ${CNI_RESOURCES} |
| 211 | +--- |
| 212 | +apiVersion: addons.cluster.x-k8s.io/v1alpha4 |
| 213 | +kind: ClusterResourceSet |
| 214 | +metadata: |
| 215 | + name: "${CLUSTER_NAME}-crs-0" |
| 216 | +spec: |
| 217 | + strategy: ApplyOnce |
| 218 | + clusterSelector: |
| 219 | + matchLabels: |
| 220 | + cni: "${CLUSTER_NAME}-crs-0" |
| 221 | + resources: |
| 222 | + - name: "cni-${CLUSTER_NAME}-crs-0" |
| 223 | + kind: ConfigMap |
0 commit comments