2023-01-02 13:39:01 +00:00
|
|
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
|
|
kind: Kustomization
|
|
|
|
resources:
|
|
|
|
- cluster-template.yaml
|
2023-01-02 20:20:08 +00:00
|
|
|
|
2023-01-02 13:39:01 +00:00
|
|
|
patchesStrategicMerge:
|
|
|
|
- |-
|
|
|
|
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
|
|
|
|
kind: KubeadmControlPlane
|
|
|
|
metadata:
|
|
|
|
name: '${CLUSTER_NAME}'
|
|
|
|
namespace: '${NAMESPACE}'
|
|
|
|
spec:
|
|
|
|
kubeadmConfigSpec:
|
|
|
|
clusterConfiguration:
|
2023-03-15 14:02:00 +00:00
|
|
|
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
|
2023-01-02 13:39:01 +00:00
|
|
|
- |-
|
|
|
|
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
|
|
|
|
kind: KubeadmConfigTemplate
|
|
|
|
metadata:
|
|
|
|
name: '${CLUSTER_NAME}-md-0'
|
|
|
|
namespace: '${NAMESPACE}'
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
clusterConfiguration:
|
2023-03-15 14:02:00 +00:00
|
|
|
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
|
2023-03-20 11:40:39 +00:00
|
|
|
diskSetup:
|
|
|
|
filesystems:
|
|
|
|
- device: /dev/sdb1
|
|
|
|
filesystem: ext4
|
|
|
|
label: blockstorage
|
|
|
|
partitions:
|
|
|
|
- device: /dev/sdb
|
|
|
|
layout: true
|
|
|
|
tableType: gpt
|
|
|
|
mounts:
|
|
|
|
- - LABEL=blockstorage
|
|
|
|
- /mnt/blockstorage
|
2023-01-02 13:39:01 +00:00
|
|
|
- |-
|
|
|
|
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
|
|
|
|
kind: KubeadmConfigTemplate
|
|
|
|
metadata:
|
|
|
|
name: '${CLUSTER_NAME}-md-0'
|
|
|
|
namespace: '${NAMESPACE}'
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
files:
|
2023-04-03 19:37:09 +00:00
|
|
|
- content: |
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
|
|
|
config_path = "/etc/containerd/certs.d"
|
|
|
|
append: true
|
|
|
|
path: /etc/containerd/config.toml
|
|
|
|
{% for registry in _template.registries %}
|
|
|
|
- content: |
|
|
|
|
server = "https://{{ registry }}"
|
|
|
|
|
|
|
|
[host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"]
|
|
|
|
capabilities = ["pull", "resolve"]
|
|
|
|
override_path = true
|
|
|
|
owner: root:root
|
|
|
|
path: /etc/containerd/certs.d/{{ registry }}/hosts.toml
|
|
|
|
{% endfor %}
|
2023-01-02 13:39:01 +00:00
|
|
|
- content: |
|
|
|
|
network: {config: disabled}
|
|
|
|
owner: root:root
|
|
|
|
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
|
|
- content: |
|
2023-01-04 12:22:35 +00:00
|
|
|
{{ _template.rootca | indent(width=14, first=False) | trim }}
|
2023-01-02 13:39:01 +00:00
|
|
|
owner: root:root
|
|
|
|
path: /usr/local/share/ca-certificates/root_ca.crt
|
2023-03-14 14:43:11 +00:00
|
|
|
- |-
|
|
|
|
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
|
|
|
|
kind: VSphereMachineTemplate
|
|
|
|
metadata:
|
|
|
|
name: ${CLUSTER_NAME}
|
|
|
|
namespace: '${NAMESPACE}'
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
network:
|
|
|
|
devices:
|
|
|
|
- dhcp4: false
|
|
|
|
addressesFromPools:
|
|
|
|
- apiGroup: ipam.cluster.x-k8s.io
|
|
|
|
kind: InClusterIPPool
|
|
|
|
name: inclusterippool-${CLUSTER_NAME}
|
2023-03-16 08:15:05 +00:00
|
|
|
nameservers:
|
|
|
|
- {{ _template.network.dnsserver }}
|
2023-03-14 14:43:11 +00:00
|
|
|
networkName: '${VSPHERE_NETWORK}'
|
|
|
|
- |-
|
|
|
|
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
|
|
|
|
kind: VSphereMachineTemplate
|
|
|
|
metadata:
|
|
|
|
name: ${CLUSTER_NAME}-worker
|
|
|
|
namespace: '${NAMESPACE}'
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
2023-03-20 11:40:39 +00:00
|
|
|
additionalDisksGiB:
|
|
|
|
- {{ _template.additionaldisk }}
|
2023-03-14 14:43:11 +00:00
|
|
|
network:
|
|
|
|
devices:
|
|
|
|
- dhcp4: false
|
|
|
|
addressesFromPools:
|
|
|
|
- apiGroup: ipam.cluster.x-k8s.io
|
|
|
|
kind: InClusterIPPool
|
|
|
|
name: inclusterippool-${CLUSTER_NAME}
|
2023-03-15 09:24:45 +00:00
|
|
|
nameservers:
|
|
|
|
- {{ _template.network.dnsserver }}
|
2023-03-14 14:43:11 +00:00
|
|
|
networkName: '${VSPHERE_NETWORK}'
|
2023-01-02 13:39:01 +00:00
|
|
|
|
|
|
|
patchesJson6902:
|
|
|
|
- target:
|
|
|
|
group: controlplane.cluster.x-k8s.io
|
|
|
|
version: v1beta1
|
|
|
|
kind: KubeadmControlPlane
|
|
|
|
name: .*
|
|
|
|
patch: |-
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
2023-04-03 19:37:09 +00:00
|
|
|
value:
|
|
|
|
content: |
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
|
|
|
config_path = "/etc/containerd/certs.d"
|
|
|
|
append: true
|
|
|
|
path: /etc/containerd/config.toml
|
|
|
|
{% for registry in _template.registries %}
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
|
|
|
value:
|
|
|
|
content: |
|
|
|
|
server = "https://{{ registry }}"
|
|
|
|
|
|
|
|
[host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"]
|
|
|
|
capabilities = ["pull", "resolve"]
|
|
|
|
override_path = true
|
|
|
|
owner: root:root
|
|
|
|
path: /etc/containerd/certs.d/{{ registry }}/hosts.toml
|
|
|
|
{% endfor %}
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
2023-01-02 13:39:01 +00:00
|
|
|
value:
|
|
|
|
content: |
|
|
|
|
network: {config: disabled}
|
|
|
|
owner: root:root
|
|
|
|
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
|
|
|
value:
|
|
|
|
content: |
|
2023-01-04 12:22:35 +00:00
|
|
|
{{ _template.rootca | indent(width=12, first=False) | trim }}
|
2023-01-02 13:39:01 +00:00
|
|
|
owner: root:root
|
|
|
|
path: /usr/local/share/ca-certificates/root_ca.crt
|
|
|
|
- target:
|
|
|
|
group: bootstrap.cluster.x-k8s.io
|
|
|
|
version: v1beta1
|
|
|
|
kind: KubeadmConfigTemplate
|
|
|
|
name: .*
|
|
|
|
patch: |-
|
2023-01-02 20:20:08 +00:00
|
|
|
{% for cmd in _template.runcmds %}
|
2023-01-02 13:39:01 +00:00
|
|
|
- op: add
|
|
|
|
path: /spec/template/spec/preKubeadmCommands/-
|
2023-01-02 20:20:08 +00:00
|
|
|
value: {{ cmd }}
|
|
|
|
{% endfor %}
|
2023-01-02 13:39:01 +00:00
|
|
|
- target:
|
|
|
|
group: controlplane.cluster.x-k8s.io
|
|
|
|
version: v1beta1
|
|
|
|
kind: KubeadmControlPlane
|
|
|
|
name: .*
|
|
|
|
patch: |-
|
2023-01-02 20:20:08 +00:00
|
|
|
{% for cmd in _template.runcmds %}
|
2023-01-02 13:39:01 +00:00
|
|
|
- op: add
|
2023-01-04 12:22:35 +00:00
|
|
|
path: /spec/kubeadmConfigSpec/preKubeadmCommands/-
|
2023-01-02 20:20:08 +00:00
|
|
|
value: {{ cmd }}
|
|
|
|
{% endfor %}
|