Browse Source

Support cri-o in CentOS and Fedora

This commit adds support for installing cri-o as container engine in
CentOS and Fedora. Tested on CentOS 7.6 and Fedora 28.

Change-Id: I0e10e06156e02397b5cd64efe802869d0e96b231
Michał Dulko 2 months ago
parent
commit
f896c23116
1 changed files with 20 additions and 3 deletions
  1. 20
    3
      devstack/lib/crio

+ 20
- 3
devstack/lib/crio View File

@@ -48,8 +48,15 @@ function install_crio {
48 48
         # cri-o and runc. And we need podman to manage container images anyway.
49 49
         apt_get install podman buildah
50 50
     elif is_fedora; then
51
-        false
52
-        # TODO(dulek): CentOS/Fedora support
51
+        if [[ "$lsb_dist" = "centos" ]]; then
52
+            sudo yum-config-manager \
53
+                --add-repo \
54
+                https://cbs.centos.org/repos/virt7-container-common-candidate/x86_64/os/
55
+            sudo yum-config-manager \
56
+                --add-repo \
57
+                https://cbs.centos.org/repos/paas7-crio-311-candidate/x86_64/os/
58
+        fi
59
+        yum_install cri-o podman buildah
53 60
     fi
54 61
 }
55 62
 
@@ -60,7 +67,7 @@ function configure_crio {
60 67
     local crio_conf
61 68
     crio_conf=/etc/crio/crio.conf
62 69
 
63
-    # We're wrapping values in "\<val>\" because that's the format cri-o wants.
70
+    # We're wrapping values in \"<val>\" because that's the format cri-o wants.
64 71
     iniset -sudo ${crio_conf} crio.api listen \"${CRIO_ENGINE_SOCKET_FILE}\"
65 72
     if [[ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]]; then
66 73
         # debug is way too verbose, info will be enough
@@ -88,6 +95,16 @@ function configure_crio {
88 95
 registries = ['docker.io']
89 96
 EOF
90 97
         fi
98
+    elif is_fedora; then
99
+        local lsb_dist=${os_VENDOR,,}
100
+
101
+        if [[ "$lsb_dist" = "centos" ]]; then
102
+            # CentOS packages are putting runc binary in different place...
103
+            iniset -sudo ${crio_conf} crio.runtime runtime \"/usr/sbin/runc\"
104
+
105
+            # CentOS version seems to only work with cgroupfs...
106
+            iniset -sudo ${crio_conf} crio.runtime cgroup_manager \"cgroupfs\"
107
+        fi
91 108
     fi
92 109
 
93 110
     sudo systemctl --no-block restart crio.service

Loading…
Cancel
Save