Created
July 27, 2020 14:31
-
-
Save kameshsampath/c6ac8a530b630176e21d6d55a54d26d8 to your computer and use it in GitHub Desktop.
A simple shell script to deploy Knative serving on minikube or KinD clusters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
set -o pipefail | |
knative_version=${KNATIVE_VERSION:-v0.16.0} | |
knative_serving_version=${KNATIVE_SERVING_VERSION:-v0.16.0} | |
################################### | |
# Ingress | |
################################### | |
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml | |
kubectl rollout status ds envoy -n projectcontour | |
###################################### | |
## Knative Serving | |
###################################### | |
kubectl apply \ | |
--filename https://github.com/knative/serving/releases/download/$knative_serving_version/serving-crds.yaml | |
kubectl apply \ | |
--filename \ | |
https://github.com/knative/serving/releases/download/$knative_serving_version/serving-core.yaml | |
kubectl rollout status deploy controller -n knative-serving | |
kubectl rollout status deploy activator -n knative-serving | |
kubectl apply \ | |
--filename \ | |
https://github.com/knative/net-kourier/releases/download/$knative_version/kourier.yaml | |
kubectl rollout status deploy 3scale-kourier-control -n kourier-system | |
kubectl rollout status deploy 3scale-kourier-gateway -n kourier-system | |
kubectl patch configmap/config-network \ | |
-n knative-serving \ | |
--type merge \ | |
-p '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}' | |
cat <<EOF | kubectl apply -n kourier-system -f - | |
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: kourier-ingress | |
namespace: kourier-system | |
spec: | |
backend: | |
serviceName: kourier | |
servicePort: 80 | |
EOF | |
# skip registriesSkippingTagResolving for few local and development registry prefixes | |
kubectl patch configmap/config-deployment \ | |
-n knative-serving \ | |
--type merge \ | |
-p '{"data":{"registriesSkippingTagResolving": "ko.local,dev.local,example.com,example.org,test.com,test.org,localhost:5000"}}' | |
# set nip.io resolution | |
ksvc_domain="\"data\":{\""$(minikube ip)".nip.io\": \"\"}" | |
kubectl patch configmap/config-domain \ | |
-n knative-serving \ | |
--type merge \ | |
-p "{$ksvc_domain}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment