-
Notifications
You must be signed in to change notification settings - Fork 70
Clear Containers and Kubernetes
This documents how to get Kubernetes running with Clear Containers using CRIO.
Kubernetes is a Google project and the dominant container orchestration engine.
Kubernetes clusters run containers pods. Inside a pod, all containers share the pod resources (networking, storage, etc...) and all pods within a cluster have their own IP address.
By default Kubernetes runs the full Docker stack to start pods and containers within a pod. Rkt is an alternative container runtime for Kubernetes.
A Docker controlled Clear Container will start one VM per container. Providing the kubernetes pod semantics with one VM per container is very challenging, especially from a networking standpoint. Instead Clear Containers should be able to start one VM per pod and launch containers within those VMs/Pods.
With the recent addition of the Container Runtime Interface (CRI) to Kubernetes, Clear Containers can now be controlled by any OCI compatible CRI implementation and get passed container annotations to let it know when and how to run Pod VMs or container workload within those VMs.
CRI-O is the main OCI compatible CRI implementation and now supports Clear Containers.
We are going to describe how to deploy a bare metal Kubernetes cluster that uses Clear Containers as its container runtime and CRI-O as its CRI server.
Ubuntu 16.04 LTS
github.com/containernetworking/plugins: v0.7.0
github.com/opencontainers/runc: v1.0.0-rc4
$kubelet --version
Kubernetes v1.9.2
$kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
$ kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
github.com/kubernetes-incubator/cri-o: v1.9.0
github.com/clearcontainers/proxy: v3.0.21
github.com/clearcontainers/runtime: v3.0.21
github.com/clearcontainers/shim: v3.0.21
- go 1.9.2:
wget https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz
sudo tar -xvf go1.9.2.linux-amd64.tar.gz -C /usr/local/
mkdir -p $HOME/go/src
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
go version
- Clone clearcontainers/tests repository
go get github.com/clearcontainers/tests
-
Execute the setup
This step will install Kubernetes, CRI-O, Clear Containers components and will make correct configurations to run Kubernetes on top of Clear Containers.
cd $GOPATH/src/github.com/clearcontainers/tests
.ci/setup.sh
- Initialize Kubernetes
cd $GOPATH/src/github.com/clearcontainers/tests/integration/kubernetes
./init.sh
- Test your Kubernetes implementation:
bats nginx.bats
-
Cleanup environment (optional)
To stop Kubernetes services and clean all containers/pods created, execute:
./cleanup_env.sh
Usage
Development
Process