Skip to content

Commit

Permalink
update setup scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Jaehyun Nam <[email protected]>
  • Loading branch information
nam-jaehyun committed Jul 3, 2022
1 parent a8bf185 commit 27bb664
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
23 changes: 9 additions & 14 deletions contribution/self-managed-k8s-selinux/crio/install_crio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@

. /etc/os-release

if [[ "$NAME" != "CentOS Linux" ] || [ "$VERSION" != "8" ]]; then
if [ "$NAME" != "CentOS Linux" ] && [ "$VERSION" != "8" ]; then
echo "Support CentOS 8"
exit
fi

OS="CentOS_${VERSION_ID}"
VERSION=1.19

if [ "$NAME" == "CentOS Stream" ]; then
OS="${OS}_Stream"
fi

# remove podman
sudo yum remove buildah skopeo podman containers-common atomic-registries docker container-tools
sudo yum remove -y buildah skopeo podman containers-common atomic-registries docker container-tools

# remove left-over files
sudo rm -rf /etc/containers/* /var/lib/containers/* /etc/docker /etc/subuid* /etc/subgid*
Expand All @@ -27,10 +20,12 @@ cd ~ && rm -rf /.local/share/containers/
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

# setup repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo

sudo yum install cri-o containernetworking-plugins
VERSION=1.22
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable rhcontainerbot/container-selinux
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_8/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_8/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo
sudo yum install -y cri-o cri-tools containernetworking-plugins

sudo systemctl daemon-reload
sudo systemctl start crio.service
sudo systemctl enable --now crio
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
DOCKER_INSTALL=`dirname $(realpath "$0")`

# remove podman
sudo yum remove buildah skopeo podman containers-common atomic-registries docker container-tools
sudo yum remove -y buildah skopeo podman containers-common atomic-registries docker container-tools

# remove left-over files
sudo rm -rf /etc/containers/* /var/lib/containers/* /etc/docker /etc/subuid* /etc/subgid*
Expand Down
2 changes: 1 addition & 1 deletion contribution/self-managed-k8s/crio/install_crio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/

# install
sudo apt-get update
sudo apt-get install cri-o cri-o-runc
sudo apt-get install -y cri-o cri-o-runc

# this option is not supported in ubuntu 18.04
if [ "$VERSION_ID" == "18.04" ]; then
Expand Down
4 changes: 2 additions & 2 deletions contribution/vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Vagrant.configure("2") do |config|

if ENV['K8S'] == "kubeadm" then
# install Kubernetes
config.vm.provision :shell, :inline => "RUNTIME=crio /home/vagrant/KubeArmor/contribution/self-managed-k8s-selinux/k8s/install_kubernetes.sh"
config.vm.provision :shell, :inline => "/home/vagrant/KubeArmor/contribution/self-managed-k8s-selinux/k8s/install_kubernetes.sh"

# initialize Kubernetes
config.vm.provision :shell, :inline => "CNI=cilium MASTER=true /home/vagrant/KubeArmor/contribution/self-managed-k8s-selinux/k8s/initialize_kubernetes.sh"
Expand Down Expand Up @@ -108,7 +108,7 @@ Vagrant.configure("2") do |config|

if ENV['K8S'] == "kubeadm" then
# install Kubernetes
config.vm.provision :shell, :inline => "RUNTIME=containerd /home/vagrant/KubeArmor/contribution/self-managed-k8s/k8s/install_kubernetes.sh"
config.vm.provision :shell, :inline => "/home/vagrant/KubeArmor/contribution/self-managed-k8s/k8s/install_kubernetes.sh"

# initialize Kubernetes
config.vm.provision :shell, :inline => "CNI=cilium MASTER=true /home/vagrant/KubeArmor/contribution/self-managed-k8s/k8s/initialize_kubernetes.sh"
Expand Down

0 comments on commit 27bb664

Please sign in to comment.