Create cluster using KinD #137
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Create cluster using KinD" | |
on: | |
workflow_dispatch: {} | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Build:checkout" | |
uses: actions/checkout@v2 | |
- name: "Build:buildx" | |
uses: docker/setup-buildx-action@v1 | |
with: | |
version: v0.9.1 # Buildx version | |
- name: "Build:login" | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Build:dockerimage" | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: Dockerfile.controller | |
push: true | |
build-args: | | |
GO_BUILDER_IMG=golang:1.19 | |
tags: | | |
ghcr.io/grafana/k6-operator:${{ github.sha }} | |
kind-kustomize: | |
strategy: | |
matrix: | |
k8s_version: ["1.19.16", "1.24.12", "v1.27.1"] | |
needs: ["docker"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: "Kustomize Build" | |
uses: karancode/kustomize-github-action@master | |
with: | |
kustomize_version: "3.0.0" | |
kustomize_build_dir: "config/default" | |
kustomize_output_file: "rendered.yaml" | |
kustomize_build_options: "--load_restrictor none" | |
- uses: engineerd/[email protected] | |
with: | |
version: "v0.11.1" | |
image: kindest/node:${{ matrix.k8s_version }} | |
- name: Testing | |
run: | | |
kubectl cluster-info | |
kubectl apply -f rendered.yaml | |
kubectl -n k6-operator-system set image deployment/k6-operator-controller-manager manager=ghcr.io/grafana/k6-operator:${{ github.sha }} | |
kubectl create configmap crocodile-stress-test --from-file e2e/test.js | |
kubectl apply -f e2e/test.yaml | |
sleep 30 | |
kubectl get namespaces | |
kubectl get jobs -A | |
kubectl wait --for=condition=complete --timeout=180s job/k6-sample-initializer | |
kubectl delete configmap crocodile-stress-test | |
kubectl delete -f e2e/test.yaml | |
kind-helm: | |
needs: ["docker"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v1 | |
with: | |
version: v3.7.2 | |
- name: Create kind cluster | |
uses: helm/[email protected] | |
- name: Testing | |
run: | | |
helm install k6-operator ./charts/ -f ./charts/values.yaml --set manager.image.tag=${{github.sha}} | |
kubectl create configmap crocodile-stress-test --from-file e2e/test.js | |
kubectl apply -f e2e/test.yaml | |
sleep 30 | |
kubectl get namespaces | |
kubectl get jobs -A | |
kubectl wait --for=condition=complete --timeout=180s job/k6-sample-1 | |
kubectl delete configmap crocodile-stress-test | |
kubectl delete -f e2e/test.yaml |