From 925ff4e71c69769f0593435682692f9ab67e4603 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sun, 17 Dec 2023 18:10:56 -0700 Subject: [PATCH] add install-kubelet.sh script --- 00-provisioning/butane/kube-node01-full.yaml | 10 ++++++++++ 00-provisioning/butane/kube-node02-full.yaml | 10 ++++++++++ 00-provisioning/butane/kube-node03-full.yaml | 10 ++++++++++ 00-provisioning/ignition/kube-node01-full.json | 2 +- 00-provisioning/ignition/kube-node02-full.json | 2 +- 00-provisioning/ignition/kube-node03-full.json | 2 +- 6 files changed, 33 insertions(+), 3 deletions(-) diff --git a/00-provisioning/butane/kube-node01-full.yaml b/00-provisioning/butane/kube-node01-full.yaml index fd26c69..14734ee 100644 --- a/00-provisioning/butane/kube-node01-full.yaml +++ b/00-provisioning/butane/kube-node01-full.yaml @@ -47,6 +47,16 @@ storage: inline: | net.bridge.bridge-nf-call-iptables=1 net.ipv4.ip_forward=1 + # script to install kubelet dependencies + - path: /usr/local/bin/install-kubelet.sh + mode: 0744 + overwrite: true + contents: + inline: | + #!/bin/bash + rpm-ostree install kubelet kubeadm kubectl cri-o + systemctl enable crio kubelet + systemctl reboot passwd: # setting login credentials users: - name: steven diff --git a/00-provisioning/butane/kube-node02-full.yaml b/00-provisioning/butane/kube-node02-full.yaml index 8f8747b..b2a7966 100644 --- a/00-provisioning/butane/kube-node02-full.yaml +++ b/00-provisioning/butane/kube-node02-full.yaml @@ -47,6 +47,16 @@ storage: inline: | net.bridge.bridge-nf-call-iptables=1 net.ipv4.ip_forward=1 + # script to install kubelet dependencies + - path: /usr/local/bin/install-kubelet.sh + mode: 0744 + overwrite: true + contents: + inline: | + #!/bin/bash + rpm-ostree install kubelet kubeadm kubectl cri-o + systemctl enable crio kubelet + systemctl reboot passwd: # setting login credentials users: - name: steven diff --git a/00-provisioning/butane/kube-node03-full.yaml b/00-provisioning/butane/kube-node03-full.yaml index 234cc46..0028484 100644 --- a/00-provisioning/butane/kube-node03-full.yaml +++ b/00-provisioning/butane/kube-node03-full.yaml @@ -47,6 +47,16 @@ storage: inline: | net.bridge.bridge-nf-call-iptables=1 net.ipv4.ip_forward=1 + # script to install kubelet dependencies + - path: /usr/local/bin/install-kubelet.sh + mode: 0744 + overwrite: true + contents: + inline: | + #!/bin/bash + rpm-ostree install kubelet kubeadm kubectl cri-o + systemctl enable crio kubelet + systemctl reboot passwd: # setting login credentials users: - name: steven diff --git a/00-provisioning/ignition/kube-node01-full.json b/00-provisioning/ignition/kube-node01-full.json index 13ec81a..fb98dcc 100644 --- a/00-provisioning/ignition/kube-node01-full.json +++ b/00-provisioning/ignition/kube-node01-full.json @@ -1 +1 @@ -{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node01%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}} +{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node01%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420},{"overwrite":true,"path":"/usr/local/bin/install-kubelet.sh","contents":{"compression":"","source":"data:,%23!%2Fbin%2Fbash%0Arpm-ostree%20install%20kubelet%20kubeadm%20kubectl%20cri-o%0Asystemctl%20enable%20crio%20kubelet%0Asystemctl%20reboot%0A"},"mode":484}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}} diff --git a/00-provisioning/ignition/kube-node02-full.json b/00-provisioning/ignition/kube-node02-full.json index e54c29f..581ef0f 100644 --- a/00-provisioning/ignition/kube-node02-full.json +++ b/00-provisioning/ignition/kube-node02-full.json @@ -1 +1 @@ -{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node02%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}} +{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node02%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420},{"overwrite":true,"path":"/usr/local/bin/install-kubelet.sh","contents":{"compression":"","source":"data:,%23!%2Fbin%2Fbash%0Arpm-ostree%20install%20kubelet%20kubeadm%20kubectl%20cri-o%0Asystemctl%20enable%20crio%20kubelet%0Asystemctl%20reboot%0A"},"mode":484}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}} diff --git a/00-provisioning/ignition/kube-node03-full.json b/00-provisioning/ignition/kube-node03-full.json index d4a4a93..1d06372 100644 --- a/00-provisioning/ignition/kube-node03-full.json +++ b/00-provisioning/ignition/kube-node03-full.json @@ -1 +1 @@ -{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node03%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}} +{"ignition":{"version":"3.4.0"},"passwd":{"users":[{"groups":["sudo","docker"],"name":"steven","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAsPq55j525p1ntk37oeel83i6FVm9+ptWk/4csqZivKRrtfhSebtWj0GHg7mnN+XIvQFEXY1HuPSfAByuwURN7LrBTKYNDHM5VxyHSP3s6Ik9OYngbVDCcDRc94teivYalYPyC5rCfIFYRg+vrxD1Gl7eASpiS7z2YD5w6WSxEnQ9tk+GQgsbRcsDBpKTZL/yHZbNNOamUwv3FNmaDpq7V8d1IrKCQiivYQ5n/sWpQnOzMOnY5i7OKr2G56KbaVIXRe3JKIF7ifAK0aJ5q+45RmwdgVh+SgwIFBzQD4GZJbr8jbvxYO9NjbF9fm7qLYnbHNyT7cDx8ClQqAz/2cL0xw== taterwin10"]}]},"storage":{"files":[{"overwrite":true,"path":"/etc/hostname","contents":{"compression":"","source":"data:,kube-node03%0A"},"mode":420},{"overwrite":true,"path":"/etc/dnf/modules.d/cri-o.module","contents":{"compression":"","source":"data:,%5Bcri-o%5D%0Aname%3Dcri-o%0Astream%3D1.17%0Aprofiles%3D%0Astate%3Denabled%0A"},"mode":420},{"overwrite":true,"path":"/etc/yum.repos.d/kubernetes.repo","contents":{"compression":"gzip","source":"data:;base64,H4sIAAAAAAAC/5TMPa7CMBDE8X4P41Ve9YjkE3AEhJCTjBy0/lh5HURuj0KBaOlm/sXvItuEVtBhVyohw58/gaZg2Frya+9qI7NKNCf/5u6V59owsvUwJYz8GNzfiZtmJpQjLX6gqHFeMYsfqEHr7etHjYL9J/ggltDDe+TFPXNygp1eAQAA//9ze8vVwgAAAA=="},"mode":420},{"overwrite":true,"path":"/etc/modules-load.d/br_netfilter.conf","contents":{"compression":"","source":"data:,br_netfilter"},"mode":420},{"overwrite":true,"path":"/etc/sysctl.d/kubernetes.conf","contents":{"compression":"","source":"data:,net.bridge.bridge-nf-call-iptables%3D1%0Anet.ipv4.ip_forward%3D1%0A"},"mode":420},{"overwrite":true,"path":"/usr/local/bin/install-kubelet.sh","contents":{"compression":"","source":"data:,%23!%2Fbin%2Fbash%0Arpm-ostree%20install%20kubelet%20kubeadm%20kubectl%20cri-o%0Asystemctl%20enable%20crio%20kubelet%0Asystemctl%20reboot%0A"},"mode":484}]},"systemd":{"units":[{"contents":"[Unit]\nBefore=systemd-user-sessions.service\nWants=network-online.target\nAfter=network-online.target\nConditionPathExists=!/var/lib/install-kubelet\n\n[Service]\nType=oneshot\nExecStart=/usr/local/bin/install-kubelet.sh\nExecStartPost=/usr/bin/touch /var/lib/install-kubelet\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"install-kubelet.service"}]}}