Skip to content

Install Ansible AWX on Kubernetes

Avatar photo

Ansible AWX is one of the upstream project for Red Hat Ansible Tower. AWX provides a web-based user interface, REST API, and task engine built on top of Ansible.

Installation of Ansible AWX is simple and pretty straightforward with latest version. (If you are trying to install older than version 18, then you need to follow the docker based method.) AWX will be installed using AWX Operator on top of Kubernetes or OpenShift cluster.

Setup a Kubernetes Cluster

You can use any existing or new cluster or even spin up a minikube cluster on your laptop/workstation for testing purpose.

Read : How to Install a minikube on GCP or Install minikube using Vagrant and VirtualBox

Please note down the memory and cpu requirements as Ansible AWX pods need some minimum resource to run.

$ minikube start --addons=ingress --cni=flannel --install-addons=true \
    --kubernetes-version=stable \
    --vm-driver=docker --wait=false \
    --cpus=4 --memory=6g

Enable Addons as needed

## Check addons
$ minikube addons list
$ minikube addons enable metrics-server
$ minikube dashboard

Deploy AWX Operator

Access your cluster and deploy AWX operator; replaceย TAGย with the version fromย Release Page

$ kubectl apply -f<TAG>/deploy/awx-operator.yaml

Create AWX Deployment

Create a fileย awx-demo.yaml with below content.

kind: AWX
  name: awx-demo
  service_type: nodeport
  ingress_type: none

Create the resource.

$ kubectl apply -f awx-demo.yml created

Referย AWX Operatorย documentation for advanced installation options.

Get the Admin Password for Ansible AWX

By default, the admin user isย adminย and the password is available in theย <resourcename>-admin-passwordย secret.

$ kubectl get secret awx-demo-admin-password \
  -o jsonpath="{.data.password}" | base64 --decode

Get the Path to Access Ansible AWX

You will find theย NodePortย and IP for serviceย awx-demo-service

$ kubectl get svc
NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
awx-demo-postgres      ClusterIP   None             <none>        5432/TCP            23m
awx-demo-service       NodePort   <none>        80:31726/TCP        23m
awx-operator-metrics   ClusterIP    <none>        8383/TCP,8686/TCP   23m
kubernetes             ClusterIP        <none>        443/TCP             26m

Now you can access the Ansible AWX Portal atย IP_ADDRESS:NODE_PORT.

Access Ansible AWX on Remote Minikube or Kubernetes Cluster

If your Kubernetes/minikube Cluster is on Remote Machine/VM (eg: Cloud Instance with Public IP) then you can access it using above method (if NodePort is same is remote IP) or you can use LoadBalancer methods.

In our case, we have deployed this in a Google Cloud instance without GUI and we need to enabled port-forwarding as below.

$ minikube ser## Forward localhost (minkube VM Localhost) port 7080 -> 80
$ kubectl port-forward service/awx-demo-service 7080:80

So the Ansible AWX service is available at minikube VM localhost:7080 now; but we dont have GUI there to access !!

So, we do a port-forwarding from our laptop/workstation via SSH Tunnel.

## On your Workstation/Laptop
## eg: ssh -L LOCAL_PORT:localhost:REMOTE_PORT User@REMOTE_IP
$ ssh -L 7080:localhost:7080 [email protected]

Now, open a browser on your laptop/workstation and goto localhost:7080; thatโ€™s it.

Enjoyย Ansible AWXย running on top ofย Kubernetes or minikube.


The views expressed and the content shared in all published articles on this website are solely those of the respective authors, and they do not necessarily reflect the views of the author’s employer or the techbeatly platform. We strive to ensure the accuracy and validity of the content published on our website. However, we cannot guarantee the absolute correctness or completeness of the information provided. It is the responsibility of the readers and users of this website to verify the accuracy and appropriateness of any information or opinions expressed within the articles. If you come across any content that you believe to be incorrect or invalid, please contact us immediately so that we can address the issue promptly.

Avatar photo
Gineesh Madapparambath is the founder of techbeatly and he is the author of the book - ๐—”๐—ป๐˜€๐—ถ๐—ฏ๐—น๐—ฒ ๐—ณ๐—ผ๐—ฟ ๐—ฅ๐—ฒ๐—ฎ๐—น-๐—Ÿ๐—ถ๐—ณ๐—ฒ ๐—”๐˜‚๐˜๐—ผ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป. He has worked as a Systems Engineer, Automation Specialist, and content author. His primary focus is on Ansible Automation, Containerisation (OpenShift & Kubernetes), and Infrastructure as Code (Terraform). (aka Gini Gangadharan -


11 Responses

  1. Davide says:

    awx@vps-e49d5f4c:~$ kubectl get svc
    awx-demo-postgres ClusterIP None 5432/TCP 39m
    awx-demo-service NodePort 80:32739/TCP 39m
    awx-operator-metrics ClusterIP 8383/TCP,8686/TCP 40m
    kubernetes ClusterIP 443/TCP 42m
    awx@vps-e49d5f4c:~$ kubectl port-forward service/awx-demo-service 7080:80

    error: timed out waiting for the condition

  2. can you try any other service in that kubernetes cluster ?
    just to make sure the networking is good (maybe some simple nginx)

  3. Daniel says:

    I am looking for how to do this with AWS EKS, do you or anyone watching this space have instructions for that?

    Thank you.

  4. If you can install AWX operator, then the any kubernetes cluster is enough to install Ansible AWX.

    The steps are same and you can start with “Deploy AWX Operator” step as the AWS EKS is already under your control (no need to worry about the minikube steps here)

  5. Rio Raj says:

    How do we bulk upload hosts to awx inventory.

    awx-manage inventory_import –source=/ansible/inventory/ –inventory-name TESTINVENTORY

    The above command gives error in awx-prod-web pod

    error:- 1.006 WARNING This command is not able to run on kubernetes-based deployment. This action should be done using the API.

  6. Chandru says:

    Hi @Gineesh Madapparambath,

    how to install awx-manage command in awx-operator environmment ??

    Thank you in Advance


  7. Chandru says:

    Hi Gineesh Madapparambath

    How to install awx-manage command in ansible-operator environment ??


  8. Siva says:

    Hi @Gineesh Madapparambath,

    How to configure the external database for AWX?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.