Skip to content

[TT-9631] - Make tyk-bootstrap image repository information configurable #403

[TT-9631] - Make tyk-bootstrap image repository information configurable

[TT-9631] - Make tyk-bootstrap image repository information configurable #403

Workflow file for this run

name: Tests
on:
pull_request: {}
push:
branches:
- master
env:
TIMEOUT: 15m
TYK_OSS_NS: tyk-oss
TYK_MDCB_DATAPLANE_NS: tyk-mdcb-dataplane
TYK_SINGLE_DC_NS: tyk-single-dc
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.3.0
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml --all
integration-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Create kind cluster
uses: helm/[email protected]
# Tyk OSS tests
- name: Deploy Tyk OSS and Dependencies
run: |
kubectl create namespace ${{ env.TYK_OSS_NS }}
# Do not change the name
helm install redis simple-redis --wait --repo 'https://helm.tyk.io/public/helm/charts/' -n ${{ env.TYK_OSS_NS }} --timeout ${{ env.TIMEOUT }}
helm dependency update ./tyk-oss
- name: Run chart-testing (install)
run: ct install --namespace ${{ env.TYK_OSS_NS }} --charts ./tyk-oss --helm-extra-set-args "--wait=true"
- if: failure()
name: Check logs in case of failure
run: kubectl logs -n ${{ env.TYK_OSS_NS}} tyk-oss-test-tyk-oss
- name: Uninstall Tyk OSS Dependencies
run: |
helm uninstall redis -n ${{ env.TYK_OSS_NS }} --timeout ${{ env.TIMEOUT }}
kubectl delete namespace ${{ env.TYK_OSS_NS }}
# Tyk Single Data Center tests
- name: Deploy Tyk Single Data Center and dependencies
run: |
kubectl create namespace ${{ env.TYK_SINGLE_DC_NS }}
# Do not change the name
# Install redis
helm install redis simple-redis --wait --repo 'https://helm.tyk.io/public/helm/charts/' -n ${{ env.TYK_SINGLE_DC_NS }} --timeout ${{ env.TIMEOUT }}
# Install mongo
helm install mongo simple-mongodb --wait --repo 'https://helm.tyk.io/public/helm/charts/' -n ${{ env.TYK_SINGLE_DC_NS }} --timeout ${{ env.TIMEOUT }}
helm dependency update ./tyk-single-dc
helm install --namespace tyk-single-dc tyk-single-dc ./tyk-single-dc \
--set "global.mongo.mongoURL=mongodb://mongo.tyk-single-dc.svc.cluster.local:27017/tyk_analytics" \
--set "global.redis.addrs[0]=redis.tyk-single-dc.svc.cluster.local:6379" \
--set "global.license.dashboard=${{ secrets.DASH_LICENSE }}" \
--set "global.storageType=mongo" \
--timeout=${{ env.TIMEOUT }}
- name: Run integration tests for Tyk Single DC
run: helm test -n ${{ env.TYK_SINGLE_DC_NS }} tyk-single-dc
- if: failure()
name: Check logs in case of failure
run: kubectl logs -n ${{ env.TYK_SINGLE_DC_NS }} tyk-single-dc-test-tyk-single-dc
- name: Uninstall Tyk Single DC Dependencies
run: |
helm uninstall redis -n ${{ env.TYK_SINGLE_DC_NS }} --timeout ${{ env.TIMEOUT }}
helm uninstall mongo -n ${{ env.TYK_SINGLE_DC_NS }} --timeout ${{ env.TIMEOUT }}
helm uninstall tyk-single-dc -n ${{ env.TYK_SINGLE_DC_NS }} --timeout ${{ env.TIMEOUT }}
kubectl delete namespace ${{ env.TYK_SINGLE_DC_NS }}
# Tyk MDCB Data Plane tests
- name: Deploy Tyk MDCB Data Plane and Dependencies
run: |
kubectl create namespace ${{ env.TYK_MDCB_DATAPLANE_NS }}
# Do not change the name
helm install redis simple-redis --wait --repo 'https://helm.tyk.io/public/helm/charts/' -n ${{ env.TYK_MDCB_DATAPLANE_NS }} --timeout ${{ env.TIMEOUT }}
helm dependency update ./tyk-mdcb-data-plane
helm install --namespace ${{ env.TYK_MDCB_DATAPLANE_NS }} tyk-mdcb-data-plane ./tyk-mdcb-data-plane --wait \
--set global.remoteControlPlane.orgId=${{ secrets.HYBRID_RPC_KEY }} \
--set global.remoteControlPlane.userApiKey=${{ secrets.HYBRID_API_KEY }} \
--set global.remoteControlPlane.connectionString=${{ secrets.HYBRID_MDCB_HOST }}
- name: Run integration tests for Tyk MDCB Data Plane
run: helm test -n ${{ env.TYK_MDCB_DATAPLANE_NS }} tyk-mdcb-data-plane
- if: failure()
name: Check logs in case of failure
run: kubectl logs -n ${{ env.TYK_MDCB_DATAPLANE_NS }} tyk-mdcb-data-plane-test-tyk-data-plane
- name: Uninstall Tyk MDCB Data Plane Dependencies
run: |
helm uninstall tyk-mdcb-data-plane -n ${{ env.TYK_MDCB_DATAPLANE_NS }}
helm uninstall redis -n ${{ env.TYK_MDCB_DATAPLANE_NS }} --timeout ${{ env.TIMEOUT }}
kubectl delete namespace ${{ env.TYK_MDCB_DATAPLANE_NS }}
smoke-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
k8s_version: ["v1.26.3", "v1.25.2","v1.24.6","v1.23.12","v1.22.15","v1.21.14","v1.20.15"]
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Create Kind Cluster
uses: helm/[email protected]
with:
node_image: "kindest/node:${{ matrix.k8s_version }}"
- name: Install helm
uses: azure/setup-helm@v3
with:
version: v3.11.2
- name: Deploy Tyk OSS and Dependencies
run: |
kubectl create namespace tyk-oss
# Do not change the name
helm install redis simple-redis --repo 'https://helm.tyk.io/public/helm/charts/' -n tyk-oss --timeout ${{ env.TIMEOUT }}
helm dependency update ./tyk-oss
helm install tyk-oss ./tyk-oss -n tyk-oss --timeout ${{ env.TIMEOUT }}
- name: Upgrade Tyk OSS
run: |
helm upgrade -n tyk-oss tyk-oss ./tyk-oss --set tyk-gateway.gateway.kind=DaemonSet
- name: Uninstall Tyk OSS
run: |
helm uninstall tyk-oss -n tyk-oss --timeout ${{ env.TIMEOUT }}
kubectl delete namespace tyk-oss
- name: Deploy Tyk MDCB Data Plane
run: |
kubectl create namespace ${{ env.TYK_MDCB_DATAPLANE_NS }}
# Do not change the name
helm install redis simple-redis --wait --repo 'https://helm.tyk.io/public/helm/charts/' -n ${{ env.TYK_MDCB_DATAPLANE_NS }} --timeout ${{ env.TIMEOUT }}
helm dependency update ./tyk-mdcb-data-plane
helm install --namespace ${{ env.TYK_MDCB_DATAPLANE_NS }} tyk-mdcb-data-plane ./tyk-mdcb-data-plane --wait \
--set global.remoteControlPlane.orgId=${{ secrets.HYBRID_RPC_KEY }} \
--set global.remoteControlPlane.userApiKey=${{ secrets.HYBRID_API_KEY }} \
--set global.remoteControlPlane.connectionString=${{ secrets.HYBRID_MDCB_HOST }}
- name: Upgrade Tyk MDCB Data Plane
run: |
helm upgrade -n ${{ env.TYK_MDCB_DATAPLANE_NS }} tyk-mdcb-data-plane ./tyk-mdcb-data-plane --set tyk-gateway.gateway.kind=DaemonSet
- name: Uninstall Tyk MDCB Data Plane
run: |
helm uninstall tyk-mdcb-data-plane -n ${{ env.TYK_MDCB_DATAPLANE_NS }} --timeout ${{ env.TIMEOUT }}
kubectl delete namespace ${{ env.TYK_MDCB_DATAPLANE_NS }}