|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +# This script will set up a minikube cluster with knative serving and eventing |
| 4 | +# as well as tekton pipelines. |
| 5 | + |
| 6 | +minikube status |
| 7 | + |
| 8 | +minikube start --memory=8192 --cpus=6 \ |
| 9 | + --kubernetes-version=v1.12.0 \ |
| 10 | + --vm-driver=kvm2 \ |
| 11 | + --disk-size=30g \ |
| 12 | + --extra-config=apiserver.enable-admission-plugins="LimitRanger,NamespaceExists,NamespaceLifecycle,ResourceQuota,ServiceAccount,DefaultStorageClass,MutatingAdmissionWebhook" |
| 13 | + |
| 14 | +helm init |
| 15 | + |
| 16 | +# Install Istio |
| 17 | +export ISTIO_VERSION=1.1.7 |
| 18 | +echo "Installing ${ISTIO_VERSION}" |
| 19 | +curl -L https://git.io/getLatestIstio | sh - |
| 20 | +cd istio-${ISTIO_VERSION} |
| 21 | + |
| 22 | +for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl apply -f $i; done |
| 23 | + |
| 24 | +echo "Waiting for CRDs to be comitted" |
| 25 | +sleep 7 |
| 26 | + |
| 27 | +cat <<EOF | kubectl apply -f - |
| 28 | +apiVersion: v1 |
| 29 | +kind: Namespace |
| 30 | +metadata: |
| 31 | + name: istio-system |
| 32 | + labels: |
| 33 | + istio-injection: disabled |
| 34 | +EOF |
| 35 | + |
| 36 | +# A lighter template, with just pilot/gateway. |
| 37 | +# Based on install/kubernetes/helm/istio/values-istio-minimal.yaml |
| 38 | +helm template --namespace=istio-system \ |
| 39 | + --set prometheus.enabled=false \ |
| 40 | + --set mixer.enabled=false \ |
| 41 | + --set mixer.policy.enabled=false \ |
| 42 | + --set mixer.telemetry.enabled=false \ |
| 43 | + `# Pilot doesn't need a sidecar.` \ |
| 44 | + --set pilot.sidecar=false \ |
| 45 | + --set pilot.resources.requests.memory=128Mi \ |
| 46 | + `# Disable galley (and things requiring galley).` \ |
| 47 | + --set galley.enabled=false \ |
| 48 | + --set global.useMCP=false \ |
| 49 | + `# Disable security / policy.` \ |
| 50 | + --set security.enabled=false \ |
| 51 | + --set global.disablePolicyChecks=true \ |
| 52 | + `# Disable sidecar injection.` \ |
| 53 | + --set sidecarInjectorWebhook.enabled=false \ |
| 54 | + --set global.proxy.autoInject=disabled \ |
| 55 | + --set global.omitSidecarInjectorConfigMap=true \ |
| 56 | + `# Set gateway pods to 1 to sidestep eventual consistency / readiness problems.` \ |
| 57 | + --set gateways.istio-ingressgateway.autoscaleMin=1 \ |
| 58 | + --set gateways.istio-ingressgateway.autoscaleMax=1 \ |
| 59 | + `# Set pilot trace sampling to 100%` \ |
| 60 | + --set pilot.traceSampling=100 \ |
| 61 | + install/kubernetes/helm/istio \ |
| 62 | + > ./istio-lean.yaml |
| 63 | + |
| 64 | +kubectl apply -f istio-lean.yaml |
| 65 | + |
| 66 | +kubectl get pods --namespace istio-system |
| 67 | + |
| 68 | +# Install Knative |
| 69 | +kubectl apply --selector knative.dev/crd-install=true \ |
| 70 | + --filename https://github.com/knative/serving/releases/download/v0.9.0/serving.yaml \ |
| 71 | + --filename https://github.com/knative/eventing/releases/download/v0.9.0/release.yaml \ |
| 72 | + --filename https://github.com/knative/serving/releases/download/v0.9.0/monitoring.yaml |
| 73 | + |
| 74 | +kubectl apply --filename https://github.com/knative/serving/releases/download/v0.9.0/serving.yaml \ |
| 75 | + --filename https://github.com/knative/eventing/releases/download/v0.9.0/release.yaml \ |
| 76 | + --filename https://github.com/knative/serving/releases/download/v0.9.0/monitoring.yaml |
| 77 | + |
| 78 | + |
| 79 | +# Install Tekton |
| 80 | +kubectl apply --filename https://storage.googleapis.com/tekton-releases/latest/release.yaml |
| 81 | + |
| 82 | +# Install FaaS |
| 83 | +cd .. |
| 84 | +kubectl apply -f deploy/crds/faas_v1alpha1_jsfunction_crd.yaml |
| 85 | +kubectl apply -f deploy/crds/faas_v1alpha1_jsfunctionbuild_crd.yaml |
| 86 | +kubectl apply -f deploy/role.yaml |
| 87 | +kubectl apply -f deploy/role_binding.yaml |
| 88 | +kubectl apply -f deploy/service_account.yaml |
| 89 | +kubectl apply -f deploy/build/js-function-build.yaml |
| 90 | +kubectl apply -f deploy/operator.yaml |
| 91 | + |
| 92 | +kubectl get namespaces |
0 commit comments