AWX on Single Node K3s

Marouane Louguid
2 min read1 day ago

Requirements

  • Computing resources
  • 2 CPUs and 4 GiB RAM minimum.

Set up a K3s Kubernetes Cluster on Ubuntu/Debian

Install the K3s using the following command.

curl -sfL https://get.k3s.io | sh -

Verify if it is running or not

systemctl status k3s

see all Kubernetes objects deployed in the cluster in the kube-system namespace. kubectl is installed automatically during the K3s installation

sudo kubectl get all -n kube-system

Install AWX Operator

cd ~
git clone https://github.com/kurokobo/awx-on-k3s.git
cd awx-on-k3s
git checkout 2.19.1

Then invoke kubectl apply -k operator to deploy AWX Operator.

kubectl apply -k operator

The AWX Operator will be deployed to the namespace awx.

kubectl -n awx get all
NAME                                                   READY   STATUS    RESTARTS   AGE
pod/awx-operator-controller-manager-687b856498-kckzt 2/2 Running 0 16s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/awx-operator-controller-manager-metrics-service ClusterIP 10.43.150.245 <none> 8443/TCP 16s

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/awx-operator-controller-manager 1/1 1 1 16s

NAME DESIRED CURRENT READY AGE
replicaset.apps/awx-operator-controller-manager-68d787cfbd 1 1 1 16s

Prepare required files to deploy AWX

Generate a Self-Signed certificate.

AWX_HOST="awx.local.com"
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out ./base/tls.crt -keyout ./base/tls.key -subj "/CN=${AWX_HOST}/O=${AWX_HOST}" -addext "subjectAltName = DNS:${AWX_HOST}"

Modify hostname in base/awx.yaml.

...
spec:
...
ingress_type: ingress
ingress_hosts:
- hostname: awx.local.com πŸ‘ˆπŸ‘ˆπŸ‘ˆ
tls_secret: awx-secret-tls
...

Modify the two password entries in base/kustomization.yaml.

...
- name: awx-postgres-configuration
type: Opaque
literals:
- host=awx-postgres-15
- port=5432
- database=awx
- username=awx
- password=halamadrid
- type=managed

- name: awx-admin-password
type: Opaque
literals:
- password=dimakokab # password awx platform
...

Prepare directories for Persistent Volumes defined in base/pv.yaml.

sudo mkdir -p /data/postgres-15
sudo mkdir -p /data/projects
sudo chown 1000:0 /data/projects

Deploy AWX

Deploy AWX, this takes few minutes to complete.

kubectl apply -k base

To monitor the progress of the deployment, check the logs of deployments/awx-operator-controller-manager:

kubectl -n awx logs -f deployments/awx-operator-controller-manager
# display namespace awx
kubectl -n awx get awx,all,ingress,secrets

Now your AWX is available at https://awx.local.com/ or the hostname you specified 🎊

have a good deploy πŸš€

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Marouane Louguid
Marouane Louguid

Written by Marouane Louguid

SysOps Senior | DevOps & Cloud | Cyber security

No responses yet

What are your thoughts?