# What versions to use?

**URL:** https://discuss.kubernetes.io/t/what-versions-to-use/17279
**Category:** General Discussions
**Created:** [August 31, 2021, 11:28pm UTC](https://discuss.kubernetes.io/t/what-versions-to-use/17279 "2021-08-31T23:28:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gabecz](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gabecz](https://discuss.kubernetes.io/u/gabecz)
#### Post date: [August 31, 2021, 11:28pm UTC](https://discuss.kubernetes.io/t/what-versions-to-use/17279/1 "2021-08-31T23:28:48Z")

</div>

Hi  
I’m trying to get kubernetes installed on CentOS 8, but there seems to be a version mismatch with docker-ce, selinux and [containerd.io](http://containerd.io) could i get a functioning combination of version numbers?  
i followed [How to Install a Kubernetes Cluster on CentOS 8](https://www.tecmint.com/install-a-kubernetes-cluster-on-centos-8/) click by click.  
Thanks in advance

---

<div class="post-metadata">

### Author: ![protosam](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/protosam/32/7732_2.png) [@protosam](https://discuss.kubernetes.io/u/protosam)
#### Post date: [September 6, 2021, 12:53am UTC](https://discuss.kubernetes.io/t/what-versions-to-use/17279/2 "2021-09-06T00:53:56Z")

</div>

I didn’t really put much effort into this, but just doing this seems to work for me.

## Edited: Containerd needs to be reloaded after Docker is configured.

I needed dnf-utils and tc for this setup.

```plaintext
# dnf install -y dnf-utils tc

```

Some stuff related to bridged networks and iptables.

```plaintext
# cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF

# cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF

# sysctl --system

```

Add docker repo, install docker and containerd.

```plaintext
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# dnf install -y docker-ce docker-ce-cli containerd.io

```

Configure docker for the cgroup driver.

```plaintext
cat <<EOF | sudo tee /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF

```

Enable and start containerd and docker.

```plaintext
# systemctl enable containerd
# systemctl restart containerd

# systemctl enable docker
# systemctl daemon-reload
# systemctl restart docker

```

Add the Kubernetes repo.

```plaintext
# cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF

```

Disabling selinux is lazy, but it will make just getting things up easier.

```plaintext
# setenforce 0
# sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

```

Install kube tools.

```plaintext
# dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
# systemctl enable --now kubelet

```

Initialize the cluster.

```plaintext
# kubeadm init --pod-network-cidr=192.168.0.0/16

```

Export the admin’s kubeconfig so we can use `kubectl`.

```plaintext
# export KUBECONFIG=/etc/kubernetes/admin.conf

```

You will see that coredns is not ready yet.

```plaintext
# kubectl get pods -A

```

Add a CNI then wait for things to come up.

```plaintext
# kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
# kubectl get pods -A --watch

```

Things are now runnings. There is 1 coredns replica that isn’t up. That is because I just didn’t have the sufficient CPU resources available.

```plaintext
# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-58497c65d5-hjpk6 1/1 Running 0 10m
kube-system calico-node-dxq7h 1/1 Running 0 10m
kube-system coredns-65595d68cf-vgv5m 1/1 Running 0 36s
kube-system coredns-65595d68cf-z6s5x 1/1 Running 0 36s
kube-system etcd-c01 1/1 Running 0 12m
kube-system kube-apiserver-c01 1/1 Running 0 12m
kube-system kube-controller-manager-c01 1/1 Running 0 12m
kube-system kube-proxy-r9r5w 1/1 Running 0 12m
kube-system kube-scheduler-c01 1/1 Running 0 12m

```

I had to remove the taint because the node is a master.

```plaintext
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
c01 Ready control-plane,master 14m v1.22.1

# kubectl taint nodes c01 node-role.kubernetes.io/master-

```

After this I can now run nginx.

```plaintext
# kubectl run nginx-test --image nginx
pod/nginx-test created

# kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-test 1/1 Running 0 116s

```
