# AWX HA - K8s ?

**URL:** <https://forum.ansible.com/t/awx-ha-k8s/32448>\
**Category:** AWX Project\
**Tags:** awx, kubernetes\
**Created:** [March 12, 2020, 7:42am UTC](https://forum.ansible.com/t/awx-ha-k8s/32448 "2020-03-12T07:42:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![driCs](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@driCs](https://forum.ansible.com/u/driCs)\
**Post date:** [March 12, 2020, 7:42am UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/1 "2020-03-12T07:42:40Z")

</div>

Hello,

Can you confirm that it is possible to cluster with AWX?  
I mean that if I have 3 servers and the first one fails then the second or third one will take the load automatically (fail-over).

If yes what is the official method because there is some information about it but it is always a bit different from each other.

…and if high availability exists, is it a requirement to use K8S?

---

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez\_Loza](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alberto\_Jimenez\_Loza](https://forum.ansible.com/u/Alberto_Jimenez_Loza)\
**Post date:** [March 12, 2020, 11:20am UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/2 "2020-03-12T11:20:32Z")

</div>

I have installed AWX in OCP4.2. and it works OK.

oc get pods  
NAME READY STATUS RESTARTS AGE  
awx-0 4/4 Running 0 6d22h  
postgresql-1-deploy 0/1 Completed 0 7d1h  
postgresql-1-fcnml 1/1 Running 0 7d1h

You can scale the awx-0 pod and generate multiple AWX instances that work as a resizable cluster.

oc scale --replicas=2 statefulsets awx  
statefulset.apps/awx scaled

oc get pods  
NAME READY STATUS RESTARTS AGE  
awx-0 4/4 Running 0 6d22h  
awx-1 4/4 Running 0 6m42s  
postgresql-1-deploy 0/1 Completed 0 7d1h  
postgresql-1-fcnml 1/1 Running 0 7d1h

Is something like this what you want to create?

---

<div class="post-metadata">

**Author:** ![driCs](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@driCs](https://forum.ansible.com/u/driCs)\
**Post date:** [March 12, 2020, 12:21pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/3 "2020-03-12T12:21:10Z")

</div>

Hi Alberto,

Thanks for your feedback  
Yes It’s something like that I want but either with K8S or docker-compose …

This configuration is a HA mode ?  
And is it possible to have an external database ?

---

<div class="post-metadata">

**Author:** ![driCs](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@driCs](https://forum.ansible.com/u/driCs)\
**Post date:** [March 12, 2020, 12:23pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/4 "2020-03-12T12:23:18Z")

</div>

another question : Could you share me your inventory AWX file to get and see a concrete example ? 🙂

---

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez\_Loza](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alberto\_Jimenez\_Loza](https://forum.ansible.com/u/Alberto_Jimenez_Loza)\
**Post date:** [March 12, 2020, 12:48pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/5 "2020-03-12T12:48:43Z")

</div>

Yes, the configuration is HA MODE.

Postgres is a external database with persistent storage.

As a requirement, you must previously create a pvc named postgresql

For inventory configuration I use this link:

[https://gist.github.com/infamousjoeg/51de0e4d008e2b418233d5f848777d29](https://gist.github.com/infamousjoeg/51de0e4d008e2b418233d5f848777d29)

And when I did the AWX installation in OCP, I found a bug.

[https://github.com/ansible/awx/issues/5501](https://github.com/ansible/awx/issues/5501)

And I configured /var/lib/awx/projects with persistent storage too with this link:

[https://casesup.com/category/blog/devops/deployment-of-ansible-awx-on-openshift-origin](https://casesup.com/category/blog/devops/deployment-of-ansible-awx-on-openshift-origin)

---

<div class="post-metadata">

**Author:** ![driCs](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@driCs](https://forum.ansible.com/u/driCs)\
**Post date:** [March 12, 2020, 1:03pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/6 "2020-03-12T13:03:54Z")

</div>

Thanks Alberto

I will check and analyze all those infos 🙂

Do you think OpenShift is better than Kubernetes ?

---

<div class="post-metadata">

**Author:** ![driCs](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@driCs](https://forum.ansible.com/u/driCs)\
**Post date:** [March 17, 2020, 3:25pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/7 "2020-03-17T15:25:57Z")

</div>

Hi Alberto

I can’t access to AWX using an URL and with the deployment from Kubernetes .  
how did you fix this problem or configure it with on Openshift ?

---

<div class="post-metadata">

**Author:** ![Alberto\_Jimenez\_Loza](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alberto\_Jimenez\_Loza](https://forum.ansible.com/u/Alberto_Jimenez_Loza)\
**Post date:** [March 17, 2020, 8:54pm UTC](https://forum.ansible.com/t/awx-ha-k8s/32448/8 "2020-03-17T20:54:50Z")

</div>

I had no problem with the pod of the web part in the OCP4.2 installation.

oc get route  
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD  
awx-web-svc [awx-web-svc-awx.apps.mydomain.com](http://awx-web-svc-awx.apps.mydomain.com) awx-web-svc http edge/Redirect None
