awx-operator icon indicating copy to clipboard operation
awx-operator copied to clipboard

Add 'labels' to the Helm chart to simplify the declaration of labels

Open sbilque opened this issue 1 year ago • 3 comments

SUMMARY

Add labels to the Helm chart to simplify the declaration of custom labels.

ISSUE TYPE
  • New or Enhanced Feature
ADDITIONAL INFORMATION
  • This change allows the labels defined in the additional_labels parameters to be specified in the same values.xml file.
  • These labels are also added to the awx-operator-controller-manager pod. Useful when labels are used to control pod creation based on label rules.

Sample of values.xml

AWX:
  enabled: true
  labels:
    my/team: "foo"
    my/service: "bar"
    my/do-not-inherit: "yes"
  name: awx
  spec:
    additional_labels:
    - my/team
    - my/service

Resulting ressources: Definitions are truncated to make this easier to read.

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx-demo
  labels:
    my/team: foo
    my/service: bar
    my/do-not-inherit: yes
spec:
  additional_labels:
  - my/team
  - my/service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: awx-operator-controller-manager
  labels:
    control-plane: controller-manager
    helm.sh/chart: awx-operator
    my/team: foo
    my/service: bar
    my/do-not-inherit: yes
spec:
  template:
    metadata:
      labels:
        control-plane: controller-manager
        helm.sh/chart: awx-operator
        my/team: foo
        my/service: bar
        my/do-not-inherit: yes        

sbilque avatar May 28 '24 08:05 sbilque

Can someone from the community who uses helm give this a try?

rooftopcellist avatar Jun 12 '24 18:06 rooftopcellist

@sbilque thank you so much for your contribution! Would you mind rebasing and resolving the merge conflicts? Thank you for your time!

djyasin avatar Jul 24 '24 18:07 djyasin