Site icon Ron Ekins' – Oracle Technology, DevOps and Kubernetes Blog

How to install the Ansible AWX Kubernetes Operator on your Laptop using Podman and Minikube

Linux administrator using a laptop with Ansible commands, Linux books, and Red Hat imagery

A Linux administrator works through Ansible automation commands in a colorful tech-filled workspace.

Background

Ansible AWX provides an open-source, web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.

I have been using Ansible AWX for many years, I actually have an 8 year-old video showcasing how Ansible AWX can be used to run an Ansible playbook to automate the Refresh Multiple Oracle 18c databases using ORCA.

Minikube Environment

On my MacBook I have created a Minikube environment using the Podman Desktop to provide a single-node Kubernetes environment for educational purposes.

Minkube Desktop

From the terminal interface

Kubernetes

Before we start, lets setup an alias for kubectl to avoid having to prefix every command with minikube, for example:

alias kubectl=”minikube kubectl –“

Test kubectl, for example kubectl get nodes

AWX Operator

The AWX Operator is designed to be deployed into a Kubernetes cluster(s) and can be used to install and manage the lifecycle of an AWX instance in the same namespace.

To get started create a kustomization.yml, the example is for Tag 2.19.1

kustomization.yml
# kustomization.yml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
- github.com/ansible/awx-operator/config/default?ref=2.19.1
# Set the namespace for the AWX operator
namespace: awx
# Set the image tag for the operator
images:
- name: quay.io/ansible/awx-operator
newTag: 2.19.1
- name: gcr.io/kubebuilder/kube-rbac-proxy
newName: docker.io/kubebuilder/kube-rbac-proxy
newTag: v0.15.0

Use kubectl apply -k . to create the awx namespace, and deploy the AWX Operator into the Kubernetes cluster.

Wait a few minutes, and check progress…

Wait until the awx-operator pod shows a Running status.

Use kubectl describe pod <pod name> to get more details.

And kubectl logs pod/pod name> to see the log.

Note: Use kubectl config set-context –current –namespace=awx to set the default context to awx to avoid having to specify -n awx each time.

Create a new file called awx-instance.yml

awx-instance.yml
---
# awx-instance.yml
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx
namespace: awx
spec:
service_type: NodePort

And add this to the kustomization.yml file in the resources section. for example:

kustomization.yml
...
resources:
- github.com/ansible/awx-operator/config/default?ref=<tag>
# Add this extra line:
- awx-instance.yml
...

And apply using kubectl apply -k .

After a few seconds, you should see the operator begining to create the new resources:

List Kubernetes services using kubectl get svc

Use kubectl logs to check logs

By default, the awx admin user is admin, obtain the password from the kubernetes awx-admin-password secret, as below:

AWX WebUI Connectivity

We can now test the AWX WebUI using the using Kubernetes awx-service

Minikube will automatically open a new AWX browser tab, enter a Username of ‘admin‘ and the Password obtained from the awx-admin-password.

AWX Login

And if all has gone well, you should be presented with the AWX Dashboard to start.

AWX Dashboard

Summary

In this blog post I have shared how to install the Ansible AWX Operator on a Mac Laptop with Podman Desktop and Minikube.

Exit mobile version