mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 14:22:49 +00:00
Use relatedImages to make disconnected deployments possible
* Add ability to pass images in from the CSV for disconnected installs Signed-off-by: Christian M. Adams <chadams@redhat.com>
This commit is contained in:
@@ -163,7 +163,7 @@ awx.awx.ansible.com/awx-demo created
|
|||||||
After a few minutes, the new AWX instance will be deployed. You can look at the operator pod logs in order to know where the installation process is at:
|
After a few minutes, the new AWX instance will be deployed. You can look at the operator pod logs in order to know where the installation process is at:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ kubectl logs -f deployments/awx-operator-controller-manager -c manager
|
$ kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager
|
||||||
```
|
```
|
||||||
|
|
||||||
After a few seconds, you should see the operator begin to create new resources:
|
After a few seconds, you should see the operator begin to create new resources:
|
||||||
|
|||||||
@@ -38,6 +38,16 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
|
- name: RELATED_IMAGE_APP
|
||||||
|
value: quay.io/ansible/awx:latest
|
||||||
|
- name: RELATED_IMAGE_INIT_CONTAINER
|
||||||
|
value: quay.io/centos/centos:8
|
||||||
|
- name: RELATED_IMAGE_REDIS
|
||||||
|
value: docker.io/redis:latest
|
||||||
|
- name: RELATED_IMAGE_CONTROL_PLANE_EE
|
||||||
|
value: quay.io/ansible/awx-ee:latest
|
||||||
|
- name: RELATED_IMAGE_POSTGRES
|
||||||
|
value: postgres:12
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
k8s_log:
|
k8s_log:
|
||||||
name: '{{ item.metadata.name }}'
|
name: '{{ item.metadata.name }}'
|
||||||
namespace: '{{ namespace }}'
|
namespace: '{{ namespace }}'
|
||||||
container: manager
|
container: awx-manager
|
||||||
loop: "{{ q('k8s', api_version='v1', kind='Pod', namespace=namespace, label_selector=ctrl_label) }}"
|
loop: "{{ q('k8s', api_version='v1', kind='Pod', namespace=namespace, label_selector=ctrl_label) }}"
|
||||||
register: debug_logs
|
register: debug_logs
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,17 @@
|
|||||||
when:
|
when:
|
||||||
- backup_pvc == '' or backup_pvc is not defined
|
- backup_pvc == '' or backup_pvc is not defined
|
||||||
|
|
||||||
|
- name: Set user provided postgres image
|
||||||
|
set_fact:
|
||||||
|
_custom_postgres_image: "{{ postgres_image }}:{{ postgres_image_version }}"
|
||||||
|
when:
|
||||||
|
- postgres_image | default([]) | length
|
||||||
|
- postgres_image_version is defined and postgres_image_version != ''
|
||||||
|
|
||||||
|
- name: Set Postgres image URL
|
||||||
|
set_fact:
|
||||||
|
_postgres_image: "{{ _custom_postgres_image | default(lookup('env', 'RELATED_IMAGE_POSTGRES')) }}"
|
||||||
|
|
||||||
- name: Create management pod from templated deployment config
|
- name: Create management pod from templated deployment config
|
||||||
k8s:
|
k8s:
|
||||||
name: "{{ ansible_operator_meta.name }}-db-management"
|
name: "{{ ansible_operator_meta.name }}-db-management"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: {{ ansible_operator_meta.name }}-db-management
|
- name: {{ ansible_operator_meta.name }}-db-management
|
||||||
image: "{{ postgres_image }}:{{ postgres_image_version }}"
|
image: "{{ _postgres_image }}"
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command: ["sleep", "infinity"]
|
command: ["sleep", "infinity"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
@@ -52,6 +52,17 @@
|
|||||||
_pg_config: '{{ _custom_pg_config_resources["resources"] | default([]) | length | ternary(_custom_pg_config_resources, _default_pg_config_resources) }}'
|
_pg_config: '{{ _custom_pg_config_resources["resources"] | default([]) | length | ternary(_custom_pg_config_resources, _default_pg_config_resources) }}'
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
|
- name: Set user provided postgres image
|
||||||
|
set_fact:
|
||||||
|
_custom_postgres_image: "{{ postgres_image }}:{{ postgres_image_version }}"
|
||||||
|
when:
|
||||||
|
- postgres_image | default([]) | length
|
||||||
|
- postgres_image_version is defined and postgres_image_version != ''
|
||||||
|
|
||||||
|
- name: Set Postgres image URL
|
||||||
|
set_fact:
|
||||||
|
_postgres_image: "{{ _custom_postgres_image | default(lookup('env', 'RELATED_IMAGE_POSTGRES')) }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create Database configuration
|
- name: Create Database configuration
|
||||||
k8s:
|
k8s:
|
||||||
|
|||||||
@@ -32,6 +32,49 @@
|
|||||||
- 'ingress'
|
- 'ingress'
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
|
- name: Set user provided awx app image
|
||||||
|
set_fact:
|
||||||
|
_custom_image: "{{ image }}:{{ image_version }}"
|
||||||
|
when:
|
||||||
|
- image | default([]) | length
|
||||||
|
- image_version is defined or image_version != ''
|
||||||
|
|
||||||
|
- name: Set AWX App image URL
|
||||||
|
set_fact:
|
||||||
|
_image: "{{ _custom_image | default(lookup('env', 'RELATED_IMAGE_APP')) }}"
|
||||||
|
|
||||||
|
- name: Set user provided controller init image
|
||||||
|
set_fact:
|
||||||
|
_custom_init_container_image: "{{ init_container_image }}:{{ init_container_image_version }}"
|
||||||
|
when:
|
||||||
|
- init_container_image | default([]) | length
|
||||||
|
- init_container_image_version is defined or init_container_image_version != ''
|
||||||
|
|
||||||
|
- name: Set Init image URL
|
||||||
|
set_fact:
|
||||||
|
_init_container_image: "{{ _custom_init_container_image | default(lookup('env', 'RELATED_IMAGE_INIT_CONTAINER')) }}"
|
||||||
|
|
||||||
|
- name: Set user provided redis image
|
||||||
|
set_fact:
|
||||||
|
_custom_redis_image: "{{ redis_image }}:{{ redis_image_version }}"
|
||||||
|
when:
|
||||||
|
- redis_image | default([]) | length
|
||||||
|
- redis_image_version is defined or redis_image_version != ''
|
||||||
|
|
||||||
|
- name: Set Redis image URL
|
||||||
|
set_fact:
|
||||||
|
_redis_image: "{{ _custom_redis_image | default(lookup('env', 'RELATED_IMAGE_REDIS')) }}"
|
||||||
|
|
||||||
|
- name: Set user provided control plane ee image
|
||||||
|
set_fact:
|
||||||
|
_custom_control_plane_ee_image: "{{ control_plane_ee_image}}"
|
||||||
|
when:
|
||||||
|
- control_plane_ee_image | default([]) | length
|
||||||
|
|
||||||
|
- name: Set Control Plane EE image URL
|
||||||
|
set_fact:
|
||||||
|
_control_plane_ee_image: "{{ _custom_control_plane_ee_image | default(lookup('env', 'RELATED_IMAGE_CONTROL_PLANE_EE')) }}"
|
||||||
|
|
||||||
- name: Apply deployment resources
|
- name: Apply deployment resources
|
||||||
k8s:
|
k8s:
|
||||||
apply: yes
|
apply: yes
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ spec:
|
|||||||
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
|
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: init
|
- name: init
|
||||||
image: '{{ init_container_image }}:{{ init_container_image_version }}'
|
image: '{{ _init_container_image }}'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
@@ -71,7 +71,7 @@ spec:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
containers:
|
containers:
|
||||||
- image: '{{ redis_image }}:{{ redis_image_version }}'
|
- image: '{{ _redis_image }}'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
name: redis
|
name: redis
|
||||||
{% if redis_capabilities is defined and redis_capabilities %}
|
{% if redis_capabilities is defined and redis_capabilities %}
|
||||||
@@ -89,7 +89,7 @@ spec:
|
|||||||
mountPath: "/var/run/redis"
|
mountPath: "/var/run/redis"
|
||||||
- name: "{{ ansible_operator_meta.name }}-redis-data"
|
- name: "{{ ansible_operator_meta.name }}-redis-data"
|
||||||
mountPath: "/data"
|
mountPath: "/data"
|
||||||
- image: '{{ image }}:{{ image_version }}'
|
- image: '{{ _image }}'
|
||||||
name: '{{ ansible_operator_meta.name }}-web'
|
name: '{{ ansible_operator_meta.name }}-web'
|
||||||
{% if web_command %}
|
{% if web_command %}
|
||||||
command: {{ web_command }}
|
command: {{ web_command }}
|
||||||
@@ -177,7 +177,7 @@ spec:
|
|||||||
{{ web_extra_env | indent(width=12, indentfirst=True) }}
|
{{ web_extra_env | indent(width=12, indentfirst=True) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
resources: {{ web_resource_requirements }}
|
resources: {{ web_resource_requirements }}
|
||||||
- image: '{{ image }}:{{ image_version }}'
|
- image: '{{ _image }}'
|
||||||
name: '{{ ansible_operator_meta.name }}-task'
|
name: '{{ ansible_operator_meta.name }}-task'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
{% if task_privileged == true %}
|
{% if task_privileged == true %}
|
||||||
@@ -267,7 +267,7 @@ spec:
|
|||||||
{{ task_extra_env | indent(width=12, indentfirst=True) }}
|
{{ task_extra_env | indent(width=12, indentfirst=True) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
resources: {{ task_resource_requirements }}
|
resources: {{ task_resource_requirements }}
|
||||||
- image: '{{ control_plane_ee_image }}'
|
- image: '{{ _control_plane_ee_image }}'
|
||||||
name: '{{ ansible_operator_meta.name }}-ee'
|
name: '{{ ansible_operator_meta.name }}-ee'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
resources: {{ ee_resource_requirements }}
|
resources: {{ ee_resource_requirements }}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ spec:
|
|||||||
- name: {{ image_pull_secret }}
|
- name: {{ image_pull_secret }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
containers:
|
containers:
|
||||||
- image: '{{ postgres_image }}:{{ postgres_image_version }}'
|
- image: '{{ _postgres_image }}'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
name: postgres
|
name: postgres
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -71,6 +71,17 @@
|
|||||||
force: true
|
force: true
|
||||||
wait: true
|
wait: true
|
||||||
|
|
||||||
|
- name: Set user provided postgres image
|
||||||
|
set_fact:
|
||||||
|
_custom_postgres_image: "{{ postgres_image }}:{{ postgres_image_version }}"
|
||||||
|
when:
|
||||||
|
- postgres_image | default([]) | length
|
||||||
|
- postgres_image_version is defined and postgres_image_version != ''
|
||||||
|
|
||||||
|
- name: Set Postgres image URL
|
||||||
|
set_fact:
|
||||||
|
_postgres_image: "{{ _custom_postgres_image | default(lookup('env', 'RELATED_IMAGE_POSTGRES')) }}"
|
||||||
|
|
||||||
- name: Create management pod from templated deployment config
|
- name: Create management pod from templated deployment config
|
||||||
k8s:
|
k8s:
|
||||||
name: "{{ ansible_operator_meta.name }}-db-management"
|
name: "{{ ansible_operator_meta.name }}-db-management"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: {{ ansible_operator_meta.name }}-db-management
|
- name: {{ ansible_operator_meta.name }}-db-management
|
||||||
image: "{{ postgres_image }}:{{ postgres_image_version }}"
|
image: "{{ _postgres_image }}"
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command: ["sleep", "infinity"]
|
command: ["sleep", "infinity"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
Reference in New Issue
Block a user