From c5ebac1e41c4854dda2e22fe89e787bd2313d626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Wed, 2 Oct 2019 18:47:20 +0200 Subject: [PATCH] added install scripts --- cluster-deploy | 10 ++++---- deploy/install_helm.sh | 9 +++++++ deploy/install_knative.sh | 44 ++++++++++++++++++++++++++++++++++ deploy/install_riff.sh | 16 +++++++++++++ deploy/istio-namespace.yml | 6 +++++ deploy/kafka_pv.yml | 13 ---------- deploy/kubeless_kafka_setup.sh | 5 ---- deploy/kubeless_setup.sh | 17 ------------- deploy/kubeless_ui_setup.sh | 3 --- deploy/zoo_pv.yml | 13 ---------- 10 files changed, 81 insertions(+), 55 deletions(-) create mode 100644 deploy/install_helm.sh create mode 100644 deploy/install_knative.sh create mode 100644 deploy/install_riff.sh create mode 100644 deploy/istio-namespace.yml delete mode 100644 deploy/kafka_pv.yml delete mode 100644 deploy/kubeless_kafka_setup.sh delete mode 100644 deploy/kubeless_setup.sh delete mode 100644 deploy/kubeless_ui_setup.sh delete mode 100644 deploy/zoo_pv.yml diff --git a/cluster-deploy b/cluster-deploy index dac16a1..6429be3 100644 --- a/cluster-deploy +++ b/cluster-deploy @@ -169,8 +169,10 @@ for WORKERNAME in ${WORKER[@]}; do echo "[worker:$WORKERNAME] Deployment is completed." done -#Deploy Kubeless -./deploy/kubeless_setup.sh +#Deploy Knative +cd deploy +./install_helm.sh +./install_knative.sh -#Deploy Metric Server -./deploy/metric_setup.sh +#Deploy Riff +./install_riff.sh diff --git a/deploy/install_helm.sh b/deploy/install_helm.sh new file mode 100644 index 0000000..bca0826 --- /dev/null +++ b/deploy/install_helm.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#Install helm using snap +snap install helm --classic + +#Init helm with an admin tiller pod. +kubectl create serviceaccount tiller -n kube-system +kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller +helm init --wait --service-account tiller diff --git a/deploy/install_knative.sh b/deploy/install_knative.sh new file mode 100644 index 0000000..dd7ed07 --- /dev/null +++ b/deploy/install_knative.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#Create istio namespace +kubectl apply -f ./istio-namespace.yml + +#Download and unpack istio +ISTIO_VERSION=1.3.1 +curl -L https://git.io/getLatestIstio | sh - +cd istio-${ISTIO_VERSION} + +#Install istio CRDs +for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl apply -f $i; done + +helm template --namespace=istio-system \ + --set prometheus.enabled=false \ + --set mixer.enabled=false \ + --set mixer.policy.enabled=false \ + --set mixer.telemetry.enabled=false \ + --set pilot.sidecar=false \ + --set pilot.resources.requests.memory=128Mi \ + --set galley.enabled=false \ + --set global.useMCP=false \ + --set security.enabled=false \ + --set global.disablePolicyChecks=true \ + --set sidecarInjectorWebhook.enabled=false \ + --set global.proxy.autoInject=disabled \ + --set global.omitSidecarInjectorConfigMap=true \ + --set gateways.istio-ingressgateway.autoscaleMin=1 \ + --set gateways.istio-ingressgateway.autoscaleMax=1 \ + --set pilot.traceSampling=100 \ + install/kubernetes/helm/istio \ + > ./istio-lean.yaml + +kubectl apply -f istio-lean.yaml + +#Install Knative +kubectl apply --selector knative.dev/crd-install=true \ +--filename https://github.com/knative/serving/releases/download/v0.9.0/serving.yaml \ +--filename https://github.com/knative/eventing/releases/download/v0.9.0/release.yaml \ +--filename https://github.com/knative/serving/releases/download/v0.9.0/monitoring.yaml + +kubectl apply --filename https://github.com/knative/serving/releases/download/v0.9.0/serving.yaml \ +--filename https://github.com/knative/eventing/releases/download/v0.9.0/release.yaml \ +--filename https://github.com/knative/serving/releases/download/v0.9.0/monitoring.yaml diff --git a/deploy/install_riff.sh b/deploy/install_riff.sh new file mode 100644 index 0000000..d903a7d --- /dev/null +++ b/deploy/install_riff.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +#Install riff cli +curl -Lo riff-linux-amd64.tgz https://github.com/projectriff/cli/releases/download/v0.4.0/riff-linux-amd64.tgz +tar xvzf riff-linux-amd64.tgz +mv riff /usr/local/bin/ + +#Install riff +helm repo add projectriff https://projectriff.storage.googleapis.com/charts/releases +helm repo update + +helm install projectriff/istio --name istio --version 0.4.x --namespace istio-system --set gateways.istio-ingressgateway.type=NodePort --wait +helm install projectriff/riff --name riff --version 0.4.x --set knative.enabled=true + +#Verify Install +riff doctor diff --git a/deploy/istio-namespace.yml b/deploy/istio-namespace.yml new file mode 100644 index 0000000..64f462b --- /dev/null +++ b/deploy/istio-namespace.yml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: istio-system + labels: + istio-injection: disabled diff --git a/deploy/kafka_pv.yml b/deploy/kafka_pv.yml deleted file mode 100644 index b03bbfd..0000000 --- a/deploy/kafka_pv.yml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: datadir - labels: - kubeless: kafka -spec: - accessModes: - - ReadWriteOnce - capacity: - storage: 1Gi - hostPath: - path: "/root/paprika-k/" diff --git a/deploy/kubeless_kafka_setup.sh b/deploy/kubeless_kafka_setup.sh deleted file mode 100644 index 164da6c..0000000 --- a/deploy/kubeless_kafka_setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -kubectl create -f kafka_pv.yml -kubectl create -f zoo_pv.yml -export RELEASE=$(curl -s https://api.github.com/repos/kubeless/kafka-trigger/releases/latest | grep tag_name | cut -d '"' -f 4) -kubectl create -f https://github.com/kubeless/kafka-trigger/releases/download/$RELEASE/kafka-zookeeper-$RELEASE.yaml diff --git a/deploy/kubeless_setup.sh b/deploy/kubeless_setup.sh deleted file mode 100644 index 8347db7..0000000 --- a/deploy/kubeless_setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4) -kubectl create ns kubeless -kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml -#kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-non-rbac-$RELEASE.yaml - -apt install -y unzip - -#kubeless command -OS=$(uname -s| tr '[:upper:]' '[:lower:]') -curl -OL https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless_$OS-amd64.zip && \ - unzip kubeless_$OS-amd64.zip && \ - sudo mv bundles/kubeless_$OS-amd64/kubeless /usr/local/bin/ - -#Ingress nginx -kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml -kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml diff --git a/deploy/kubeless_ui_setup.sh b/deploy/kubeless_ui_setup.sh deleted file mode 100644 index 86a89d8..0000000 --- a/deploy/kubeless_ui_setup.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -kubectl create -f https://raw.githubusercontent.com/kubeless/kubeless-ui/master/k8s.yaml diff --git a/deploy/zoo_pv.yml b/deploy/zoo_pv.yml deleted file mode 100644 index 3d053d3..0000000 --- a/deploy/zoo_pv.yml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: zookeeper - labels: - kubeless: zookeeper -spec: - accessModes: - - ReadWriteOnce - capacity: - storage: 1Gi - hostPath: - path: "/root/paprika-z/"