October 15, 2018

Installing knative On Minikube

See the official knative docs and project on github

Since I'm on Ubuntu 16.04 which qualifies as an older system,

sudo apt install libvirt-binqemu-kvm
pm@razor:~$ sudo usermod -a -G libvirtd  $(whoami)
pm@razor:~$ newgrp libvirtd
curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
&& chmod +x docker-machine-driver-kvm2 \
&& sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \
&& rm docker-machine-driver-kvm2

Then start the vm

minikube start --memory=8192 --cpus=4 \
  --kubernetes-version=v1.11.3 \
  --vm-driver=kvm2 \
  --bootstrapper=kubeadm \
  --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"

-->

Starting local Kubernetes v1.11.3 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.


Now check the kubernetes version :

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T17:53:03Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
minikube start --memory=8192 --cpus=4 \
  --kubernetes-version=v1.11.3 \
  --vm-driver=kvm2 \
  --bootstrapper=kubeadm \
  --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook" \
  --extra-config=controller-manager.ClusterSigningKeyFile="/home/pm/.minikube/ca.key" \
  --extra-config=controller-manager.ClusterSigningCertFile="/home/pm/.minikube/ca.crt"

Now install istio

curl -L https://raw.githubusercontent.com/knative/serving/v0.1.1/third_party/istio-0.8.0/istio.yaml \
  | sed 's/LoadBalancer/NodePort/' \
  | kubectl apply --filename -


kubectl label namespace default istio-injection=enabled


The istio pods

kubectl get pods --namespace istio-system
NAME                                       READY     STATUS              RESTARTS   AGE
istio-citadel-6f875b9fdb-z477k             0/1       ContainerCreating   0          1m
istio-cleanup-old-ca-46ltq                 0/1       ContainerCreating   0          1m
istio-egressgateway-8b98f49f6-f9q5c        0/1       ContainerCreating   0          1m
istio-ingress-69c65cc9dd-jzn6z             1/1       Running             0          1m
istio-ingressgateway-657d7c54fb-95zld      0/1       ContainerCreating   0          1m
istio-pilot-7cfb4cc676-8cp5s               0/2       ContainerCreating   0          1m
istio-policy-7c4448ccf6-98zjj              0/2       ContainerCreating   0          1m
istio-sidecar-injector-fc9dd55f7-dwk6p     0/1       ContainerCreating   0          1m
istio-statsd-prom-bridge-f8fcf6c74-nhff7   0/1       CrashLoopBackOff    2          1m
istio-telemetry-785947f8c8-th8cw           0/2       ContainerCreating   0          1m

Install Knative Serving

curl -L https://github.com/knative/serving/releases/download/v0.1.1/release-lite.yaml \
  | sed 's/LoadBalancer/NodePort/' \
  | kubectl apply --filename -



kubectl get pods --namespace knative-serving

-->

NAME                          READY     STATUS            RESTARTS   AGE
activator-77d46b585d-rd6jt    0/2       PodInitializing   0          1m
controller-85768cfd45-f27dt   1/1       Running           0          1m
webhook-56dd548f8-vchc9       1/1       Running           0          1m

kubectl get svc knative-ingressgateway --namespace istio-system

NAME                     TYPE       CLUSTER-IP       EXTERNAL-IP  PORT(S)                                      AGE
knative-ingressgateway   NodePort   10.104.195.217   <none>        80:32380/TCP,443:32390/TCP,32400:32400/TCP   10m

It takes a loooong time to start. Note, I had to manually configure the VM with 4cpus and 8G RAM becuase the start command on minikube didnt seem to deliver these parameters (minikube start –memory=8192 –cpus=4 ....).

Tags: kubernetes minikube knative