mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Add scalable cluster kubernetes support
This commit is contained in:
@@ -96,6 +96,12 @@
|
|||||||
path: "{{ kubernetes_base_path }}"
|
path: "{{ kubernetes_base_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Template Kubernetes AWX etcd2
|
||||||
|
template:
|
||||||
|
src: etcd.yml.j2
|
||||||
|
dest: "{{ kubernetes_base_path }}/etcd.yml"
|
||||||
|
mode: '0600'
|
||||||
|
|
||||||
- name: Template Kubernetes AWX Config
|
- name: Template Kubernetes AWX Config
|
||||||
template:
|
template:
|
||||||
src: configmap.yml.j2
|
src: configmap.yml.j2
|
||||||
@@ -108,6 +114,9 @@
|
|||||||
dest: "{{ kubernetes_base_path }}/deployment.yml"
|
dest: "{{ kubernetes_base_path }}/deployment.yml"
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
|
||||||
|
- name: Apply etcd deployment
|
||||||
|
shell: "kubectl apply -f {{ kubernetes_base_path }}/etcd.yml"
|
||||||
|
|
||||||
- name: Apply Configmap
|
- name: Apply Configmap
|
||||||
shell: "kubectl apply -f {{ kubernetes_base_path }}/configmap.yml"
|
shell: "kubectl apply -f {{ kubernetes_base_path }}/configmap.yml"
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ data:
|
|||||||
# Container environments don't like chroots
|
# Container environments don't like chroots
|
||||||
AWX_PROOT_ENABLED = False
|
AWX_PROOT_ENABLED = False
|
||||||
|
|
||||||
|
AWX_AUTO_DEPROVISION_INSTANCES = True
|
||||||
|
|
||||||
#Autoprovisioning should replace this
|
#Autoprovisioning should replace this
|
||||||
CLUSTER_HOST_ID = socket.gethostname()
|
CLUSTER_HOST_ID = socket.gethostname()
|
||||||
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
|||||||
@@ -41,18 +41,42 @@ 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: "false"
|
||||||
|
- name: CLEANUP_INTERVAL
|
||||||
|
value: "30"
|
||||||
- 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/kubernetes/templates/etcd.yml.j2
Normal file
44
installer/kubernetes/templates/etcd.yml.j2
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: etcd
|
||||||
|
namespace: {{ awx_kubernetes_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_kubernetes_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