Packer.Images/ansible/roles/firstboot/files/ansible_payload/bootstrap/templates/kustomization.nodepool.j2

84 lines
2.4 KiB
Plaintext
Raw Normal View History

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manifests/kubeadmconfigtemplate-{{ _template.cluster.name }}-worker.yaml
- manifests/machinedeployment-{{ _template.cluster.name }}-worker.yaml
- manifests/vspheremachinetemplate-{{ _template.cluster.name }}-worker.yaml
2023-07-06 11:01:35 +00:00
patches:
- patch: |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: {{ _template.cluster.name }}-worker
namespace: default
spec:
template:
spec:
diskSetup:
filesystems:
- device: /dev/sdb1
filesystem: ext4
label: blockstorage
partitions:
- device: /dev/sdb
layout: true
tableType: gpt
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-labels: "node.longhorn.io/create-default-disk=true"
mounts:
- - LABEL=blockstorage
- /mnt/blockstorage
2023-07-06 11:01:35 +00:00
- patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
metadata:
name: {{ _template.cluster.name }}-worker
namespace: default
spec:
template:
spec:
additionalDisksGiB:
- {{ _template.nodepool.additionaldisk }}
2023-07-06 11:01:35 +00:00
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
2023-07-06 11:01:35 +00:00
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/bootstrap/configRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/infrastructureRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/replicas
value: {{ _template.nodepool.size }}
2023-07-06 11:01:35 +00:00
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage