AWX Kubernetes

192 views
Skip to first unread message

Praveen Kumar

unread,
Aug 23, 2019, 2:59:45 PM8/23/19
to AWX Project
Hello,

I want to setup an Awx Ha environment using Kubernetes . Our Organization has Kubernetes and we want to leverage K8.
Have few questions regarding the Ansible Playbook for awx .

1) Does the playbook for K8 deploys the containers on all the Worker Nodes in the cluster ?

2) I am not able to find any task in the playbook that creates the replicasets for the Pod's in which the awx container runs. Should we deploy additional Pod's or replica sets after the one time installation is completed ?

3) Does have any one has recommendation on how Postgres should run ? Is it ok to run Postgres in the same Pod as awx_web/task, rabbitmq, memcached ? If Postgres should be external, how do we set that up in K8 ?

Please let me know if I would need to consider any thing else in general while setting up HA like environment in Kubernetes based on your experience .


Thanks,

Sujith A R

unread,
Aug 23, 2019, 9:24:50 PM8/23/19
to Praveen Kumar, AWX Project
Just FYI, there is an automated solution already available at for docker standalone method instead of Kubernetes. Check the below unofficial repository for more details which we are maintaining,


Thanks & Regards,
Sujith

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/15521056-c60f-4311-af2c-4f94d6959683%40googlegroups.com.

klaas...@gmail.com

unread,
Aug 24, 2019, 12:48:48 AM8/24/19
to awx-p...@googlegroups.com
Scaling awx in kubernetes/openshift is simply increasing the number of
awx instances. Rest should be working automatically.
For automatic increase I guess you can set it here:
https://github.com/ansible/awx/blob/devel/installer/roles/kubernetes/defaults/main.yml#L44
but I only tried that post-install not during install
> --
> You received this message because you are subscribed to the Google
> Groups "AWX Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to awx-project...@googlegroups.com
> <mailto:awx-project...@googlegroups.com>.
> <https://groups.google.com/d/msgid/awx-project/15521056-c60f-4311-af2c-4f94d6959683%40googlegroups.com?utm_medium=email&utm_source=footer>.


Praveen Kumar

unread,
Aug 29, 2019, 2:14:17 PM8/29/19
to AWX Project

Thanks Klaas.. By increasing awx instances, how does the Load of Job runs gets distributed as the instances are not clustered ?

Praveen Kumar

unread,
Aug 29, 2019, 2:15:18 PM8/29/19
to AWX Project
Thanks Sujith . Will try this , but our team wants to go with the Kubernetes way.


On Friday, August 23, 2019 at 8:24:50 PM UTC-5, Sujith A R wrote:
Just FYI, there is an automated solution already available at for docker standalone method instead of Kubernetes. Check the below unofficial repository for more details which we are maintaining,


Thanks & Regards,
Sujith

On Sat, 24 Aug, 2019, 12:29 AM Praveen Kumar, <bpk...@gmail.com> wrote:
Hello,

I want to setup an Awx Ha environment using Kubernetes . Our Organization has Kubernetes and we want to leverage K8.
Have few questions regarding the Ansible Playbook for awx .

1) Does the playbook for K8 deploys the containers on all the Worker Nodes in the cluster ?

2) I am not able to find any task in the playbook that creates the replicasets for the Pod's in which the awx container runs. Should we deploy additional Pod's or replica sets after the one time installation is completed ?

3) Does have any one has recommendation on how Postgres should run ? Is it ok to run Postgres in the same Pod as awx_web/task, rabbitmq, memcached ? If Postgres should be external, how do we set that up in K8 ?

Please let me know if I would need to consider any thing else in general while setting up HA like environment in Kubernetes based on your experience .


Thanks,

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-p...@googlegroups.com.

klaas...@gmail.com

unread,
Aug 29, 2019, 3:25:14 PM8/29/19
to awx-p...@googlegroups.com
On 29.08.19 20:14, Praveen Kumar wrote:
>
> Thanks Klaas.. By increasing awx instances, how does the Load of Job
> runs gets distributed as the instances are not clustered ?
https://docs.ansible.com/ansible-tower/latest/html/userguide/job_slices.html
is that what you're searching for?
> > an email to awx-p...@googlegroups.com <javascript:>
> > <mailto:awx-project...@googlegroups.com <javascript:>>.
> <https://groups.google.com/d/msgid/awx-project/15521056-c60f-4311-af2c-4f94d6959683%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/awx-project/15521056-c60f-4311-af2c-4f94d6959683%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "AWX Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to awx-project...@googlegroups.com
> <mailto:awx-project...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com
> <https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com?utm_medium=email&utm_source=footer>.


Praveen Kumar

unread,
Aug 29, 2019, 4:01:17 PM8/29/19
to AWX Project
Yes.. Job Slicing helps with running a given single job using all cluster nodes in Tower and by splitting the Inventory as well which is the case with the licensed version.
In Kubernetes, additional instances might help with failover(If a Pod goes down, awx can still be served from other Pod ip ), but how are the Jobs sliced across Tower nodes since
K8 is not similar to cluster based installation like Redhat/awx Ha . 
>     > <mailto:awx-project+unsub...@googlegroups.com <javascript:>>.

klaas...@gmail.com

unread,
Aug 29, 2019, 4:14:39 PM8/29/19
to awx-p...@googlegroups.com
I think it should be exactly the same for awx in kubernetes as tower in
kubernetes :)
https://github.com/ansible/awx/blob/a1fe60da78445c7970eaa823e88ce21860053785/docs/job_slicing.md
> >     > <mailto:awx-project...@googlegroups.com
> <javascript:> <javascript:>>.
> > an email to awx-p...@googlegroups.com <javascript:>
> > <mailto:awx-project...@googlegroups.com <javascript:>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com
> <https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/awx-project/2c0cc9e6-4969-4a4c-920a-bd72aea4580c%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "AWX Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to awx-project...@googlegroups.com
> <mailto:awx-project...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/awx-project/524a753f-79e8-4309-b627-8a1a1cefaaa4%40googlegroups.com
> <https://groups.google.com/d/msgid/awx-project/524a753f-79e8-4309-b627-8a1a1cefaaa4%40googlegroups.com?utm_medium=email&utm_source=footer>.


Vibin K Madampath

unread,
Nov 5, 2019, 11:59:17 PM11/5/19
to AWX Project
Hello Praveen,

Did you find any way to implement AWX HA/Cluster in kubernetes?

Even I've a requirement for the same solution. Please let us know.

Regards,
Vibin

driCs

unread,
Nov 6, 2019, 2:41:29 AM11/6/19
to AWX Project
Hello,

I would like to implement AWX HA/Cluster in Kubernetes too but I can't deploy AWX with the "official" documentation (https://github.com/ansible/awx/blob/devel/INSTALL.md#kubernetes) .
I have just uncomment the "kubernetes_context" and "kubernetes_namespace" parameters in the default inventory file but I have this error when I run the deployment.

> inventory:

localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"

[all:vars]

dockerhub_base=ansible
dockerhub_version=9.0.1

# Kubernetes Install
kubernetes_context=awx-cluster
kubernetes_namespace=awx
...


TASK [kubernetes : Get Namespace Detail] ******************************************************************************************************************
task path: /root/Kub-awx-install.9.0.1/awx/installer/roles/kubernetes/tasks/kubernetes.yml:2
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "kubectl get namespace awx", "delta": "0:00:00.313356", "end": "2019-11-06 08:30:31.489015", "msg": "non-zero return code", "rc": 1, "start": "2019-11-06 08:30:31.175659", "stderr": "error: the server doesn't have a resource type \"namespace\"", "stderr_lines": ["error: the server doesn't have a resource type \"namespace\""], "stdout": "", "stdout_lines": []}
...ignoring

TASK [kubernetes : Create AWX Kubernetes Project] *********************************************************************************************************
task path: /root/Kub-awx-install.9.0.1/awx/installer/roles/kubernetes/tasks/kubernetes.yml:7
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "kubectl create namespace awx", "delta": "0:00:00.152700", "end": "2019-11-06 08:30:31.863581", "msg": "non-zero return code", "rc": 1, "start": "2019-11-06 08:30:31.710881", "stderr": "error: no matches for kind \"Namespace\" in version \"v1\"", "stderr_lines": ["error: no matches for kind \"Namespace\" in version \"v1\""], "stdout": "", "stdout_lines": []}

PLAY RECAP ************************************************************************************************************************************************
localhost                  : ok=8    changed=2    unreachable=0    failed=1    skipped=39   rescued=0    ignored=1


When I check the Kube config file which is created in /root/.kube/config is :

apiVersion: v1
clusters: []
contexts:
- context:
    cluster: ""
    user: ""
  name: awx-cluster
current-context: ""
kind: Config
preferences: {}
users: []


Any idea ????
Thanks :)

Phil Griffiths

unread,
Nov 15, 2019, 4:54:22 AM11/15/19
to AWX Project
I've found even running as a k8s admin account, you need to create the namespace before being able to use it. So:
kubectl create namespace awx, or oc new-project awx
Reply all
Reply to author
Forward
0 new messages