Skip to content

Commit

Permalink
Added Dns Config/policy and host network option for task/web/init/ee/…
Browse files Browse the repository at this point in the history
…rsyslog and redis deployments
  • Loading branch information
rakesh561 committed Jul 10, 2023
1 parent 38cfa4f commit dadd514
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 0 deletions.
120 changes: 120 additions & 0 deletions config/crd/bases/awx.ansible.com_awxs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,126 @@ spec:
type: string
rsyslog_host_network:
type: boolean
redis_dns_config:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
redis_dns_policy:
type: string
redis_host_network:
type: boolean
ee_dns_config:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
ee_dns_policy:
type: string
ee_host_network:
type: boolean
web_dns_config:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
web_dns_policy:
type: string
web_host_network:
type: boolean
task_dns_config:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
task_dns_policy:
type: string
task_host_network:
type: boolean
init_dns_config:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
init_dns_policy:
type: string
init_host_network:
type: boolean
service_account_annotations:
description: ServiceAccount annotations
type: string
Expand Down
75 changes: 75 additions & 0 deletions config/manifests/bases/awx-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,81 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- displayName: Redis dnsPolicy Container requirements
path: redis_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: redis dnsConfig Container Requirements
path: redis_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: redis host network Container Requirements
path: redis_host_network
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- displayName: web dnsPolicy Container requirements
path: web_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: web dnsConfig Container Requirements
path: web_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: web host network Container Requirements
path: web_host_network
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- displayName: ee dnsPolicy Container requirements
path: ee_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: ee dnsConfig Container Requirements
path: ee_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: ee host network Container Requirements
path: ee_host_network
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- displayName: task dnsPolicy Container requirements
path: task_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: task dnsConfig Container Requirements
path: task_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: task host network Container Requirements
path: task_host_network
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- displayName: init dnsPolicy Container requirements
path: init_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: init dnsConfig Container Requirements
path: init_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: init host network Container Requirements
path: init_host_network
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: The PostgreSQL container is not used when an external DB is configured
displayName: PostgreSQL Container Resource Requirements
path: postgres_resource_requirements
Expand Down
10 changes: 10 additions & 0 deletions roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,16 @@ init_container_resource_requirements:
memory: 128Mi
rsyslog_host_network: false
rsyslog_dns_config: Default
redis_host_network: false
redis_dns_config: Default
ee_host_network: false
ee_dns_config: Default
init_host_network: false
init_dns_config: Default
web_host_network: false
web_dns_config: Default
task_host_network: false
task_dns_config: Default
# Add extra environment variables to the AWX task/web containers. Specify as
# literal block. E.g.:
# task_extra_env: |
Expand Down
38 changes: 38 additions & 0 deletions roles/installer/templates/deployments/task.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ spec:
capabilities:
add: {{ redis_capabilities }}
{% endif %}
{% if redis_host_network %}
hostNetwork: {{ redis_host_network }}
{% endif %}
{% if redis_dns_policy %}
dnsPolicy: {{ redis_dns_policy }}
{% endif %}
{% if redis_dns_policy == 'None' and redis_dns_config is defined }}
dnsConfig: {{ redis_dns_config }}
{% endif %}

args: ["redis-server", "/etc/redis.conf"]
volumeMounts:
- name: {{ ansible_operator_meta.name }}-redis-config
Expand Down Expand Up @@ -185,6 +195,15 @@ spec:
{% if task_command %}
command: {{ task_command }}
{% endif %}
{% if task_host_network %}
hostNetwork: {{ task_host_network }}
{% endif %}
{% if task_dns_policy %}
dnsPolicy: {{ task_dns_policy }}
{% endif %}
{% if task_dns_policy == 'None' and task_dns_config is defined }}
dnsConfig: {{ task_dns_config }}
{% endif %}
{% if task_args %}
args: {{ task_args }}
{% endif %}
Expand Down Expand Up @@ -321,6 +340,16 @@ spec:
{% if ee_extra_volume_mounts -%}
{{ ee_extra_volume_mounts | indent(width=12, first=True) }}
{% endif %}
{% if ee_host_network %}
hostNetwork: {{ ee_host_network }}
{% endif %}
{% if ee_dns_policy %}
dnsPolicy: {{ ee_dns_policy }}
{% endif %}
{% if ee_dns_policy == 'None' and ee_dns_config is defined }}
dnsConfig: {{ ee_dns_config }}
{% endif %}

{% if termination_grace_period_seconds is defined %}
- name: pre-stop-data
mountPath: /var/lib/pre-stop
Expand Down Expand Up @@ -348,6 +377,15 @@ spec:
{% if rsyslog_command %}
command: {{ rsyslog_command }}
{% endif %}
{% if rsyslog_host_network %}
hostNetwork: {{ rsyslog_host_network }}
{% endif %}
{% if rsyslog_dns_policy %}
dnsPolicy: {{ rsyslog_dns_policy }}
{% endif %}
{% if rsyslog_dns_policy == 'None' and rsyslog_dns_config is defined }}
dnsConfig: {{ rsyslog_dns_config }}
{% endif %}
{% if rsyslog_args %}
args: {{ rsyslog_args }}
{% endif %}
Expand Down
28 changes: 28 additions & 0 deletions roles/installer/templates/deployments/web.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ spec:
- name: "{{ ansible_operator_meta.name }}-projects"
mountPath: "/var/lib/awx/projects"
{% endif %}
{% if init_host_network %}
hostNetwork: {{ init_host_network }}
{% endif %}
{% if init_dns_policy %}
dnsPolicy: {{ init_dns_policy }}
{% endif %}
{% if init_dns_policy == 'None' and init_dns_config is defined }}
dnsConfig: {{ init_dns_config }}
{% endif %}

containers:
- image: '{{ _redis_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
Expand All @@ -130,6 +140,15 @@ spec:
securityContext:
capabilities:
add: {{ redis_capabilities }}
{% endif %}
{% if redis_host_network %}
hostNetwork: {{ redis_host_network }}
{% endif %}
{% if redis_dns_policy %}
dnsPolicy: {{ redis_dns_policy }}
{% endif %}
{% if redis_dns_policy == 'None' and redis_dns_config is defined }}
dnsConfig: {{ redis_dns_config }}
{% endif %}
args: ["redis-server", "/etc/redis.conf"]
volumeMounts:
Expand Down Expand Up @@ -357,6 +376,15 @@ spec:
- key: bundle-ca.crt
path: 'bundle-ca.crt'
{% endif %}
{% if web_host_network %}
hostNetwork: {{ web_host_network }}
{% endif %}
{% if web_dns_policy %}
dnsPolicy: {{ web_dns_policy }}
{% endif %}
{% if web_dns_policy == 'None' and web_dns_config is defined }}
dnsConfig: {{ web_dns_config }}
{% endif %}
{% if ingress_type | lower == 'route' and route_tls_termination_mechanism | lower == 'passthrough' %}
- name: "{{ ansible_operator_meta.name }}-nginx-certs"
secret:
Expand Down

0 comments on commit dadd514

Please sign in to comment.