... | ... | @@ -13,9 +13,9 @@ EOF |
|
|
|
|
|
```bash
|
|
|
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
|
|
|
net.bridge.bridge-nf-call-ip6tables = 1
|
|
|
net.bridge.bridge-nf-call-iptables = 1
|
|
|
net.ipv4.ip_forward = 1
|
|
|
net.bridge.bridge-nf-call-ip6tables = 1
|
|
|
EOF
|
|
|
sudo sysctl --system
|
|
|
```
|
... | ... | @@ -31,8 +31,6 @@ containerd config default | sudo tee /etc/containerd/config.toml |
|
|
sudo systemctl restart containerd
|
|
|
```
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Kubernetes installation and cluster initialisation
|
|
|
|
|
|
```bash
|
... | ... | @@ -40,26 +38,25 @@ sudo apt-get update && sudo apt-get install -y apt-transport-https bash-completi |
|
|
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
|
|
sudo add-apt-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
|
|
|
sudo apt-get update && apt-cache madison kubeadm
|
|
|
sudo apt-get install -y kubeadm=1.23.7-00 kubectl=1.23.7-00 kubelet=1.23.7-00
|
|
|
sudo apt-get install -y kubeadm=1.25.2-00 kubectl=1.25.2-00 kubelet=1.25.2-00
|
|
|
sudo apt-mark hold kubeadm kubectl kubelet
|
|
|
source <(kubectl completion bash) && echo "source <(kubectl completion bash)" >> ~/.bashrc
|
|
|
source <(kubeadm completion bash) && echo "source <(kubeadm completion bash)" >> ~/.bashrc
|
|
|
```
|
|
|
|
|
|
```bash
|
|
|
sudo kubeadm init --cri-socket=/var/run/containerd/containerd.sock --pod-network-cidr 192.168.0.0/16 | tee kube-init.log
|
|
|
sudo kubeadm init | tee kube-init.log
|
|
|
# sudo kubeadm init --cri-socket=/var/run/containerd/containerd.sock --pod-network-cidr 192.168.0.0/16 | tee kube-init.log
|
|
|
mkdir -p $HOME/.kube
|
|
|
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
|
|
sudo chown $(id -u):$(id -g) $HOME/.kube/config
|
|
|
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
|
|
|
kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml
|
|
|
# kubectl create -f https://projectcalico.docs.tigera.io/manifests/tigera-operator.yaml
|
|
|
# kubectl create -f https://projectcalico.docs.tigera.io/manifests/custom-resources.yaml
|
|
|
kubectl taint nodes --all node-role.kubernetes.io/master-
|
|
|
# kubectl taint nodes --all node-role.kubernetes.io/master-
|
|
|
watch kubectl get node,pod -o wide --all-namespaces
|
|
|
```
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## gVisor installation and creation of Runtime Class
|
|
|
|
|
|
```bash
|
... | ... | @@ -86,13 +83,9 @@ EOF |
|
|
sudo systemctl restart containerd
|
|
|
```
|
|
|
|
|
|
|
|
|
```bash
|
|
|
kubectl apply -f runtime-class/gvisor-runtime-class.yaml
|
|
|
kubectl apply -f runtime-class/gvisor-demo-app.yaml
|
|
|
```
|
|
|
|
|
|
<br />
|
|
|
|
|
|
more info: [container runtimes](https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd),
|
|
|
[containerd installation](https://docs.docker.com/engine/install/ubuntu/), [gVisor installation](https://gvisor.dev/docs/user_guide/containerd/quick_start/) |
|
|
\ No newline at end of file |
|
|
more info: [container runtimes](https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd), [containerd installation](https://docs.docker.com/engine/install/ubuntu/), [gVisor installation](https://gvisor.dev/docs/user_guide/containerd/quick_start/) |
|
|
\ No newline at end of file |