reconfigure kubelet
parent
df2395ff1b
commit
264855e764
|
@ -190,8 +190,7 @@ docker.io/library/busybox:latest application/vnd.docker.distribution.manifest.li
|
||||||
|
|
||||||
Now, let's start our container
|
Now, let's start our container
|
||||||
```bash
|
```bash
|
||||||
ctr run --detach --snapshotter native docker.io/library/busybox:latest busybox-container sh -c 'echo "Hello"'
|
ctr run --rm --snapshotter native docker.io/library/busybox:latest busybox-container sh -c 'echo "Hello"'
|
||||||
ctr run --detach docker.io/library/busybox:latest busybox-container sh -c 'echo "Hello"'
|
|
||||||
ctr run --detach --runtime io.containerd.runc.v2 --snapshotter native docker.io/library/busybox:latest busybox-container sh -c 'sleep 3600'
|
ctr run --detach --runtime io.containerd.runc.v2 --snapshotter native docker.io/library/busybox:latest busybox-container sh -c 'sleep 3600'
|
||||||
ctr run --detach docker.io/library/busybox:latest busybox-container sh -c 'echo "Hello from container runned by containerd!"'
|
ctr run --detach docker.io/library/busybox:latest busybox-container sh -c 'echo "Hello from container runned by containerd!"'
|
||||||
```
|
```
|
||||||
|
|
|
@ -24,6 +24,11 @@ First of all, we need to download kubelet.
|
||||||
```bash
|
```bash
|
||||||
wget -q --show-progress --https-only --timestamping \
|
wget -q --show-progress --https-only --timestamping \
|
||||||
https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/amd64/kubelet
|
https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/amd64/kubelet
|
||||||
|
|
||||||
|
wget -q --show-progress --https-only --timestamping \
|
||||||
|
https://dl.k8s.io/v1.32.3/kubernetes-node-linux-amd64.tar.gz
|
||||||
|
|
||||||
|
tar -xvzf kubernetes-node-linux-amd64.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
After download process complete, move kubelet binaries to the proper folder
|
After download process complete, move kubelet binaries to the proper folder
|
||||||
|
@ -34,9 +39,14 @@ After download process complete, move kubelet binaries to the proper folder
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x kubernetes/node/bin/kubelet \
|
||||||
|
&& mv kubernetes/node/bin/kubelet /usr/local/bin/
|
||||||
|
```
|
||||||
|
|
||||||
As kubelet is a service that is used to manage pods running on the node, we need to configure that service
|
As kubelet is a service that is used to manage pods running on the node, we need to configure that service
|
||||||
```bash
|
```bash
|
||||||
cat <<EOF | sudo tee /etc/systemd/system/kubelet.service
|
cat <<EOF | tee /etc/systemd/system/kubelet.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=kubelet: The Kubernetes Node Agent
|
Description=kubelet: The Kubernetes Node Agent
|
||||||
Documentation=https://kubernetes.io/docs/home/
|
Documentation=https://kubernetes.io/docs/home/
|
||||||
|
@ -45,9 +55,7 @@ After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/kubelet \\
|
ExecStart=/usr/local/bin/kubelet \\
|
||||||
--container-runtime=remote \\
|
|
||||||
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \\
|
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \\
|
||||||
--image-pull-progress-deadline=2m \\
|
|
||||||
--file-check-frequency=10s \\
|
--file-check-frequency=10s \\
|
||||||
--pod-manifest-path='/etc/kubernetes/manifests/' \\
|
--pod-manifest-path='/etc/kubernetes/manifests/' \\
|
||||||
--v=10
|
--v=10
|
||||||
|
@ -67,16 +75,14 @@ The main configuration parameters here:
|
||||||
|
|
||||||
After our service is configured, we can start it
|
After our service is configured, we can start it
|
||||||
```bash
|
```bash
|
||||||
{
|
systemctl daemon-reload \
|
||||||
sudo systemctl daemon-reload
|
&& systemctl enable kubelet \
|
||||||
sudo systemctl enable kubelet
|
&& systemctl start kubelet
|
||||||
sudo systemctl start kubelet
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To ensure that our service successfully started, run
|
To ensure that our service successfully started, run
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl status kubelet
|
systemctl status kubelet
|
||||||
```
|
```
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
|
@ -100,10 +106,7 @@ After kubelet service is up and running, we can start creating our pods.
|
||||||
Before we will create static pod manifests, we need to create folders where we will place our pods (same as we configured in kubelet)
|
Before we will create static pod manifests, we need to create folders where we will place our pods (same as we configured in kubelet)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
{
|
mkdir -p /etc/kubernetes/manifests
|
||||||
mkdir /etc/kubernetes
|
|
||||||
mkdir /etc/kubernetes/manifests
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
After the directory is created, we can create a static pod with busybox container inside
|
After the directory is created, we can create a static pod with busybox container inside
|
||||||
|
@ -182,16 +185,14 @@ In comparison to the ctr (which can work with containerd only), crictl is a tool
|
||||||
So, let's download crictl binaries
|
So, let's download crictl binaries
|
||||||
```bash
|
```bash
|
||||||
wget -q --show-progress --https-only --timestamping \
|
wget -q --show-progress --https-only --timestamping \
|
||||||
https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-linux-amd64.tar.gz
|
https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.32.0/crictl-v1.32.0-linux-amd64.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
After the download process is complete, move crictl binaries to the proper folder
|
After the download process is complete, move crictl binaries to the proper folder
|
||||||
```bash
|
```bash
|
||||||
{
|
tar -xvf crictl-v1.32.0-linux-amd64.tar.gz \
|
||||||
tar -xvf crictl-v1.21.0-linux-amd64.tar.gz
|
&& chmod +x crictl \
|
||||||
chmod +x crictl
|
&& mv crictl /usr/local/bin/
|
||||||
sudo mv crictl /usr/local/bin/
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
And configure it a bit
|
And configure it a bit
|
||||||
|
@ -253,10 +254,8 @@ rm /etc/kubernetes/manifests/static-pod.yml
|
||||||
|
|
||||||
It takes some time to remove the pods, we can ensure that pods are deleted by running
|
It takes some time to remove the pods, we can ensure that pods are deleted by running
|
||||||
```bash
|
```bash
|
||||||
{
|
crictl pods \
|
||||||
crictl pods
|
&& crictl ps
|
||||||
crictl ps
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The output should be empty.
|
The output should be empty.
|
||||||
|
|
Loading…
Reference in New Issue