Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PodSpec for DNS config,policy and Hostnetwork for rsyslog/redis/ee/task/init and web containers. #1471

Open
wants to merge 12 commits into
base: devel
Choose a base branch
from
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 @@ -1543,6 +1543,126 @@ spec:
type: string
type: object
type: object
rsyslog_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
rsyslog_dns_policy:
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
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 @@ -414,6 +414,81 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:resourceRequirements
- displayName: Rsyslog dnsPolicy Container requirements
path: rsyslog_dns_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: Rsyslog dnsConfig Container Requirements
path: rsyslog_dns_config
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: Rsyslog host network Container Requirements
path: rsyslog_host_network
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
- description: The PostgreSQL container is not used when an external DB is configured
displayName: PostgreSQL Container Resource Requirements
path: postgres_resource_requirements
Expand Down
11 changes: 10 additions & 1 deletion roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,16 @@ init_container_resource_requirements:
requests:
cpu: 100m
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
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 @@ -148,6 +148,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 @@ -186,6 +196,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 @@ -322,6 +341,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 @@ -349,6 +378,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
29 changes: 29 additions & 0 deletions roles/installer/templates/deployments/web.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ spec:
- name: "{{ ansible_operator_meta.name }}-projects"
mountPath: "/var/lib/awx/projects"
{% endif %}

containers:
- image: '{{ _redis_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
Expand All @@ -137,6 +138,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 @@ -266,8 +276,18 @@ spec:
{% if rsyslog_command %}
command: {{ rsyslog_command }}
{% endif %}

{% if rsyslog_args %}
args: {{ rsyslog_args }}
{% 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 %}
imagePullPolicy: '{{ image_pull_policy }}'
volumeMounts:
Expand Down Expand Up @@ -362,6 +382,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
Loading