Lab 2 - AWX,AWX Operator Configurations & Deployments

Lab Objective

In this lab we will learns how to deploy & configure AWX as a containers to K8s cluster.

Deployment Steps

Step 1: Prepare YML files for configurations.

Basically, only three YML's file required to deploy the AWX onto our K8s cluster.

Note: The YML files

create kustomization.yml file with the following content:

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=1.1.1 #change to any preference version

# Set the image tags to match the git version from above
images:
  - name: quay.io/ansible/awx-operator
    newTag: 1.1.1 #change to any preference version

# Specify a custom namespace in which to install AWX
namespace: awx

as you can see the version of AWX Operator is defined on newTag key as well as on the resources key.

create awx-demo.yml file with the following content:

apiVersion: awx.ansible.com/v1beta1
kind: AWX
namespace: awx
metadata:
  name: awx-demo
spec:
  service_type: nodeport
  # default nodeport_port is 30080
  nodeport_port: 30000 #you may change this node port between 30000-32768

Here you will see minimal content definitions specified in the YML because AWX Operator has taken care the actual AWX deployment files.

Step 2: Deploy the AWX Operator controller manager.

Now, with all the k8s object config files in hand, we are going to execute it one by one,

Execute the build in kustomization.yml

$ kubectl apply -k .
Objects that has been created

Once executed, AWX operator will deploy the following objects on k8s.

Deployment object
Pod object
Replica Sets object
Services object
ConfigMap object

Ensure that all AWX controllers manager objects are up and running,

Step 3: Deploy the AWX.

Now, this is where we want to execute our AWX deployment.

Run$ kubectl apply -f awx-demo.yml

After the execution, we can see below additional objects has been created

awx-demo and awx-demo-postgres pods created

Notes, for the pods to get ready, it might take sometimes so we will just have to wait for a while.

awx-demo-postgres-13 stateful sets created
awx-demo-service & awx-demo-postgres-13 services has been added
awx-demo-awx-configmap created
the PVC for AWX

Finally, ensure that all the required secrets has also been created during the deployment.

All the secrets

Step 4: Verify all the k8s object resources & connectivity to the service

At this stage, we will need to verify below resources has been created inside the awx namespace.

Below screenshots is from my end for your references.

Step 5: Verify connectivity from the Service

Now we have everythings up and running, we need to do final check and it can be done by the AWX API check.

Run $ minikube service list

Exposed service in Minikube

Referring to above image, this is the URL that we will need to use to query the AWX Ping API's

AWX Service URL: http://192.168.39.154:30000

To query the API, we can run

$ curl -L -q http://192.168.39.154:30000/api/v2/ping 2>/dev/null

or

$ curl -L -q $(minikube service awx-demo-service --url -n awx)/api/v2/ping 2>/dev/null

We shall receives below response if everythings is good.

Response from the Ping API's

~End of Lab 2 - AWX,AWX Operator Configurations & Deployments~

Continue to Lab 3 - Ingress Networking & Connectivity via Nginx

Last updated