Ansible AWX Operator on Ubuntu with MicroK8s
This guide provides instructions for installing Ansible AWX Operator on Ubuntu using MicroK8s, as an alternative to the official MiniKube documentation. The tutorial uses Ubuntu 21.10 Server and AWX-Operator version 0.15.0.
Preparation
Install MicroK8s as a snap package and enable the necessary modules:
sudo snap install microk8s --classic
sudo microk8s enable dns storage
Create kubectl aliases and symlinks for operator compatibility:
sudo snap alias microk8s.kubectl kubectl
sudo ln -s /var/snap/microk8s/current/bin/kubectl /usr/local/bin/kubectl
Add your user to the microk8s group, then install make and clone the operator repository:
sudo usermod -aG microk8s $USER
sudo apt install make -y
git clone https://github.com/ansible/awx-operator.git
cd awx-operator
git checkout 0.15.0
Installation
Set the namespace variable and run the make deploy command:
export NAMESPACE=awx
make deploy
Create an awx.yml configuration file specifying the nodeport service type:
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
spec:
service_type: nodeport
Configure the default kubectl context to the awx namespace, then apply the deployment and monitor the logs:
kubectl config set-context --current --namespace=awx
kubectl apply -f awx.yml
kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager
Wait for all pods to reach a running state:
kubectl get pods -n awx
Retrieve the service port:
kubectl get svc -n awx
Extract the admin password from the generated secret:
kubectl get secret awx-admin-password -o jsonpath="{.data.password}" | base64 --decode
Troubleshooting
A common issue occurs when the PostgreSQL pod remains in a pending state. This is typically caused by the storage module not being enabled before the initial deployment. The solution is to remove the existing deployments and reapply them in the correct order — with storage enabled first.