AWX HA - K8s ?

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?

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?

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 ?

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

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

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

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

Thanks Alberto

I will check and analyze all those infos :slight_smile:

Do you think OpenShift is better than Kubernetes ?

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 ?

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 awx-web-svc http edge/Redirect None