Skip to content

Commit 56fead8

Browse files
authored
Merge pull request #58 from sp-yduck/fix/template-image
fix #54
2 parents e49e4d1 + ebde9a0 commit 56fead8

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed

examples/machine_deployment/metal3-ubuntu2204-k8s127.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ apiVersion: cluster.x-k8s.io/v1beta1
22
kind: MachineDeployment
33
metadata:
44
name: ${CLUSTER_NAME}-md-2
5+
namespace: ${NAMESPACE}
6+
labels:
7+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
58
spec:
69
clusterName: ${CLUSTER_NAME}
7-
replicas: 1
10+
replicas: ${WORKER_MACHINE_COUNT}
811
selector:
9-
matchLabels: null
12+
matchLabels: {}
1013
template:
1114
spec:
1215
bootstrap:
@@ -27,6 +30,9 @@ apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
2730
kind: KubeadmConfigTemplate
2831
metadata:
2932
name: ${CLUSTER_NAME}-md-2
33+
namespace: ${NAMESPACE}
34+
labels:
35+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
3036
spec:
3137
template:
3238
spec:
@@ -41,6 +47,9 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
4147
kind: ProxmoxMachineTemplate
4248
metadata:
4349
name: ${CLUSTER_NAME}-md-2
50+
namespace: ${NAMESPACE}
51+
labels:
52+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
4453
spec:
4554
template:
4655
spec:

examples/machine_deployment/ubuntu2204.yaml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,71 @@
1+
## variables
2+
# CLUSTER_NAME
3+
# NAMESPACE
4+
# WORKER_MACHINE_COUNT
5+
# KUBERNETES_VERSION
6+
---
17
apiVersion: cluster.x-k8s.io/v1beta1
28
kind: MachineDeployment
39
metadata:
410
name: ${CLUSTER_NAME}-md-1
11+
namespace: ${NAMESPACE}
12+
labels:
13+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
514
spec:
6-
clusterName: ${CLUSTER_NAME}
7-
replicas: 1
15+
clusterName: "${CLUSTER_NAME}"
16+
replicas: ${WORKER_MACHINE_COUNT}
817
selector:
9-
matchLabels: null
18+
matchLabels: {}
1019
template:
1120
spec:
21+
clusterName: ${CLUSTER_NAME}
1222
bootstrap:
1323
configRef:
1424
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
1525
kind: KubeadmConfigTemplate
1626
name: ${CLUSTER_NAME}-md-1
17-
clusterName: ${CLUSTER_NAME}
1827
infrastructureRef:
1928
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
2029
kind: ProxmoxMachineTemplate
2130
name: ${CLUSTER_NAME}-md-1
22-
version: v1.26.5
31+
version: ${KUBERNETES_VERSION:=v1.27.3}
2332

2433
---
2534

2635
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
2736
kind: KubeadmConfigTemplate
2837
metadata:
2938
name: ${CLUSTER_NAME}-md-1
39+
namespace: ${NAMESPACE}
40+
labels:
41+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
3042
spec:
3143
template:
3244
spec:
3345
joinConfiguration:
3446
nodeRegistration:
3547
kubeletExtraArgs:
36-
cloud-provider: external
48+
cloud-provider: external
49+
postKubeadmCommands:
50+
- "curl -L https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl"
51+
- "chmod +x /usr/local/bin/kubectl"
52+
- "reboot now"
3753

3854
---
3955

4056
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
4157
kind: ProxmoxMachineTemplate
4258
metadata:
4359
name: ${CLUSTER_NAME}-md-1
60+
namespace: ${NAMESPACE}
61+
labels:
62+
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
4463
spec:
4564
template:
4665
spec:
4766
image:
48-
url: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img
49-
checksum: 86e996f35732d26cd8b0888c46c4309d4d3b04eb6980378cf82b4d3eb2796549
67+
url: https://cloud-images.ubuntu.com/jammy/20230801/jammy-server-cloudimg-amd64-disk-kvm.img
68+
checksum: 6088ec131e248fec3dad91b3859a7ba74b6e56e00b293a913c8d1ada3351bb79
5069
checksumType: sha256
5170
cloudInit:
5271
user:
@@ -83,11 +102,11 @@ spec:
83102
- "mkdir -p /opt/cni/bin"
84103
- curl -L "https://github.com/containernetworking/plugins/releases/download/v1.3.0/cni-plugins-linux-amd64-v1.3.0.tgz" | tar -C "/opt/cni/bin" -xz
85104
- curl -L "https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.27.0/crictl-v1.27.0-linux-amd64.tar.gz" | tar -C "/usr/local/bin" -xz
86-
- curl -L --remote-name-all https://dl.k8s.io/release/v1.26.5/bin/linux/amd64/kubeadm -o /usr/local/bin/kubeadm
105+
- curl -L --remote-name-all https://dl.k8s.io/release/${KUBERNETES_VERSION:=v1.27.3}/bin/linux/amd64/kubeadm -o /usr/local/bin/kubeadm
87106
- chmod +x /usr/local/bin/kubeadm
88-
- curl -L --remote-name-all https://dl.k8s.io/release/v1.26.5/bin/linux/amd64/kubelet -o /usr/local/bin/kubelet
107+
- curl -L --remote-name-all https://dl.k8s.io/release/${KUBERNETES_VERSION:=v1.27.3}/bin/linux/amd64/kubelet -o /usr/local/bin/kubelet
89108
- chmod +x /usr/local/bin/kubelet
90109
- curl -sSL "https://raw.githubusercontent.com/kubernetes/release/v0.15.1/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service" | sed "s:/usr/bin:/usr/local/bin:g" | tee /etc/systemd/system/kubelet.service
91110
- mkdir -p /etc/systemd/system/kubelet.service.d
92111
- curl -sSL "https://raw.githubusercontent.com/kubernetes/release/v0.15.1/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf" | sed "s:/usr/bin:/usr/local/bin:g" | tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
93-
- "systemctl enable kubelet.service"
112+
- "systemctl enable kubelet.service"

templates/cluster-template.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ spec:
151151
template:
152152
spec:
153153
image:
154-
url: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img
155-
checksum: 86e996f35732d26cd8b0888c46c4309d4d3b04eb6980378cf82b4d3eb2796549
154+
url: https://cloud-images.ubuntu.com/jammy/20230801/jammy-server-cloudimg-amd64-disk-kvm.img
155+
checksum: 6088ec131e248fec3dad91b3859a7ba74b6e56e00b293a913c8d1ada3351bb79
156156
checksumType: sha256
157157
hardware:
158158
cpu: 4
@@ -259,8 +259,8 @@ spec:
259259
template:
260260
spec:
261261
image:
262-
url: https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img
263-
checksum: 86e996f35732d26cd8b0888c46c4309d4d3b04eb6980378cf82b4d3eb2796549
262+
url: https://cloud-images.ubuntu.com/jammy/20230801/jammy-server-cloudimg-amd64-disk-kvm.img
263+
checksum: 6088ec131e248fec3dad91b3859a7ba74b6e56e00b293a913c8d1ada3351bb79
264264
checksumType: sha256
265265
cloudInit:
266266
user:

0 commit comments

Comments
 (0)