Skip to content

feat(deploy): support single namespace #790

feat(deploy): support single namespace

feat(deploy): support single namespace #790

Workflow file for this run

name: Deployment Test Suite
concurrency:
group: deploy-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
jobs:
deployment:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
install:
- static
- helm
emqx:
# - [EmqxBroker, emqx, "config/samples/emqx/v1beta3/emqxbroker-slim.yaml"]
# - [EmqxBroker, emqx, "config/samples/emqx/v1beta3/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta3/emqxenterprise-slim.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta3/emqxenterprise-full.yaml"]
# - [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-slim.yaml"]
# - [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-slim.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]
single_namespace:
- false
include:
- install: helm
emqx: [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
single_namespace: true
- install: helm
emqx: [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]
single_namespace: true
steps:
- run: minikube start
- name: install cert-manager
run: |
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--set crds.enabled=true
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build image
env:
IMG: "emqx/emqx-operator-controller:${{ github.sha }}"
run: eval $(minikube docker-env) && docker build -t $IMG .
- name: Deploy controller
if: matrix.install == 'static'
env:
IMG: "emqx/emqx-operator-controller:${{ github.sha }}"
run: make deploy
- name: Deploy controller
if: matrix.install == 'helm'
run: |
helm install emqx-operator deploy/charts/emqx-operator \
--set image.tag=${{ github.sha }} \
--set development=true \
--set singleNamespace=${{ matrix.single_namespace }} \
--namespace emqx-operator-system \
--create-namespace
- name: Check operator
timeout-minutes: 5
run: kubectl wait --for=condition=Ready pods -l "control-plane=controller-manager" -n emqx-operator-system
- name: Deployment emqx
timeout-minutes: 5
uses: ./.github/actions/deploy-emqx
with:
kind: ${{ matrix.emqx[0] }}
name: ${{ matrix.emqx[1] }}
file: ${{ matrix.emqx[2] }}
- name: Make sure all of pods can be deleted
run: |
kubectl delete ${{ matrix.emqx[0] }} ${{ matrix.emqx[1] }}
kubectl wait --for=delete pods -l "apps.emqx.io/instance=${{ matrix.emqx[1] }}"
- if: failure()
run: kubectl logs -l "control-plane=controller-manager" -n emqx-operator-system -c manager --tail=1000
- if: failure()
run: kubectl get ${{ matrix.emqx[0] }} ${{ matrix.emqx[1] }} -o json
- if: failure()
run: kubectl get events --sort-by='.lastTimestamp'
- if: failure()
run: kubectl get pods -l "apps.emqx.io/managed-by=emqx-operator" -o json
- if: failure()
run: kubectl logs -l "apps.emqx.io/managed-by=emqx-operator" -c emqx