Skip to content

Commit

Permalink
Merge pull request #1 from locmai/pod-labels
Browse files Browse the repository at this point in the history
Add pod_labels for custom pod labels
  • Loading branch information
hungtran84 authored Nov 29, 2021
2 parents 57aa585 + daf1c57 commit a8479c9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/crd/bases/awx.ansible.com_awxs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ spec:
node_selector:
description: nodeSelector for the pods
type: string
pod_labels:
description: Additional labels to apply to the pod
type: string
service_labels:
description: Additional labels to apply to the service
type: string
Expand Down
6 changes: 6 additions & 0 deletions config/manifests/bases/olm-parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Pod Labels
path: pod_labels
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Service Labels
path: service_labels
x-descriptors:
Expand Down
6 changes: 6 additions & 0 deletions roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ deployment_type: awx
kind: '{{ deployment_type | upper }}'
api_version: '{{ deployment_type }}.ansible.com/v1beta1'

# Custom labels for the tower pod. Specify as literal block. E.g.:
# pod_labels: |
# environment: non-production
# zone: internal
pod_labels: ''

database_name: "{{ deployment_type }}"
database_username: "{{ deployment_type }}"

Expand Down
1 change: 1 addition & 0 deletions roles/installer/templates/deployment.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
app.kubernetes.io/component: '{{ deployment_type }}'
{{ pod_labels | indent(width=8) }}
spec:
serviceAccountName: '{{ ansible_operator_meta.name }}'
{% if image_pull_secret %}
Expand Down

0 comments on commit a8479c9

Please sign in to comment.