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