mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Update openshift installer to support rabbitmq autoscale
* Switch rabbitmq container out for one that supports autoscale * Add etcd pod to support autoscale negotiation
This commit is contained in:
@@ -121,6 +121,15 @@
|
|||||||
dest: "{{ openshift_base_path }}/deployment.yml"
|
dest: "{{ openshift_base_path }}/deployment.yml"
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
|
||||||
|
- name: Template Openshift AWX etcd2
|
||||||
|
template:
|
||||||
|
src: etcd.yml.j2
|
||||||
|
dest: "{{ openshift_base_path }}/etcd.yml"
|
||||||
|
mode: '0600'
|
||||||
|
|
||||||
|
- name: Apply etcd deployment
|
||||||
|
shell: "oc apply -f {{ openshift_base_path }}/etcd.yml"
|
||||||
|
|
||||||
- name: Apply Configmap
|
- name: Apply Configmap
|
||||||
shell: "oc apply -f {{ openshift_base_path }}/configmap.yml"
|
shell: "oc apply -f {{ openshift_base_path }}/configmap.yml"
|
||||||
|
|
||||||
|
|||||||
@@ -41,18 +41,40 @@ spec:
|
|||||||
- name: AWX_ADMIN_PASSWORD
|
- name: AWX_ADMIN_PASSWORD
|
||||||
value: {{ default_admin_password|default('password') }}
|
value: {{ default_admin_password|default('password') }}
|
||||||
- name: awx-rabbit
|
- name: awx-rabbit
|
||||||
image: rabbitmq:3
|
image: ansible/awx_rabbitmq:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
|
# For consupmption by rabbitmq-env.conf
|
||||||
|
- name: MY_POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
|
- name: RABBITMQ_USE_LONGNAME
|
||||||
|
value: "true"
|
||||||
|
- name: ERLANG_COOKIE
|
||||||
|
value: "test"
|
||||||
- name: RABBITMQ_ERLANG_COOKIE
|
- name: RABBITMQ_ERLANG_COOKIE
|
||||||
value: secretb
|
value: "secretb"
|
||||||
- name: RABBITMQ_NODENAME
|
- name: RABBITMQ_NODENAME
|
||||||
value: rabbitmq
|
value: "rabbit@$(MY_POD_IP)"
|
||||||
|
- name: AUTOCLUSTER_TYPE
|
||||||
|
value: "etcd"
|
||||||
|
- name: AUTOCLUSTER_DELAY
|
||||||
|
value: "60"
|
||||||
|
- name: ETCD_HOST
|
||||||
|
value: "etcd"
|
||||||
|
- name: AUTOCLUSTER_CLEANUP
|
||||||
|
value: "true"
|
||||||
|
- name: CLEANUP_WARN_ONLY
|
||||||
|
value: "true"
|
||||||
- name: RABBITMQ_DEFAULT_USER
|
- name: RABBITMQ_DEFAULT_USER
|
||||||
value: awx
|
value: awx
|
||||||
- name: RABBITMQ_DEFAULT_PASS
|
- name: RABBITMQ_DEFAULT_PASS
|
||||||
value: abcdefg
|
value: abcdefg
|
||||||
- name: RABBITMQ_DEFAULT_VHOST
|
- name: RABBITMQ_DEFAULT_VHOST
|
||||||
value: awx
|
value: awx
|
||||||
|
- name: RABBITMQ_CONFIG_FILE
|
||||||
|
value: /etc/rabbitmq/rabbitmq
|
||||||
- name: awx-memcached
|
- name: awx-memcached
|
||||||
image: memcached
|
image: memcached
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
44
installer/openshift/templates/etcd.yml.j2
Normal file
44
installer/openshift/templates/etcd.yml.j2
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: etcd
|
||||||
|
namespace: {{ awx_openshift_project }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
name: awx-etcd2
|
||||||
|
service: etcd
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: etcd
|
||||||
|
image: elcolio/etcd:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 4001
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: datadir
|
||||||
|
volumes:
|
||||||
|
- name: datadir
|
||||||
|
emptyDir: {}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
labels:
|
||||||
|
name: awx-etcd
|
||||||
|
name: etcd
|
||||||
|
namespace: {{ awx_openshift_project }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: etcd
|
||||||
|
port: 4001
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 4001
|
||||||
|
selector:
|
||||||
|
name: awx-etcd2
|
||||||
|
sessionAffinity: None
|
||||||
|
type: ClusterIP
|
||||||
Reference in New Issue
Block a user