Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Add kind (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: pbochynski <[email protected]>
  • Loading branch information
tehcyx and pbochynski authored Oct 16, 2020
1 parent d455737 commit 2630b89
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/app-connector-e2e-kind.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
2 changes: 1 addition & 1 deletion .github/workflows/app-connector-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-minikube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
registry
coredns-patch.yaml
kyma.crt
istioctl
istio-*
2 changes: 1 addition & 1 deletion commerce-mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
resources:
requests:
memory: "150Mi"
cpu: "50m"
cpu: "10m"
limits:
memory: "350Mi"
cpu: "300m"
Expand Down
53 changes: 53 additions & 0 deletions config-istio-nodeport.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions config-istio.yaml
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions create-cluster-kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/sh
set -o errexit



# create a cluster with the local registry enabled in containerd
cat <<EOF | kind create cluster --name kyma --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.localhost:5000"]
endpoint = ["http://registry.localhost:5000"]
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
image: kindest/node:v1.18.8@sha256:f4bcc97a0ad6e7abaf3f643d890add7efe6ee4ab90baeb374b4f41a4c95567eb
extraPortMappings:
- containerPort: 30000
hostPort: 80
protocol: tcp
listenAddress: "127.0.0.1"
- containerPort: 30001
hostPort: 443
protocol: tcp
listenAddress: "127.0.0.1"
- containerPort: 30002
hostPort: 15021
protocol: tcp
listenAddress: "127.0.0.1"
EOF

# create registry container unless it already exists
docker run -d \
-p 5000:5000 \
--restart=always \
--network=kind \
--name registry.localhost \
-v $PWD/registry:/var/lib/registry \
registry:2

# tell https://tilt.dev to use the registry
# https://docs.tilt.dev/choosing_clusters.html#discovering-the-registry
for node in $(kind get nodes --name kyma); do
kubectl annotate node "${node}" "kind.x-k8s.io/registry=registry.localhost:${reg_port}";
done
2 changes: 1 addition & 1 deletion install-istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
if [[ ! -f istio-1.5.10/bin/istioctl ]]; then
curl -sL https://istio.io/downloadIstio | ISTIO_VERSION=1.5.10 sh -
fi
istio-1.5.10/bin/istioctl manifest apply --set profile=demo
istio-1.5.10/bin/istioctl manifest apply --set profile=demo $@
4 changes: 2 additions & 2 deletions install-kyma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ helm_install testing resources/testing kyma-system

helm_install ingress-dns-cert ingress-dns-cert istio-system --set $OVERRIDES &

helm_install dex resources/dex kyma-system --set $OVERRIDES &
helm_install dex resources/dex kyma-system --set $OVERRIDES --set resources.requests.cpu=10m &
helm_install ory resources/ory kyma-system --set $OVERRIDES --set $ORY &
helm_install api-gateway resources/api-gateway kyma-system --set $OVERRIDES &
helm_install api-gateway resources/api-gateway kyma-system --set $OVERRIDES --set deployment.resources.requests.cpu=10m &

helm_install rafter resources/rafter kyma-system --set $OVERRIDES &
helm_install service-catalog resources/service-catalog kyma-system --set $OVERRIDES --set catalog.webhook.resources.requests.cpu=10m,catalog.controllerManager.resources.requests.cpu=10m &
Expand Down
5 changes: 5 additions & 0 deletions kyma-kind-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -o errexit

kind delete cluster --name kyma
docker rm -f registry.localhost
3 changes: 3 additions & 0 deletions kyma-kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./create-cluster-kind.sh
./install-istio.sh
./install-kyma.sh

0 comments on commit 2630b89

Please sign in to comment.