Skip to content

Instantly share code, notes, and snippets.

@Justin2997
Last active January 16, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Justin2997/9ed67e8aaf9298a686344fbfcb3bf83c to your computer and use it in GitHub Desktop.
Save Justin2997/9ed67e8aaf9298a686344fbfcb3bf83c to your computer and use it in GitHub Desktop.
Install Knative 0.2 on you Mac with Minikube or Docker For Mac.
#!/bin/sh
CONTEXT="$(kubectl config current-context)"
if [ "${CONTEXT}" == "docker-desktop" ]
then
curl -L https://github.com/knative/serving/releases/download/v0.2.2/istio.yaml \
| sed 's/LoadBalancer/NodePort/' \
| kubectl apply --filename - >/dev/null
kubectl label namespace default istio-injection=enabled
echo "Get status ..."
kubectl get pods --namespace istio-system
curl -L https://github.com/knative/serving/releases/download/v0.2.2/release-lite.yaml \
| kubectl apply --filename - >/dev/null
elif [ "${CONTEXT}" == "minikube" ]
then
minikube start --memory=8192 --cpus=4 \
--kubernetes-version=v1.11.5 \
--vm-driver=hyperkit \
--disk-size=30g \
--extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook" &
sleep 45
curl -L https://github.com/knative/serving/releases/download/v0.2.2/istio.yaml \
| sed 's/LoadBalancer/NodePort/' \
| kubectl apply --filename - >/dev/null
kubectl label namespace default istio-injection=enabled
curl -L https://github.com/knative/serving/releases/download/v0.2.2/release-lite.yaml \
| sed 's/LoadBalancer/NodePort/' \
| kubectl apply --filename -
else
echo "This script do not support ${CONTEXT}"
fi
echo "Resources booting ..."
sleep 15
kubectl get pods --namespace knative-serving
echo "Knative for Mac install ! Please see https://github.com/knative/docs/blob/master/install/Knative-with-Docker-for-Mac.md#deploying-an-app to deploy your first app."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment