2020-02-02 00:10:40 +01:00
|
|
|
---
|
|
|
|
variant: fcos
|
2023-04-17 18:34:33 +02:00
|
|
|
version: 1.5.0
|
2020-02-02 00:10:40 +01:00
|
|
|
systemd:
|
|
|
|
units:
|
2022-01-12 05:40:17 +01:00
|
|
|
- name: containerd.service
|
2020-02-02 00:10:40 +01:00
|
|
|
enabled: true
|
2022-01-14 19:10:32 +01:00
|
|
|
- name: docker.service
|
|
|
|
mask: true
|
2020-02-02 00:10:40 +01:00
|
|
|
- name: wait-for-dns.service
|
|
|
|
enabled: true
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Wait for DNS entries
|
|
|
|
Before=kubelet.service
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=true
|
|
|
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
|
|
|
[Install]
|
|
|
|
RequiredBy=kubelet.service
|
|
|
|
- name: kubelet.service
|
|
|
|
enabled: true
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
2020-04-26 01:50:51 +02:00
|
|
|
Description=Kubelet (System Container)
|
2020-02-02 00:10:40 +01:00
|
|
|
Wants=rpc-statd.service
|
|
|
|
[Service]
|
2023-06-16 17:28:17 +02:00
|
|
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.27.3
|
2021-04-02 08:45:19 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /etc/cni/net.d
|
2020-02-02 00:10:40 +01:00
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
|
|
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/calico
|
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
|
|
|
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
|
|
|
ExecStartPre=-/usr/bin/podman rm kubelet
|
|
|
|
ExecStart=/usr/bin/podman run --name kubelet \
|
2022-08-27 19:30:41 +02:00
|
|
|
--log-driver k8s-file \
|
2020-02-02 00:10:40 +01:00
|
|
|
--privileged \
|
|
|
|
--pid host \
|
|
|
|
--network host \
|
2021-04-02 08:45:19 +02:00
|
|
|
--volume /etc/cni/net.d:/etc/cni/net.d:ro,z \
|
2020-02-02 00:10:40 +01:00
|
|
|
--volume /etc/kubernetes:/etc/kubernetes:ro,z \
|
|
|
|
--volume /usr/lib/os-release:/etc/os-release:ro \
|
2022-04-02 00:32:29 +02:00
|
|
|
--volume /etc/machine-id:/etc/machine-id:ro \
|
2020-02-02 00:10:40 +01:00
|
|
|
--volume /lib/modules:/lib/modules:ro \
|
|
|
|
--volume /run:/run \
|
2021-04-17 20:45:52 +02:00
|
|
|
--volume /sys/fs/cgroup:/sys/fs/cgroup \
|
2022-04-26 19:01:09 +02:00
|
|
|
--volume /etc/selinux:/etc/selinux \
|
|
|
|
--volume /sys/fs/selinux:/sys/fs/selinux \
|
2020-02-19 06:40:58 +01:00
|
|
|
--volume /var/lib/calico:/var/lib/calico:ro \
|
2022-01-12 05:40:17 +01:00
|
|
|
--volume /var/lib/containerd:/var/lib/containerd \
|
2020-02-02 00:10:40 +01:00
|
|
|
--volume /var/lib/kubelet:/var/lib/kubelet:rshared,z \
|
|
|
|
--volume /var/log:/var/log \
|
|
|
|
--volume /var/run/lock:/var/run/lock:z \
|
|
|
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
2020-05-20 07:39:53 +02:00
|
|
|
$${KUBELET_IMAGE} \
|
2020-04-26 01:50:51 +02:00
|
|
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
2022-08-27 18:17:33 +02:00
|
|
|
--config=/etc/kubernetes/kubelet.yaml \
|
2022-01-12 05:40:17 +01:00
|
|
|
--container-runtime-endpoint=unix:///run/containerd/containerd.sock \
|
2020-04-26 01:50:51 +02:00
|
|
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
2020-02-23 00:01:57 +01:00
|
|
|
%{~ for label in split(",", node_labels) ~}
|
2020-02-02 00:10:40 +01:00
|
|
|
--node-labels=${label} \
|
2020-02-23 00:01:57 +01:00
|
|
|
%{~ endfor ~}
|
2021-04-11 21:08:56 +02:00
|
|
|
%{~ for taint in split(",", node_taints) ~}
|
|
|
|
--register-with-taints=${taint} \
|
|
|
|
%{~ endfor ~}
|
2022-08-27 18:17:33 +02:00
|
|
|
--node-labels=node.kubernetes.io/node
|
2020-02-02 00:10:40 +01:00
|
|
|
ExecStop=-/usr/bin/podman stop kubelet
|
|
|
|
Delegate=yes
|
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
storage:
|
|
|
|
directories:
|
|
|
|
- path: /etc/kubernetes
|
|
|
|
files:
|
|
|
|
- path: /etc/kubernetes/kubeconfig
|
|
|
|
mode: 0644
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
${kubeconfig}
|
2022-08-27 18:17:33 +02:00
|
|
|
- path: /etc/kubernetes/kubelet.yaml
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
apiVersion: kubelet.config.k8s.io/v1beta1
|
|
|
|
kind: KubeletConfiguration
|
|
|
|
authentication:
|
|
|
|
anonymous:
|
|
|
|
enabled: false
|
|
|
|
webhook:
|
|
|
|
enabled: true
|
|
|
|
x509:
|
|
|
|
clientCAFile: /etc/kubernetes/ca.crt
|
|
|
|
authorization:
|
|
|
|
mode: Webhook
|
|
|
|
cgroupDriver: systemd
|
|
|
|
clusterDNS:
|
|
|
|
- ${cluster_dns_service_ip}
|
|
|
|
clusterDomain: ${cluster_domain_suffix}
|
|
|
|
healthzPort: 0
|
|
|
|
rotateCertificates: true
|
2022-11-02 01:23:31 +01:00
|
|
|
shutdownGracePeriod: 45s
|
|
|
|
shutdownGracePeriodCriticalPods: 30s
|
2022-08-27 18:17:33 +02:00
|
|
|
staticPodPath: /etc/kubernetes/manifests
|
|
|
|
readOnlyPort: 0
|
|
|
|
resolvConf: /run/systemd/resolve/resolv.conf
|
|
|
|
volumePluginDir: /var/lib/kubelet/volumeplugins
|
2022-08-28 18:49:28 +02:00
|
|
|
- path: /etc/systemd/logind.conf.d/inhibitors.conf
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
[Login]
|
|
|
|
InhibitDelayMaxSec=45s
|
2020-02-02 00:10:40 +01:00
|
|
|
- path: /etc/sysctl.d/max-user-watches.conf
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
fs.inotify.max_user_watches=16184
|
2020-06-16 07:42:57 +02:00
|
|
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
net.ipv4.conf.default.rp_filter=0
|
|
|
|
net.ipv4.conf.*.rp_filter=0
|
2020-08-02 06:00:39 +02:00
|
|
|
- path: /etc/systemd/network/50-flannel.link
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
[Match]
|
|
|
|
OriginalName=flannel*
|
|
|
|
[Link]
|
|
|
|
MACAddressPolicy=none
|
2020-02-02 00:10:40 +01:00
|
|
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
[Manager]
|
|
|
|
DefaultCPUAccounting=yes
|
|
|
|
DefaultMemoryAccounting=yes
|
|
|
|
DefaultBlockIOAccounting=yes
|
2022-01-12 05:40:17 +01:00
|
|
|
- path: /etc/containerd/config.toml
|
|
|
|
overwrite: true
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
version = 2
|
|
|
|
root = "/var/lib/containerd"
|
|
|
|
state = "/run/containerd"
|
|
|
|
subreaper = true
|
|
|
|
oom_score = -999
|
|
|
|
[grpc]
|
|
|
|
address = "/run/containerd/containerd.sock"
|
|
|
|
uid = 0
|
|
|
|
gid = 0
|
|
|
|
[plugins."io.containerd.grpc.v1.cri"]
|
|
|
|
enable_selinux = true
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
|
|
|
|
runtime_type = "io.containerd.runc.v2"
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
|
|
|
|
SystemdCgroup = true
|
2020-02-02 00:10:40 +01:00
|
|
|
passwd:
|
|
|
|
users:
|
|
|
|
- name: core
|
|
|
|
ssh_authorized_keys:
|
|
|
|
- ${ssh_authorized_key}
|
|
|
|
|