Deploy AWX on GKE

Deploy AWX on GKE Welcome back to the blog! After dedicating some time to a teaching project, we’re excited to dive into a new technical series. In the upcoming weeks, i’ll be preparing for two significant exams, I plan to share insights an

Source comparison and review notes
  • Automated pair-review warning (AI bilingual content review): Spanish is explicitly labelled 'Parte 1 (awx-demo)' while English omits the part number; English nevertheless calls it a new technical series and its complete command sequence matches the Spanish Part 1, so this pairing is content-confirmed but has a title-level series-label risk.
  • Automated pair-review warning (AI bilingual content review): The Spanish source's monitoring command is misspelled 'kubctl get pods -n awx -w'; English renders the command as kubectl. The Spanish Operator documentation link is also absent from English.

Welcome back to the blog! After dedicating some time to a teaching project, we’re excited to dive into a new technical series. In the upcoming weeks, i’ll be preparing for two significant exams, I plan to share insights and create content for new posts.

This post focuses on deploying AWX on Google Kubernetes Services (GKE).

What is AWX?

AWX, or Ansible AWX, is an open-source project serving as the upstream for Ansible Tower, which is now part of Red Hat’s Ansible Automation Platform. It features a modern GUI and API, supporting Ansible functionalities like Playbooks, Inventories, Vault, and Credentials.

Previously, AWX supported deployments via Docker Host for production as seen in version 17.1.0:

AWX Docker Deployment Guide

From version 18.0.0, deployment is supported exclusively through the AWX Operator, suitable for Kubernetes and OpenShift environments.

What is the AWX Operator?

The AWX Operator simplifies deploying and managing AWX on Kubernetes, covering lifecycle management and declarative configurations.

How to Install the AWX Operator

Let’s install the AWX Operator using Helm, a package manager for Kubernetes.

Prerequisites

  • A Kubernetes cluster; we’ll use GKE provided by GCP’s Free Trial.
  • kubectl configured to connect to your GKE cluster.
  • Helm installed on your local machine.

Install AWX Operator

Start by adding the Helm repository for the AWX Operator:

Bash
helm repo add awx-operator https://ansible.github.io/awx-operator/

Update the repository and install the operator:

Bash
helm repo update
helm install my-awx-operator awx-operator/awx-operator -n awx --create-namespace --version 2.11.0

Check the installation with:

Bash
kubectl get pods -n awx

Deploy AWX

After installing the operator, deploy AWX using the Custom Resource Definition (CRD) by creating awx-deployment.yaml:

YAML
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
name: awx-deploy
spec:
service_type: nodeport
ingress_type: ingress

Apply the configuration:

Bash
kubectl apply -f ./awx-deployment.yaml -n awx

Monitor the deployment:

Bash
kubectl get pods -n awx -w

Expose the Service

Expose AWX using:

Bash
kubectl expose deployment awx-deploy --name awx-web-lb --type LoadBalancer -n awx

Check the exposed resources:

Get Admin Password

Retrieve the admin password using PowerShell:

PowerShell
$base64EncodedPassword = kubectl get secret awx-deploy-admin-password -o jsonpath="{.data.password}" -n awx
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($base64EncodedPassword))

Log in to the AWX platform using the retrieved credentials.

Congratulations, AWX is now running on GKE!

Check the installed version of AWX:

Stay tuned for more updates and tutorials!

Mateo Di Loreto

Thanks for reading. The learning continues in the next article.