Featured Image

• 5 Sep, 2021

Accessing Containers on AWX

How to access individual containers on AWX

If you have installed one of our AWX pre-built images, you might occassionally want to look under the hood for troubleshooting.

AWX is an open source community project, sponsored by Red Hat, that enables users to better control their community Ansible project use in IT environments. AWX is the upstream project from which the automation controller component is ultimately derived.

If you want to get started with our prebuilt images, we have them on your favourite cloud already.

Install On AWS with One-Click Install On Azure with One-Click

Since version 18, AWX runs on Kubernetes and if you have prior Kubernetes experience, this should be a breeze. Prior versions of AWX run on native docker. In that case, docker management tools will come in handy.

Lets see the pods.

To start off, we list the pods in the AWX cluster

kubectl get pods

kubectl get pods

From the list above, we have 2 pods, the PostgreSQL pod and the AWX-Deployment Pod. The AWX-Deployment pod has 4 containers, if we need to access any of the individual containers, we need to get their actual names.

kubectl get pods [podname]

in this case

kubectl get pods awx-deployment-958b5b45c-cx9st -o jsonpath='{.spec.containers[*].name}'

kubectl get pods

From the list, we have the 4 pods, namely awx-web, awx-task, awx-ee, redis

We can now safely, run exec to access any of them

kubectl exec -it [podname] -c [container name] [command inside container]

In this case;

kubectl exec -it awx-deployment-958b5b45c-cx9st -c awx-web bash

That’s all folks.

Should you need further support: support [] solvedevops.com