adding install vm butane config

This commit is contained in:
Philippe Caseiro 2022-12-02 11:21:39 +01:00
parent b553c21704
commit 92d3e8c147
2 changed files with 3 additions and 109 deletions

View File

@ -38,8 +38,6 @@ storage:
label: ROOT label: ROOT
files: files:
- path: /opt/ignition.json - path: /opt/ignition.json
filesystem: root mode: 0700
mode: 700
contents: contents:
remote: source: http://192.168.40.3/leader.json
url: http://192.168.40.3/leader.json

View File

@ -1,105 +1 @@
{ {"ignition":{"version":"3.3.0"},"passwd":{"users":[{"groups":["wheel","sudo"],"name":"cadoles","passwordHash":"$y$j9T$7dNoyJBSiQ5dJ6.kLs17I0$G9VVQkBUddW2E6TVQchecSE94jNxLz4F3wguz5QkvD8","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDph3zh6ojSvH44k13z9B6xj+Hargo3uzkxnYv5s5NI4yagNuBXEc3aS++KdocND+FtVfLK+iVE8qHo2bvmpMmVkqU6WU2apN7DfIP0QGLlSGeo+UOZ9hGeEDlgVO4AOnZKZ5kPGBEPZ84JXuE9CmhKfwEVCK8w3B8XQttA8alFl4A4/4F14x2w4njsSLY1H3b0qah7hgYKU5zHIGLg8Lxx+1BxGIF0l5n5m5rqAskRNaF+aYbs0CcWHv49bPK0sJJ0qPV2r2sq8BlzuZFHExnZRIxpsIXdce4Bm4rdlGi7tBmmurLk4OOtDkwvhD0LMaNJf10k6QLSmRUTVzgsYz/dmGxopbMtwwIXkwi014uSZgi8wAuznXx5I4j2TUGPZHOVf+1iw/yaxWlgTVOSoX7ZxyhDgW5cCgZZGNzU5UWe0vUuVTB+hfSMj50/Q6+Vi92/mDMbPhm4nBoVzD5DT15mB+yGyN45Ej61m0JzVUyZexfvVaffEug1/u5dnwilP0WGKr4i2OXxOXtvSdAs5rlZjvppZk6IxRCwXIcPwEFL97ZrQZAxlVS5Nh+ZnlSwTe3zfQhzHj1ao0AdCAHFPUEdoUPJhSb0OjyCvZ9XZ1KCkXhuhuN/3IUhuoWl4soNCeC3KmU/USx1wda438Exj0hM1mTyBZScDPGyD9nw78DGw== Philippe Caseiro"]}]},"storage":{"disks":[{"device":"/dev/vda","partitions":[{"label":"ROOT"}],"wipeTable":true}],"files":[{"path":"/opt/ignition.json","contents":{"source":"http://192.168.40.3/leader.json"},"mode":448}],"filesystems":[{"device":"/dev/disk/by-partlabel/ROOT","format":"btrfs","label":"ROOT","path":"/","wipeFilesystem":true}]},"systemd":{"units":[{"contents":"[Unit]\nRequires=network-online.target\nAfter=network-online.target\n[Service]\nType=forking\nTimeoutStartSec=600\nRemainAfterExit=yes\nExecStart=/usr/bin/sh -c \"flatcar-install -d /dev/vda -i /opt/ignition.json \u0026\u0026 udevadm settle \u0026\u0026 systemctl reboot\"\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"installer.service"}]}}
"ignition": {
"version": "3.3.0"
},
"passwd": {
"users": [
{
"groups": [
"wheel",
"sudo"
],
"name": "cadoles",
"passwordHash": "$y$j9T$7dNoyJBSiQ5dJ6.kLs17I0$G9VVQkBUddW2E6TVQchecSE94jNxLz4F3wguz5QkvD8",
"sshAuthorizedKeys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDph3zh6ojSvH44k13z9B6xj+Hargo3uzkxnYv5s5NI4yagNuBXEc3aS++KdocND+FtVfLK+iVE8qHo2bvmpMmVkqU6WU2apN7DfIP0QGLlSGeo+UOZ9hGeEDlgVO4AOnZKZ5kPGBEPZ84JXuE9CmhKfwEVCK8w3B8XQttA8alFl4A4/4F14x2w4njsSLY1H3b0qah7hgYKU5zHIGLg8Lxx+1BxGIF0l5n5m5rqAskRNaF+aYbs0CcWHv49bPK0sJJ0qPV2r2sq8BlzuZFHExnZRIxpsIXdce4Bm4rdlGi7tBmmurLk4OOtDkwvhD0LMaNJf10k6QLSmRUTVzgsYz/dmGxopbMtwwIXkwi014uSZgi8wAuznXx5I4j2TUGPZHOVf+1iw/yaxWlgTVOSoX7ZxyhDgW5cCgZZGNzU5UWe0vUuVTB+hfSMj50/Q6+Vi92/mDMbPhm4nBoVzD5DT15mB+yGyN45Ej61m0JzVUyZexfvVaffEug1/u5dnwilP0WGKr4i2OXxOXtvSdAs5rlZjvppZk6IxRCwXIcPwEFL97ZrQZAxlVS5Nh+ZnlSwTe3zfQhzHj1ao0AdCAHFPUEdoUPJhSb0OjyCvZ9XZ1KCkXhuhuN/3IUhuoWl4soNCeC3KmU/USx1wda438Exj0hM1mTyBZScDPGyD9nw78DGw== Philippe Caseiro"
]
}
]
},
"storage": {
"disks": [
{
"device": "/dev/vda",
"partitions": [
{
"label": "ROOT"
}
],
"wipeTable": true
}
],
"files": [
{
"path": "/etc/sysctl.d/k8s.conf",
"contents": {
"compression": "",
"source": "data:,net.bridge.bridge-nf-call-ip6tables%20%3D%201%0Anet.bridge.bridge-nf-call-iptables%20%3D%201%0A"
},
"mode": 384
},
{
"path": "/root/kubeadm-config.yaml",
"contents": {
"compression": "gzip",
"source": "data:;base64,H4sIAAAAAAAC/7SSPW/bMBCGd/4Kwrs+aNmKwy1IOxRBgSAFuvPjlUqYIoXjybX/fSHHQOB06dKF03t3z/OCZg4/QSXkpOVxsTB+qo+HUofcnJQFm04cQ/JafkuBn3MawriQ4ZCTcCAOQ3CG8YKLlnYH7/eDfTBwyj62aHvXH9A+tlvV9Vs19FuFTnX7zqh+740FfDscevXgup2yvUjZ4w1jKPx+QQspk5mgZYTxoPpYamd8jii1y5OQV+II/npmMk80lnVCylOOy4RqjssYUuUDablp8sxNDBZnuGYdowRGaW4bbuHSvM8219hGVFUl/rmh57gUBt2XlMC/Mx1DGle2Ofsfi01gLVVbb3e7uq3bRvXC5cSUYwR9N8mMoDWNe60h4lz9X7eZ8vlSu6vBh6SJ8y+jbpYvi8XrGrv3nLKHlpswn8pGrO/KXJiC46e3Vy2ZFlxPfmyJ+PShPtNE8F8sa+FKuJHyMn+hcAJpWS6FMXnxJwAA///kPgS1zAIAAA=="
},
"mode": 420
}
],
"filesystems": [
{
"device": "/dev/disk/by-partlabel/ROOT",
"format": "btrfs",
"label": "ROOT",
"path": "/",
"wipeFilesystem": true
}
]
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Install CNI plugins K8S\nWants = network-online.target\nAfter = network.target network-online.target\nConditionPathExists=!/opt/cni/bin/firewall\n[Service]\nType=forking\nTimeoutStartSec=180\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"CNI_VERSION=v0.8.2\"\nEnvironment=\"ARCH=amd64\"\nEnvironment=\"URL=https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz\"\nExecStartPre=/bin/mkdir -p /opt/cni/bin\nExecStart=/bin/sh -c \"/usr/bin/curl -L ${URL} | /usr/bin/tar -C /opt/cni/bin -xz\"\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "install-cni.service"
},
{
"contents": "[Unit]\nDescription=Install crictl\nWants = network-online.target\nAfter = network.target network-online.target\nConditionPathExists=!/opt/bin/crictl\n[Service]\nType=forking\nTimeoutStartSec=180\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"DOWNLOAD_DIR=/opt/bin\"\nEnvironment=\"CRICTL_VERSION=v1.22.0\"\nEnvironment=\"ARCH=amd64\"\nEnvironment=\"URL=https://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${ARCH}.tar.gz\"\nExecStartPre=/bin/mkdir -p ${DOWNLOAD_DIR}\nExecStart=/bin/sh -c \"/usr/bin/curl -L ${URL} | /usr/bin/tar -C $DOWNLOAD_DIR -xz\"\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "install-crictl.service"
},
{
"contents": "[Unit]\nDescription=Install K8S\nWants = network-online.target\nAfter = network.target network-online.target\nConditionPathExists=!/opt/bin/kubelet\n[Service]\nWorkingDirectory=/opt/bin\nType=forking\nTimeoutStartSec=180\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"KUBE_RELEASE=v1.25.4\"\nEnvironment=\"ARCH=amd64\"\nEnvironment=\"DOWNLOAD_DIR=/opt/bin\"\nEnvironment=\"URL=https://storage.googleapis.com/kubernetes-release/release/${KUBE_RELEASE}/bin/linux/${ARCH}\"\nExecStartPre=/bin/mkdir -p ${DOWNLOAD_DIR}\nExecStart=/bin/sh -c \"/usr/bin/curl -L --remote-name-all ${URL}/{kubeadm,kubelet,kubectl}\"\nExecStartPost=/bin/sh -c \"/bin/chmod +x ${DOWNLOAD_DIR}/{kubeadm,kubelet,kubectl}\"\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "install-kubernetes.service"
},
{
"contents": "[Unit]\nDescription=Install Cilium client\nWants = network-online.target\nAfter = network.target network-online.target\nConditionPathExists=!/opt/bin/cilium\n[Service]\nWorkingDirectory=/opt/bin\nType=forking\nTimeoutStartSec=180\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"CILIUM_RELEASE=v0.12.8\"\nEnvironment=\"ARCH=amd64\"\nEnvironment=\"DOWNLOAD_DIR=/opt/bin\"\nEnvironment=\"URL=https://github.com/cilium/cilium-cli/releases/download/${CILIUM_RELEASE}/cilium-linux-${ARCH}.tar.gz\nExecStartPre=/bin/mkdir -p ${DOWNLOAD_DIR}\nExecStart=/bin/sh -c \"/usr/bin/curl -L ${URL} | /usr/bin/tar -C ${DOWNLOAD_DIR} -xz\"\n[Install]\nWantedBy=multi-user.target\n",
"enabled": false,
"name": "install-cilium.service"
},
{
"contents": "[Unit]\nDescription=The Kubernetes Node Agent\nDocumentation=https://kubernetes.io/docs/home/\nWants=network-online.target\nAfter=network-online.target\n[Service]\nExecStart=/opt/bin/kubelet\nRestart=always\nStartLimitInterval=0\nRestartSec=10\n[Install]\nWantedBy=multi-user.target\n",
"dropins": [
{
"contents": "[Service]\nEnvironment=\"KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf\"\nEnvironment=\"KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml\"\nEnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env\nEnvironmentFile=-/etc/default/kubelet\nExecStart=\nExecStart=/opt/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS\n",
"name": "10-kubeadm.conf"
}
],
"enabled": true,
"name": "kubelet.service"
},
{
"contents": "[Unit]\nDescription=Kubernetes cluster init\nDocumentation=https://kubernetes.io/docs/home/\nWants=network-online.target\nAfter=network-online.target install-kubernetes.service\nConditionPathExists=!/opt/libexec/kubernetes/kubelet-plugins/volume/exec/\n[Service]\nWorkingDirectory=/opt/bin\nType=forking\nTimeoutStartSec=360\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"caSecretKey=$(date | sha256sum | awk \\'{print $1}`')\"\nEnvironment=\"SET_HOSTNAME=leader.ks.cadoles.com\"\nEnvironment=\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/bin\"\nEnvironment=\"KUBECONFIG=/etc/kubernetes/admin.conf\"\nExecStartPre=/bin/sh -c \"/usr/bin/hostnamectl hostname ${SET_HOSTNAME}\"\nExecStart=/opt/bin/kubeadm init --config /root/kubeadm-config.yaml --upload-certs\nExecStartPost=/bin/sh -c \"/bin/mkdir -p /home/cadoles/.kube\"\nExecStartPost=/bin/sh -c \"/bin/cp -i /etc/kubernetes/admin.conf /home/cadoles/.kube/config\"\nExecStartPost=/bin/sh -c \"/bin/chown cadoles:cadoles /home/cadoles/.kube/config\"\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "init-cluster.service"
},
{
"contents": "[Unit]\nDescription=Install network CNI (calico)\nDocumentation=https://kubernetes.io/docs/home/\nWants=network-online.target\nAfter=network-online.target init-cluster.service\nConditionPathExists=!/opt/cni/bin/calico\n[Service]\nWorkingDirectory=/opt/bin\nType=forking\nTimeoutStartSec=360\nRemainAfterExit=yes\nKillMode=process\nEnvironment=\"KUBECONFIG=/etc/kubernetes/admin.conf\"\nEnvironment=\"CIDR=10.244.0.0/16\"\nEnvironment=\"URL=https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml\"\nExecStart=/opt/bin/kubectl apply -f ${URL}\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "install-network-cni.service"
}
]
}
}