From 2630b89dd76f1fa5813a61f522382ccc67caabd6 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 16 Oct 2020 08:06:36 -0700 Subject: [PATCH] Add kind (#24) Co-authored-by: pbochynski --- .github/workflows/app-connector-e2e-kind.yml | 42 ++++++++++++++++ .github/workflows/app-connector-e2e.yml | 2 +- .github/workflows/e2e-minikube.yml | 2 +- .gitignore | 1 + commerce-mock.sh | 2 +- config-istio-nodeport.yaml | 53 ++++++++++++++++++++ config-istio.yaml | 24 +++++++++ create-cluster-kind.sh | 51 +++++++++++++++++++ install-istio.sh | 2 +- install-kyma.sh | 4 +- kyma-kind-cleanup.sh | 5 ++ kyma-kind.sh | 3 ++ 12 files changed, 185 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/app-connector-e2e-kind.yml create mode 100644 config-istio-nodeport.yaml create mode 100644 config-istio.yaml create mode 100755 create-cluster-kind.sh create mode 100755 kyma-kind-cleanup.sh create mode 100755 kyma-kind.sh diff --git a/.github/workflows/app-connector-e2e-kind.yml b/.github/workflows/app-connector-e2e-kind.yml new file mode 100644 index 0000000..bfab7c9 --- /dev/null +++ b/.github/workflows/app-connector-e2e-kind.yml @@ -0,0 +1,42 @@ +name: Tests on kind + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + schedule: + - cron: '0 * * * *' # every hour + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v2 + - name: Prepare docker registry, kind & helm 3 + run: | + echo "Installing kind" + GO111MODULE="on" go get sigs.k8s.io/kind@v0.9.0 + echo "Starting docker registry & kind cluster" + ./create-cluster-kind.sh + echo "Installing helm" + curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + - name: Install Istio + run: | + ./install-istio.sh -f config-istio-nodeport.yaml + # - name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + - name: Install Kyma + env: + SKIP_MODULES: apiserver-proxy,helm-broker,console,cluster-users,apiserver-proxy,logging,tracing + run: | + ./download-kyma-charts.sh + ./install-kyma.sh + sudo cp kyma.crt /usr/local/share/ca-certificates + sudo update-ca-certificates + - name: Install Commerce Mock + run: | + ./commerce-mock.sh + - name: Run End To End Test + run: | + ./app-connector-example.sh diff --git a/.github/workflows/app-connector-e2e.yml b/.github/workflows/app-connector-e2e.yml index 5d79eb9..1de9cf8 100644 --- a/.github/workflows/app-connector-e2e.yml +++ b/.github/workflows/app-connector-e2e.yml @@ -40,7 +40,7 @@ jobs: while [[ $(kubectl get nodes -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "Waiting for cluster nodes to be ready"; sleep 2; done - name: Install Istio run: | - ./install-istio.sh + ./install-istio.sh -f config-istio.yaml - name: Install Kyma env: SKIP_MODULES: apiserver-proxy,helm-broker,console,cluster-users,apiserver-proxy,logging,tracing diff --git a/.github/workflows/e2e-minikube.yml b/.github/workflows/e2e-minikube.yml index 10b2946..af68516 100644 --- a/.github/workflows/e2e-minikube.yml +++ b/.github/workflows/e2e-minikube.yml @@ -31,7 +31,7 @@ jobs: while [[ $(kubectl get nodes -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "Waiting for cluster nodes to be ready"; sleep 2; done - name: Install Istio run: | - ./install-istio.sh + ./install-istio.sh -f config-istio.yaml - name: Minikube tunnel run: | ./minikube-tunnel.sh diff --git a/.gitignore b/.gitignore index f752335..0b40c6c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dist registry coredns-patch.yaml kyma.crt +istioctl istio-* diff --git a/commerce-mock.sh b/commerce-mock.sh index ae9848f..9840264 100755 --- a/commerce-mock.sh +++ b/commerce-mock.sh @@ -44,7 +44,7 @@ spec: resources: requests: memory: "150Mi" - cpu: "50m" + cpu: "10m" limits: memory: "350Mi" cpu: "300m" diff --git a/config-istio-nodeport.yaml b/config-istio-nodeport.yaml new file mode 100644 index 0000000..d13f7e0 --- /dev/null +++ b/config-istio-nodeport.yaml @@ -0,0 +1,53 @@ +apiVersion: install.istio.io/v1alpha1 +kind: IstioOperator +spec: + addonComponents: + grafana: + enabled: false + istiocoredns: + enabled: false + kiali: + enabled: false + prometheus: + enabled: false + tracing: + enabled: false + components: + citadel: + enabled: false + cni: + enabled: false + egressGateways: + - enabled: false + name: istio-egressgateway + galley: + enabled: false + ingressGateways: + - enabled: true + k8s: + resources: + requests: + cpu: 10m + memory: 40Mi + service: + type: NodePort + overlays: + - apiVersion: v1 + kind: Service + name: istio-ingressgateway + patches: + - path: spec.ports + value: + - name: status-port + port: 15021 + targetPort: 15021 + nodePort: 30002 + - name: http2 + port: 80 + targetPort: 80 + nodePort: 30000 + - name: https + port: 443 + targetPort: 443 + nodePort: 30001 + name: istio-ingressgateway diff --git a/config-istio.yaml b/config-istio.yaml new file mode 100644 index 0000000..669c927 --- /dev/null +++ b/config-istio.yaml @@ -0,0 +1,24 @@ +apiVersion: install.istio.io/v1alpha1 +kind: IstioOperator +spec: + addonComponents: + grafana: + enabled: false + istiocoredns: + enabled: false + kiali: + enabled: false + prometheus: + enabled: false + tracing: + enabled: false + components: + citadel: + enabled: false + cni: + enabled: false + egressGateways: + - enabled: false + name: istio-egressgateway + galley: + enabled: false \ No newline at end of file diff --git a/create-cluster-kind.sh b/create-cluster-kind.sh new file mode 100755 index 0000000..da4713f --- /dev/null +++ b/create-cluster-kind.sh @@ -0,0 +1,51 @@ +#!/bin/sh +set -o errexit + + + +# create a cluster with the local registry enabled in containerd +cat <