post image June 28, 2022 | 1 min Read

CKS run kubernetes with cri-o

How to run Kubernetes with cri-o

echo "deb$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
echo "deb$CRIO_VERSION/$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list

curl -L$CRIO_VERSION/$OS/Release.key | sudo apt-key add -
curl -L$OS/Release.key | sudo apt-key add -

apt update
apt install cri-o cri-o-runc

sudo systemctl enable crio.service
sudo systemctl start crio.service

apt install cri-tools
Setup crictl binary
cat /etc/crictl.yaml
runtime-endpoint: "unix:///var/run/crio/crio.sock"
timeout: 0
debug: false
# runtime-endpoint: unix:///run/containerd/containerd.sock
# Run Kubernetes with CRI-O
kubeadm init --kubernetes-version=${KUBE_VERSION} --ignore-preflight-errors=NumCPU,Mem --skip-token-print --pod-network-cidr --cri-socket unix:///var/run/crio/crio.sock

# Run Kubernetes with Containerd
kubeadm init --kubernetes-version=${KUBE_VERSION} --ignore-preflight-errors=NumCPU,Mem --skip-token-print --pod-network-cidr --cri-socket unix:///run/containerd/containerd.sock

Simple Dockerfile
cat Dockerfile
FROM nginx:alpine
RUN echo "Buildha dude!" > /usr/share/nginx/html/index.html
Run locally built container via buildha
k taint node scw-k8s-cmdx
buildah -t mk:jt bud -f Dockerfile
crictl images
k run mk --image=localhost/mk:jt --expose --port 80
k get pods,svc
k edit svc mk
curl localhost:30888
author image

Jan Toth

I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …

comments powered by Disqus