Skip to content

Implement helm and bash pre-rollout hooks#196

Merged
stefanprodan merged 16 commits intomasterfrom
helm-test-hook
Jun 5, 2019
Merged

Implement helm and bash pre-rollout hooks#196
stefanprodan merged 16 commits intomasterfrom
helm-test-hook

Conversation

@stefanprodan
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan commented Jun 3, 2019

This PR adds two blocking commands to Flagger's test runner:

  • type: helm intended for running helm tests
  • type: bash intended for running bats tests

Usage

Deploy the helm test runner in the kube-system namespace using the tiller service account:

kubectl apply -f artifacts/helmtester

Run helm and bats tests before the canary starts receiving traffic:

  canaryAnalysis:
    webhooks:
      - name: "helm tests"
        type: pre-rollout
        url: http://flagger-helmtester.kube-system/
        timeout: 3m
        metadata:
          type: "helm"
          cmd: "test podinfo --cleanup"
      - name: "bats tests"
        type: pre-rollout
        url: http://flagger-batstester.istio-system/
        timeout: 5m
        metadata:
          type: "bash"
          cmd: "bats /tests/integration-test.bats"

Note that you should create a ConfigMap with your bats tests and mount it inside the tester container.

@stefanprodan stefanprodan changed the title Implement helm test pre-rollout hook Implement bash and helm pre-rollout hook Jun 4, 2019
@stefanprodan stefanprodan changed the title Implement bash and helm pre-rollout hook Implement bash and helm pre-rollout hooks Jun 4, 2019
@stefanprodan stefanprodan changed the title Implement bash and helm pre-rollout hooks Implement helm and bash pre-rollout hooks Jun 4, 2019
@stefanprodan stefanprodan merged commit 948226d into master Jun 5, 2019
@stefanprodan stefanprodan deleted the helm-test-hook branch June 5, 2019 07:11
@stefanprodan stefanprodan mentioned this pull request Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant