1 Commits

Author SHA1 Message Date
2addda3f06 Upgrade node template OS version;Upgrade K8s minor version
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-19 12:19:06 +02:00
4 changed files with 185 additions and 169 deletions

View File

@ -0,0 +1,14 @@
import netaddr
def netaddr_iter_iprange(ip_start, ip_end):
return [str(ip) for ip in netaddr.iter_iprange(ip_start, ip_end)]
class FilterModule(object):
''' Ansible filter. Interface to netaddr methods.
https://pypi.org/project/netaddr/
'''
def filters(self):
return {
'netaddr_iter_iprange': netaddr_iter_iprange
}

View File

@ -3,8 +3,8 @@ kind: Kustomization
resources: resources:
- cluster-template.yaml - cluster-template.yaml
patches: patchesStrategicMerge:
- patch: |- - |-
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
@ -32,7 +32,7 @@ patches:
[Network] [Network]
public-network = "${VSPHERE_NETWORK}" public-network = "${VSPHERE_NETWORK}"
type: Opaque type: Opaque
- patch: |- - |-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane kind: KubeadmControlPlane
metadata: metadata:
@ -42,7 +42,7 @@ patches:
kubeadmConfigSpec: kubeadmConfigSpec:
clusterConfiguration: clusterConfiguration:
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
- patch: |- - |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
metadata: metadata:
@ -53,7 +53,7 @@ patches:
spec: spec:
clusterConfiguration: clusterConfiguration:
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
- patch: |- - |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
metadata: metadata:
@ -86,7 +86,7 @@ patches:
{{ _template.rootca | indent(width=14, first=False) | trim }} {{ _template.rootca | indent(width=14, first=False) | trim }}
owner: root:root owner: root:root
path: /usr/local/share/ca-certificates/root_ca.crt path: /usr/local/share/ca-certificates/root_ca.crt
- patch: |- - |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
metadata: metadata:
@ -105,7 +105,7 @@ patches:
nameservers: nameservers:
- {{ _template.network.dnsserver }} - {{ _template.network.dnsserver }}
networkName: '${VSPHERE_NETWORK}' networkName: '${VSPHERE_NETWORK}'
- patch: |- - |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
metadata: metadata:
@ -125,131 +125,132 @@ patches:
- {{ _template.network.dnsserver }} - {{ _template.network.dnsserver }}
networkName: '${VSPHERE_NETWORK}' networkName: '${VSPHERE_NETWORK}'
- target: patchesJson6902:
group: controlplane.cluster.x-k8s.io - target:
version: v1beta1 group: controlplane.cluster.x-k8s.io
kind: KubeadmControlPlane version: v1beta1
name: .* kind: KubeadmControlPlane
patch: |- name: .*
- op: add patch: |-
path: /spec/kubeadmConfigSpec/files/- - op: add
value: path: /spec/kubeadmConfigSpec/files/-
content: | value:
[plugins."io.containerd.grpc.v1.cri".registry] content: |
config_path = "/etc/containerd/certs.d" [plugins."io.containerd.grpc.v1.cri".registry]
append: true config_path = "/etc/containerd/certs.d"
path: /etc/containerd/config.toml append: true
path: /etc/containerd/config.toml
{% for registry in _template.registries %} {% for registry in _template.registries %}
- op: add - op: add
path: /spec/kubeadmConfigSpec/files/- path: /spec/kubeadmConfigSpec/files/-
value: value:
content: | content: |
server = "https://{{ registry }}" server = "https://{{ registry }}"
[host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"] [host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"]
capabilities = ["pull", "resolve"] capabilities = ["pull", "resolve"]
override_path = true override_path = true
owner: root:root owner: root:root
path: /etc/containerd/certs.d/{{ registry }}/hosts.toml path: /etc/containerd/certs.d/{{ registry }}/hosts.toml
{% endfor %} {% endfor %}
- op: add - op: add
path: /spec/kubeadmConfigSpec/files/- path: /spec/kubeadmConfigSpec/files/-
value: value:
content: | content: |
network: {config: disabled} network: {config: disabled}
owner: root:root owner: root:root
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
- op: add - op: add
path: /spec/kubeadmConfigSpec/files/- path: /spec/kubeadmConfigSpec/files/-
value: value:
content: | content: |
{{ _template.rootca | indent(width=10, first=False) | trim }} {{ _template.rootca | indent(width=12, first=False) | trim }}
owner: root:root owner: root:root
path: /usr/local/share/ca-certificates/root_ca.crt path: /usr/local/share/ca-certificates/root_ca.crt
- target: - target:
group: bootstrap.cluster.x-k8s.io group: bootstrap.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
name: .* name: .*
patch: |- patch: |-
{% for cmd in _template.runcmds %} {% for cmd in _template.runcmds %}
- op: add - op: add
path: /spec/template/spec/preKubeadmCommands/- path: /spec/template/spec/preKubeadmCommands/-
value: {{ cmd }} value: {{ cmd }}
{% endfor %} {% endfor %}
- target: - target:
group: controlplane.cluster.x-k8s.io group: controlplane.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: KubeadmControlPlane kind: KubeadmControlPlane
name: .* name: .*
patch: |- patch: |-
{% for cmd in _template.runcmds %} {% for cmd in _template.runcmds %}
- op: add - op: add
path: /spec/kubeadmConfigSpec/preKubeadmCommands/- path: /spec/kubeadmConfigSpec/preKubeadmCommands/-
value: {{ cmd }} value: {{ cmd }}
{% endfor %} {% endfor %}
- target: - target:
group: infrastructure.cluster.x-k8s.io group: infrastructure.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
name: \${CLUSTER_NAME} name: \${CLUSTER_NAME}
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: ${CLUSTER_NAME}-master value: ${CLUSTER_NAME}-master
- target: - target:
group: controlplane.cluster.x-k8s.io group: controlplane.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: KubeadmControlPlane kind: KubeadmControlPlane
name: \${CLUSTER_NAME} name: \${CLUSTER_NAME}
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: ${CLUSTER_NAME}-master value: ${CLUSTER_NAME}-master
- op: replace - op: replace
path: /spec/machineTemplate/infrastructureRef/name path: /spec/machineTemplate/infrastructureRef/name
value: ${CLUSTER_NAME}-master value: ${CLUSTER_NAME}-master
- target: - target:
group: cluster.x-k8s.io group: cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: Cluster kind: Cluster
name: \${CLUSTER_NAME} name: \${CLUSTER_NAME}
patch: |- patch: |-
- op: replace - op: replace
path: /spec/controlPlaneRef/name path: /spec/controlPlaneRef/name
value: ${CLUSTER_NAME}-master value: ${CLUSTER_NAME}-master
- target: - target:
group: infrastructure.cluster.x-k8s.io group: infrastructure.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
name: \${CLUSTER_NAME}-worker name: \${CLUSTER_NAME}-worker
patch: |- patch: |-
- op: replace - op: replace
path: /spec/template/spec/numCPUs path: /spec/template/spec/numCPUs
value: {{ _template.nodesize.cpu }} value: {{ _template.nodesize.cpu }}
- op: replace - op: replace
path: /spec/template/spec/memoryMiB path: /spec/template/spec/memoryMiB
value: {{ _template.nodesize.memory }} value: {{ _template.nodesize.memory }}
- target: - target:
group: cluster.x-k8s.io group: cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: MachineDeployment kind: MachineDeployment
name: \${CLUSTER_NAME}-md-0 name: \${CLUSTER_NAME}-md-0
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: ${CLUSTER_NAME}-worker value: ${CLUSTER_NAME}-worker
- op: replace - op: replace
path: /spec/template/spec/bootstrap/configRef/name path: /spec/template/spec/bootstrap/configRef/name
value: ${CLUSTER_NAME}-worker value: ${CLUSTER_NAME}-worker
- target: - target:
group: bootstrap.cluster.x-k8s.io group: bootstrap.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
name: \${CLUSTER_NAME}-md-0 name: \${CLUSTER_NAME}-md-0
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: ${CLUSTER_NAME}-worker value: ${CLUSTER_NAME}-worker

