2018-08-14 19:22:43 +03:00
---
apiVersion: v1
kind: Pod
metadata:
name: ansible-tower-management
namespace: {{ kubernetes_namespace }}
spec:
2020-02-19 11:11:34 +03:00
{% if kubernetes_image_pull_secrets is defined %}
imagePullSecrets:
- name: "{{ kubernetes_image_pull_secrets }}"
{% endif %}
2018-08-14 19:22:43 +03:00
containers:
- name: ansible-tower-management
2018-10-09 21:38:18 +03:00
image: "{{ kubernetes_task_image }}:{{ kubernetes_task_version }}"
2018-08-14 19:22:43 +03:00
command: ["sleep", "infinity"]
volumeMounts:
- name: {{ kubernetes_deployment_name }}-application-config
2019-03-29 22:11:52 +03:00
mountPath: "/etc/tower/settings.py"
subPath: settings.py
2018-08-14 19:22:43 +03:00
readOnly: true
2019-03-26 22:13:20 +03:00
- name: "{{ kubernetes_deployment_name }}-application-credentials"
2018-08-14 19:22:43 +03:00
mountPath: "/etc/tower/conf.d/"
readOnly: true
2019-03-29 22:11:52 +03:00
- name: {{ kubernetes_deployment_name }}-secret-key
mountPath: "/etc/tower/SECRET_KEY"
subPath: SECRET_KEY
readOnly: true
2019-01-12 04:41:32 +03:00
resources:
{% if management_mem_limit is defined or management_cpu_limit is defined %}
limits:
{% endif %}
{% if management_mem_limit is defined %}
memory: "{{ management_mem_limit }}Gi"
{% endif %}
{% if management_cpu_limit is defined %}
cpu: "{{ management_cpu_limit }}m"
2019-05-02 21:43:01 +03:00
{% endif %}
{% if tolerations is defined %}
tolerations:
{{ tolerations | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
{% endif %}
{% if node_selector is defined %}
nodeSelector:
{{ node_selector | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
{% endif %}
{% if affinity is defined %}
affinity:
{{ affinity | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
2019-01-12 04:41:32 +03:00
{% endif %}
2018-08-14 19:22:43 +03:00
volumes:
- name: {{ kubernetes_deployment_name }}-application-config
configMap:
name: {{ kubernetes_deployment_name }}-config
items:
- key: {{ kubernetes_deployment_name }}_settings
path: settings.py
2019-03-29 22:11:52 +03:00
- name: {{ kubernetes_deployment_name }}-secret-key
secret:
secretName: "{{ kubernetes_deployment_name }}-secrets"
items:
2018-08-14 19:22:43 +03:00
- key: secret_key
path: SECRET_KEY
2019-03-26 22:13:20 +03:00
- name: "{{ kubernetes_deployment_name }}-application-credentials"
2018-08-14 19:22:43 +03:00
secret:
secretName: "{{ kubernetes_deployment_name }}-secrets"
items:
2019-03-26 22:13:20 +03:00
- key: credentials_py
path: 'credentials.py'
2018-08-14 19:22:43 +03:00
restartPolicy: Never