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-01-02 20:20:08 +00:00
|
|
|
imageRepository: registry.{{ _template.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-01-02 20:20:08 +00:00
|
|
|
imageRepository: registry.{{ _template.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:
|
|
|
|
files:
|
|
|
|
- encoding: base64
|
|
|
|
content: |
|
2023-01-02 20:20:08 +00:00
|
|
|
{{ _template.script.encoded }}
|
2023-01-02 13:39:01 +00:00
|
|
|
permissions: '0744'
|
|
|
|
- content: |
|
|
|
|
network: {config: disabled}
|
|
|
|
owner: root:root
|
|
|
|
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
|
|
- content: |
|
|
|
|
{{ _template.rootca | indent(width=6, first=True) }}
|
|
|
|
owner: root:root
|
|
|
|
path: /usr/local/share/ca-certificates/root_ca.crt
|
|
|
|
|
|
|
|
patchesJson6902:
|
|
|
|
- target:
|
|
|
|
group: controlplane.cluster.x-k8s.io
|
|
|
|
version: v1beta1
|
|
|
|
kind: KubeadmControlPlane
|
|
|
|
name: .*
|
|
|
|
patch: |-
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
|
|
|
value:
|
|
|
|
encoding: base64
|
|
|
|
content: |
|
2023-01-02 20:20:08 +00:00
|
|
|
{{ _template.script.encoded }}
|
2023-01-02 13:39:01 +00:00
|
|
|
permissions: '0744'
|
|
|
|
- op: add
|
|
|
|
path: /spec/kubeadmConfigSpec/files/-
|
|
|
|
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: |
|
|
|
|
{{ _template.rootca | indent(width=8, first=True) }}
|
|
|
|
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-02 20:20:08 +00:00
|
|
|
path: /spec/template/spec/preKubeadmCommands/-
|
|
|
|
value: {{ cmd }}
|
|
|
|
{% endfor %}
|