These instructions are heavily drawn from https://github.com/csantanapr/knative-kind/
Updated and verified on 2020/09/04 with:
- Knative version 0.17.2
- Kind version 0.8.1
- Kubernetes version 1.19.0
- Install kind Linux, MacOS, or Windows. You can verify version with
kind --version
- A kind cluster manifest file clusterconfig.yaml is already provided, you can customize it. We are exposing port
80on the host to be later used by the Knative Kourier ingress. To use a different version of kubernetes check the image digest to use from the kind release pagekind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.19.0@sha256:3b0289b2d1bab2cb9108645a006939d2f447a10ad2bb21919c332d06b548bbc6 extraPortMappings: - containerPort: 31080 # expose port 31380 of the node to port 80 on the host, later to be use by kourier ingress hostPort: 80
- Create and start your cluster, we specify the config file above
kind create cluster --name knative --config kind/clusterconfig.yaml - Verify the versions of the client
kubectland the cluster api-server, and that you can connect to your cluster.kubectl cluster-info --context kind-knative
-
Select the version of Knative Serving to install
export KNATIVE_VERSION="0.17.2"
-
Install Knative Serving in namespace
knative-servingkubectl apply -f https://github.com/knative/serving/releases/download/v$KNATIVE_VERSION/serving-crds.yaml kubectl apply -f https://github.com/knative/serving/releases/download/v$KNATIVE_VERSION/serving-core.yaml kubectl wait deployment --all --timeout=-1s --for=condition=Available -n knative-serving
-
Select the version of Knative Net Kurier to install
export KNATIVE_NET_KOURIER_VERSION="0.17.0"
-
Install Knative Layer kourier in namespace
kourier-systemkubectl apply -f https://github.com/knative/net-kourier/releases/download/v$KNATIVE_NET_KOURIER_VERSION/kourier.yaml kubectl wait deployment --all --timeout=-1s --for=condition=Available -n kourier-system # deployment for net-kourier gets deployed to namespace knative-serving kubectl wait deployment --all --timeout=-1s --for=condition=Available -n knative-serving
-
Set the environment variable
EXTERNAL_IPto External IP Address of the Worker NodeEXTERNAL_IP="127.0.0.1" -
Set the environment variable
KNATIVE_DOMAINas the DNS domain usingnip.ioKNATIVE_DOMAIN="$EXTERNAL_IP.nip.io" echo KNATIVE_DOMAIN=$KNATIVE_DOMAIN
Double check DNS is resolving
dig $KNATIVE_DOMAIN -
Configure DNS for Knative Serving
kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" -
Configure Kourier to listen for http port 80 on the node
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Service metadata: name: kourier-ingress namespace: kourier-system labels: networking.knative.dev/ingress-provider: kourier spec: type: NodePort selector: app: 3scale-kourier-gateway ports: - name: http2 nodePort: 31080 port: 80 targetPort: 8080 EOF
-
Configure Knative to use Kourier
kubectl patch configmap/config-network \ --namespace knative-serving \ --type merge \ --patch '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}' -
Verify that Knative is Installed properly all pods should be in
Runningstate and ourkourier-ingressservice configured.kubectl get pods -n knative-serving kubectl get pods -n kourier-system kubectl get svc -n kourier-system kourier-ingress
- Select the version of Knative Eventing to install
export KNATIVE_VERSION="v0.17.2"
- Install Knative Eventing in namespace
knative-eventingkubectl apply --filename https://github.com/knative/eventing/releases/download/$KNATIVE_VERSION/eventing-crds.yaml kubectl apply --filename https://github.com/knative/eventing/releases/download/$KNATIVE_VERSION/eventing-core.yaml
- Install a default in-memory Channel
kubectl apply --filename https://github.com/knative/eventing/releases/download/$KNATIVE_VERSION/in-memory-channel.yaml - Install a Broker
kubectl apply --filename https://github.com/knative/eventing/releases/download/$KNATIVE_VERSION/mt-channel-broker.yaml - Monitor the Knative Eventing components until each shows a
STATUSofRunning.kubectl get pods --namespace knative-eventing
When you have finished, you can delete the cluster knative.
kind delete cluster --name knative