Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadtester: add concord test support #507

Merged

Conversation

tebo-ernstberger
Copy link

@tebo-ernstberger tebo-ernstberger commented Mar 17, 2020

Hi,

Here's a PR for Concord support in Flagger's loadtester.

Fix: #477

Example query

{
    "metadata": {
        "type": "concord",
        "server": "https://concord.prod.foo.com/",
        "org": "my-concord-repo-org",
        "project": ""my-concord-project",
        "repo": "my-concord-repo",
        "entrypoint": ""my-concord-entrypoint",
        "apiKeyPath": "/tmp/concord-api-key",
        "endpoint": "https://canary-endpoint/",
        "pollInterval": "5",
        "pollTimeout": "60"
    }
}

Example logs

{"level":"info","ts":"2020-03-17T13:54:07.723-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process","canary":""}
{"level":"info","ts":"2020-03-17T13:54:07.874-0700","caller":"loadtester/concord.go:208","msg":"created process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] OK status is true","canary":""}
{"level":"info","ts":"2020-03-17T13:54:12.875-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process/4e7f4245-85aa-4c33-a56a-d4df5b63d3fe","canary":""}
{"level":"info","ts":"2020-03-17T13:54:13.010-0700","caller":"loadtester/concord.go:227","msg":"process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] current status is STARTING","canary":""}
{"level":"info","ts":"2020-03-17T13:54:17.874-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process/4e7f4245-85aa-4c33-a56a-d4df5b63d3fe","canary":""}
{"level":"info","ts":"2020-03-17T13:54:17.985-0700","caller":"loadtester/concord.go:227","msg":"process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] current status is STARTING","canary":""}
{"level":"info","ts":"2020-03-17T13:54:22.874-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process/4e7f4245-85aa-4c33-a56a-d4df5b63d3fe","canary":""}
{"level":"info","ts":"2020-03-17T13:54:23.061-0700","caller":"loadtester/concord.go:227","msg":"process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] current status is STARTING","canary":""}
{"level":"info","ts":"2020-03-17T13:54:27.878-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process/4e7f4245-85aa-4c33-a56a-d4df5b63d3fe","canary":""}
{"level":"info","ts":"2020-03-17T13:54:27.986-0700","caller":"loadtester/concord.go:227","msg":"process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] current status is RUNNING","canary":""}
{"level":"info","ts":"2020-03-17T13:54:32.876-0700","caller":"loadtester/concord.go:173","msg":"calling endpoint https://concord.prod.foo.com/api/v1/process/4e7f4245-85aa-4c33-a56a-d4df5b63d3fe","canary":""}
{"level":"info","ts":"2020-03-17T13:54:32.992-0700","caller":"loadtester/concord.go:227","msg":"process id [4e7f4245-85aa-4c33-a56a-d4df5b63d3fe] current status is FINISHED","canary":""}

Regarding Authentication
This implementation requires to have a Concord API key present in a file directly on the container. This can be done via mounting a k8s secret in the Loadtester's Deployment.
I went with a file over an environment variable since it's arguably more secured. Happy to switch if you think necessary.

Let me know what you think so far,

Best,

@stefanprodan
Copy link
Member

@ernst01 thanks for the PR, can you please document the webhook here https://github.com/weaveworks/flagger/blob/master/docs/gitbook/usage/webhooks.md#integration-testing

Thanks

@stefanprodan stefanprodan changed the title Issue #477: added concord test support to loadtester loadtester: add concord test support Mar 18, 2020
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @ernst01 🏅

@stefanprodan stefanprodan merged commit d6d65e2 into fluxcd:master Mar 19, 2020
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.

Add ability to run Concord test jobs to Flagger's Loadtester
2 participants