Cri-o: calico not working on fresh k8s installation with cri-o as CRI

Created on 3 Jun 2020  路  9Comments  路  Source: cri-o/cri-o

Description

Following the guide on kubernetes installation, I wanted to try the combination:

cri-o as container runtime
calico as cni plugin

The scenario is an HA install with:

2 Master nodes
2+ worker nodes

I am actually able to install cri-o and deploy the first master, set the --pod-network-cidr during kubeadm init phase then the problem rises.

By default, cri-o uses the crio-bridge cni in /etc/cni/net.d, and when calico gets installed, it should switch on the newly created config for calico on the same dir BUT!

Jun 聽3 21:35:01 k8s-master-0 crio: time="2020-06-03 21:35:01.707957151Z" level=warning msg="Error validating CNI config file /etc/cni/net.d/10-calico.conflist: [failed to find plugin \"calico\" in path [/usr/libexec/cni]]"
Because calico plugin is in:
[kube@k8s-master-0 ~]$ ls /opt/cni/bin/ |grep calico
calico
calico-ipam

Why just dont add to default plugin dirs in /etc/crio/crio.conf the聽/opt/cni/bin/ directory?
Default config of cri-o doesn't take into account that plugin dir, making it incompatible with suggested cni plugin for k8s.

Steps to reproduce the issue:

  1. Install cri-o
  2. Bootstrap first k8s master
  3. Install calico CNI plugin4. Enjoy your pods being scheduled with the same IP on all nodes. (lol)

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):
Happens every time, at the moment combination k8s-cri-o-calico is聽 not working.
Output of crio --version:

[kube@k8s-master-0 ~]$ crio --version
crio version 
Version: 聽 聽 聽 1.18.0
GitCommit: 聽 聽 
GitTreeState: 聽
BuildDate: 聽 聽 
GoVersion: 聽 聽 go1.13.6
Compiler: 聽 聽 聽gc
Platform: 聽 聽 聽linux/amd64
Linkmode: 聽 聽 聽unknown: `ldd /home/kube/crio` failed: ldd: /home/kube/crio: No such file or directory

Additional environment details (AWS, VirtualBox, physical, etc.): libvirt

fedora packaging

All 9 comments

interesting, from what I can tell, the default plugin_dirs is [/opt/cni/bin]

how did you install cri-o? and (for sanity check) what's the output of crio config | grep -A 3 plugin_dirs

crio config | grep -A 3 plugin_dirs

I followed the instructions on kubernetes website:


On centos/rhel7:

# Install prerequisites
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_7/devel:kubic:libcontainers:stable.repo
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:1.18.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:1.18/CentOS_7/devel:kubic:libcontainers:stable:cri-o:1.18.repo
# Install CRI-O
yum install -y cri-o

Below you can find what outputs from my config:

[kube@k8s-master-0 ~]$ crio config | grep -A 3 plugin_dirs
INFO Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL
plugin_dirs = [
"/usr/libexec/cni",
]

also, while we're at it, what's
crio config | grep network_dir

I will look at this tomorrow and see what's going on

[kube@k8s-master-0 ~]$ crio config | grep network_dir
INFO Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL

CRI-O will pick-up the first one found in network_dir.

network_dir = "/etc/cni/net.d/"

Please don't hesitate to assing me tasks if you need further analysis, if I can help, it would be a pleasure.

@dougsland should be putting up a fix soon :smiley:

I can confirm that changing crio.conf to handle /opt/cni/bin instead of /usr/libexec/cni/ makes everything work like a charm.

@kubealex I believe this is fixed. can this ticket be closed?

Uhm, actually it isn't.

[kube@k8s-master-0 ~]$ crio config | grep -A 3 plugin_dirs
INFO Using default capabilities: CAP_NET_RAW, CAP_MKNOD, CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL
plugin_dirs = [
"/usr/libexec/cni",
]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saschagrunert picture saschagrunert  路  8Comments

outcoldman picture outcoldman  路  9Comments

runcom picture runcom  路  3Comments

cyphar picture cyphar  路  7Comments

kolyshkin picture kolyshkin  路  5Comments