Sidekiq: Make pod deployment specific labels spread across all objects
What does this MR do?
This enables us to send common labels that are set at the pod level of sidekiq (for every sidekiq deployment), those labels are also sent into all other objects that are pod dependent, HPAs, PDBs, and a queue specific ConfigMap.
Using the below example:
gitlab:
sidekiq:
common:
labels:
foo: sidekiq-common
podLabels:
foo: sidekiq-pod
pods:
- name: pod-0
queues: foo
- name: pod-1
podLabels:
foo: pod-1
queues: bar
- name: pod-2
podLabels:
foo: pod-2
common:
labels:
foo: pod-common-2
queues: baz
It is expected that:
- All objects associated with
pod-0
will look SIMILAR to the below example Deployment object:
metadata:
name: RELEASE-NAME-sidekiq-pod-0-v1
labels:
foo: sidekiq-common
queue-pod-name: pod-0
annotations:
spec:
template:
metadata:
labels:
foo: sidekiq-pod
queue-pod-name: pod-0
- All objects associated with
pod-1
will look SIMILAR to the below example Deployment object.
metadata:
name: RELEASE-NAME-sidekiq-pod-1-v1
labels:
foo: sidekiq-common
queue-pod-name: pod-1
annotations:
spec:
template:
metadata:
labels:
foo: pod-1
queue-pod-name: pod-1
- All objects associated with
pod-2
will look SIMILAR to the below example Deployment object
metadata:
name: RELEASE-NAME-sidekiq-pod-2-v1
labels:
foo: pod-common-2
queue-pod-name: pod-2
annotations:
spec:
template:
metadata:
labels:
foo: pod-2
queue-pod-name: pod-2
Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
Merge Request Title and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA -
Equivalent MR/issue for omnibus-gitlab opened
Edited by Jason Plum