You should have received the setup document. In addition to that, please prepare the steps below prior to the course. The connection in the trainng room can be slow, so this way we don't loose time.
These instructions are based on Fedora.
Ensure dnf-plugins-core
is installed (this provides commands to manage repositories)
$ sudo dnf -y install dnf-plugins-core
Then add the docker repository
$ sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
You are now ready to install docker
$ sudo dnf install -y docker-ce docker-ce-cli containerd.io
Then enable and start the docker daemon
$ sudo systemctl enable docker && sudo systemctl start docker
Add yourself to the docker group
$ sudo usermod -aG docker $USER
If you are running Fedora 31, then you need to downgrade cgroups to v1 (check with your instructor if this perhaps has been done in advance)
$ sudo dnf install grubby
$ sudo grubby --update-kernel=ALL \
--args="systemd.unified_cgroup_hierarchy=0"
Before you can continue with the steps below, You'll need to reboot your machine.
Execute the following commands:
-
Become root
$ sudo su
-
Add the yum package
$ cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF
-
Then install kubectl
$ sudo dnf install -y kubectl-1.14.7
Run the following command:
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
Then make it globally available:
$ sudo install minikube /usr/local/bin/
Let's begin by starting a minikube cluster on your machine. Open a terminal window and run the following command (adjust cpus/memory according to your system)
$ minikube start --kubernetes-version v1.14.7 --vm-driver virtualbox \
--cpus=2 --memory=8196 --insecure-registry=nexus-docker.minikube --extra-config=kubelet.authentication-token-webhook=true \
--extra-config=scheduler.address=0.0.0.0 \
--extra-config=controller-manager.address=0.0.0.0
…
(The insecure-registry
is used for a later lab)
If this the first run, then it might take some time to get the cluster up and running.
When it's running get its status:
$ minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
If you later want to start minikube and you omit the version, it will automatically upgrade to latest supported kubernetes version. This behaviour will most likely change soon, but for now change the default version:
$ minikube config set kubernetes-version v1.14.7
Run the following command to pull some images we will be using during the course
$ minikube ssh docker pull k8s.gcr.io/metrics-server-amd64:v0.3.6 \
&& docker pull node:10-alpine \
&& docker pull mongo \
&& docker pull pietervogelaar/kubernetes-job-monitor:latest \
&& docker pull hseeberger/scala-sbt:11.0.4_1.3.4_2.12.10 \
&& docker pull edc4it/evilcall:1.0 \
&& docker pull gradle:4.8-jdk-alpine \
&& docker pull openjdk:8-jdk-alpine \
&& docker pull centos:7 \
&& docker pull alpine:latest \
&& docker pull sonatype/nexus3:3.19.1 \
&& docker pull edc4it/rest-countries:1.1-final \
&& docker pull edc4it/coursedb:2.1 \
&& docker pull alpine/git \
&& docker pull nginx \
&& docker pull kiwigrid/k8s-sidecar:0.1.20 \
&& docker pull grafana/grafana:6.4.2 \
&& docker pull quay.io/prometheus/node-exporter:v0.18.1 \
&& docker pull quay.io/coreos/prometheus-operator:v0.34.0 \
&& docker pull squareup/ghostunnel:v1.4.1 \
&& docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.4 \
&& docker pull docker.elastic.co/kibana/kibana:6.5.4 \
&& docker pull fluent/fluentd-kubernetes-daemonset:v1.7-debian-elasticsearch6-1
You can stop your minikube:
$ minikube stop