3.9 KiB
Easy Install on Minikube
This guide walks you through the installation of the latest version of Knative Serving using pre-built images and demonstrates creating and deploying an image of a sample "hello world" app onto the newly created Knative cluster.
You can find guides for other platforms here.
Before you begin
Knative requires a Kubernetes cluster v1.10 or newer. If you don't have one, you can create one using Minikube.
Install kubectl and Minikube
-
Install and configure minikube with a VM driver, e.g.
kvm2on Linux orhyperkiton macOS.
Creating a Kubernetes cluster
Once kubectl and Minikube are installed, create a cluster with version 1.10 or greater and your chosen VM driver:
For Linux use:
minikube start --memory=8192 --cpus=4 \
--kubernetes-version=v1.10.4 \
--vm-driver=kvm2 \
--bootstrapper=kubeadm \
--extra-config=controller-manager.cluster-signing-cert-file="/var/lib/localkube/certs/ca.crt" \
--extra-config=controller-manager.cluster-signing-key-file="/var/lib/localkube/certs/ca.key" \
--extra-config=apiserver.admission-control="DenyEscalatingExec,LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
For macOS use:
minikube start --memory=8192 --cpus=4 \
--kubernetes-version=v1.10.4 \
--vm-driver=hyperkit \
--bootstrapper=kubeadm \
--extra-config=controller-manager.cluster-signing-cert-file="/var/lib/localkube/certs/ca.crt" \
--extra-config=controller-manager.cluster-signing-key-file="/var/lib/localkube/certs/ca.key" \
--extra-config=apiserver.admission-control="DenyEscalatingExec,LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook"
Installing Istio
Knative depends on Istio. Run the following to install Istio. (We are changing
LoadBalancer to NodePort for the istio-ingress service).
wget -O - https://storage.googleapis.com/knative-releases/latest/istio.yaml \
| sed 's/LoadBalancer/NodePort/' \
| kubectl apply -f -
# Label the default namespace with istio-injection=enabled.
kubectl label namespace default istio-injection=enabled
Wait until each Istio component is running or completed (STATUS column shows 'Running' or 'Completed'):
kubectl get pods -n istio-system --watch
CTRL+C when it's done.
Installing Knative Serving
Next, we will install Knative Serving:
We are using the https://storage.googleapis.com/knative-releases/latest/release-lite.yaml
file which omits some of the monitoring components to reduce the memory used by
the Knative components since you do have limited resources available. To use the
provided release-lite.yaml release run:
kubectl apply -f https://storage.googleapis.com/knative-releases/latest/release-lite.yaml
Wait until all Knative components are running (STATUS column shows 'Running'):
kubectl get pods -n knative-serving --watch
CTRL+C when it's done.
Now you can deploy your app/function to your newly created Knative cluster.
Deploying an app
Now that your cluster has Knative installed, you're ready to deploy an app.
If you'd like to follow a step-by-step guide for deploying your first app on Knative, check out the Getting Started with Knative App Deployment guide.
If you'd like to view the available sample apps and deploy one of your choosing, head to the sample apps repo.
Cleaning up
Delete the Kubernetes cluster along with Knative, Istio and Primer sample app:
minikube delete