View File

@ -5,8 +5,8 @@ resources:
- manifests/machinedeployment-{{ _template.cluster.name }}-worker.yaml - manifests/machinedeployment-{{ _template.cluster.name }}-worker.yaml
- manifests/vspheremachinetemplate-{{ _template.cluster.name }}-worker.yaml - manifests/vspheremachinetemplate-{{ _template.cluster.name }}-worker.yaml
patches: patchesStrategicMerge:
- patch: |- - |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate kind: KubeadmConfigTemplate
metadata: metadata:
@ -31,7 +31,7 @@ patches:
mounts: mounts:
- - LABEL=blockstorage - - LABEL=blockstorage
- /mnt/blockstorage - /mnt/blockstorage
- patch: |- - |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
metadata: metadata:
@ -43,41 +43,42 @@ patches:
additionalDisksGiB: additionalDisksGiB:
- {{ _template.nodepool.additionaldisk }} - {{ _template.nodepool.additionaldisk }}
- target: patchesJson6902:
group: bootstrap.cluster.x-k8s.io - target:
version: v1beta1 group: bootstrap.cluster.x-k8s.io
kind: KubeadmConfigTemplate version: v1beta1
name: {{ _template.cluster.name }}-worker kind: KubeadmConfigTemplate
patch: |- name: {{ _template.cluster.name }}-worker
- op: replace patch: |-
path: /metadata/name - op: replace
value: {{ _template.cluster.name }}-worker-storage path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- target: - target:
group: cluster.x-k8s.io group: cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: MachineDeployment kind: MachineDeployment
name: {{ _template.cluster.name }}-worker name: {{ _template.cluster.name }}-worker
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage value: {{ _template.cluster.name }}-worker-storage
- op: replace - op: replace
path: /spec/template/spec/bootstrap/configRef/name path: /spec/template/spec/bootstrap/configRef/name
value: {{ _template.cluster.name }}-worker-storage value: {{ _template.cluster.name }}-worker-storage
- op: replace - op: replace
path: /spec/template/spec/infrastructureRef/name path: /spec/template/spec/infrastructureRef/name
value: {{ _template.cluster.name }}-worker-storage value: {{ _template.cluster.name }}-worker-storage
- op: replace - op: replace
path: /spec/replicas path: /spec/replicas
value: {{ _template.nodepool.size }} value: {{ _template.nodepool.size }}
- target: - target:
group: infrastructure.cluster.x-k8s.io group: infrastructure.cluster.x-k8s.io
version: v1beta1 version: v1beta1
kind: VSphereMachineTemplate kind: VSphereMachineTemplate
name: {{ _template.cluster.name }}-worker name: {{ _template.cluster.name }}-worker
patch: |- patch: |-
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage value: {{ _template.cluster.name }}-worker-storage

View File

@ -1,7 +1,7 @@
platform: platform:
k3s: k3s:
version: v1.25.9+k3s1 version: v1.26.4+k3s1
packaged_components: packaged_components:
- name: traefik - name: traefik
@ -115,13 +115,13 @@ components:
infrastructure_vsphere: v1.6.0 infrastructure_vsphere: v1.6.0
ipam_incluster: v0.1.0-alpha.2 ipam_incluster: v0.1.0-alpha.2
# Refer to `https://console.cloud.google.com/gcr/images/cloud-provider-vsphere/GLOBAL/cpi/release/manager` for available tags # Refer to `https://console.cloud.google.com/gcr/images/cloud-provider-vsphere/GLOBAL/cpi/release/manager` for available tags
cpi_vsphere: v1.25.2 cpi_vsphere: v1.26.0
workload: workload:
version: version:
calico: v3.25.0 calico: v3.25.0
k8s: v1.25.10 k8s: v1.26.4
node_template: node_template:
url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.25.10.ova url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.26.4.ova
# dex: # dex:
# helm: # helm: