Closed S-mishina closed 1 year ago
Support Custom labels and annotations to be added to Pod template of a Gatling runner job
Relevant Issue: https://github.com/st-tech/gatling-operator/issues/62
get ObjectMeta
Add type to Gatling Job Pod label (Runner or Reporter)
Labels and annotations set for gatling job runer pods
Labels and annotations set for gatling job reporter pods
To add labels or annotations to the Gatling runner job, put them under metadata.
apiVersion: gatling-operator.tech.zozo.com/v1alpha1 kind: Gatling metadata: name: gatling-sample01 labels: app: my-sample-app annotations: gatling-operator.tech.zozo.com/hello: "true"
We checked the operation with and without label and annotation respectively.
runner pods
when adding a label and annotation
➜ kubectl describe pods gatling-sample01-runner-5mt4k Name: gatling-sample01-runner-5mt4k Namespace: default Priority: 0 Node: gatling-cluster-worker/172.18.0.2 Start Time: Wed, 02 Nov 2022 11:29:49 +0900 Labels: controller-uid=ded0c1ac-3ae2-4526-af9c-8182210feeb0 gatling-waiter=initialized job-name=gatling-sample01-runner app=my-sample-app type=runner Annotations: gatling-operator.tech.zozo.com/hello: true
when not adding a label and annotation
➜ kubectl describe pods gatling-sample01-runner-5hcz2 Name: gatling-sample01-runner-5hcz2 Namespace: default Priority: 0 Node: gatling-cluster-worker/172.18.0.2 Start Time: Wed, 02 Nov 2022 11:45:05 +0900 Labels: controller-uid=a8786766-aa2f-4dc9-9e89-20d70429a816 gatling-waiter=initialized job-name=gatling-sample01-runner type=runner
reporter pods
➜ kubectl describe pods gatling-sample01-reporter-p5w29 Name: gatling-sample01-reporter-p5w29 Namespace: default Priority: 0 Node: gatling-cluster-worker/172.18.0.2 Start Time: Wed, 02 Nov 2022 12:30:59 +0900 Labels: app=my-sample-app controller-uid=5ddcbc7c-f6e8-4f02-830f-3ca080411a24 job-name=gatling-sample01-reporter type=reporter
➜ kubectl describe pods gatling-sample01-reporter-szdng Name: gatling-sample01-reporter-szdng Namespace: default Priority: 0 Node: gatling-cluster-worker/172.18.0.2 Start Time: Wed, 02 Nov 2022 12:27:12 +0900 Labels: controller-uid=395508b2-13b9-4121-ab83-31a393f7adfb job-name=gatling-sample01-reporter type=reporter
Please check if applicable
Relevant issue https://github.com/st-tech/gatling-operator/issues/62
Adding @akitok @ksudate to reviewers
Add @ikuwow for reviewers
Description
Support Custom labels and annotations to be added to Pod template of a Gatling runner job
Relevant Issue: https://github.com/st-tech/gatling-operator/issues/62
What's been changed / added?
get ObjectMeta
Add type to Gatling Job Pod label (Runner or Reporter)
Labels and annotations set for gatling job runer pods
Labels and annotations set for gatling job reporter pods
How to add label and annotation to a Gatling runner job
To add labels or annotations to the Gatling runner job, put them under metadata.
Testing
We checked the operation with and without label and annotation respectively.
runner pods
when adding a label and annotation
when not adding a label and annotation
reporter pods
when adding a label and annotation
when not adding a label and annotation
Checklist
Please check if applicable
Relevant issue https://github.com/st-tech/gatling-operator/issues/62