Installation AWX using awx-operator 0.9.0 on Kubernetes cluster

Hi all,

I’m new to both AWX and Kubernetes and I was trying to install AWX on a Kubernetes cluster(one master and one worker nodes) using the installation guide on AWX github page.

I created persistentvolume before deploying awx-operator and the awx instance.
After pods start running, Postgres pod fails with this error message “CreateContainerConfigError”.

Kubernetes describe commands gives "failed to create subPath directory for volumeMount “postgres” of container “postgres”

I am not sure if this is related to permission issues or something else.
Any help would be appreciated! Thank you.

awx-demo.yml

(attachments)

logs.txt (4.8 KB)

I’ve seen a lot of people having issues installing the awx-operator so I’ve created this youtube video with all the commands in the description to help out anyone having a problem.

This demo covers the following on a ubuntu 20 server in EC2:

• Install and set up kubectl and docker.
• Installing and setting up Minikube in EC2 [t3a.xlarge – 4 x cpu / 16gb memory]
o ami-0194c3e07668a7e36 (eu-west-2)
o You might be able to get away with less resources
• Setup the AWX-operator (latest version – 19.2) and deploy.
• Get the AWX admin password.
• Forward the port so we can access it from the internet and use Minikube tunnel.
• Login to AWX and take a quick tour.
• All commands have been added into the description.

It will get you started.

https://youtu.be/AYfqkTbCDAw

Thank you, the video helped a lot!

Thanks … it is helpful

I tried to follow the same but postgres POD is having an issue, any idea please ?

kubectl get pods

NAME READY STATUS RESTARTS AGE
awx-demo-7744b86597-tcgjn 4/4 Running 0 45h
awx-demo-postgres-0 0/1 Pending 0 24h
awx-operator-75c79f5489-wxn5l 1/1 Running 1 8d

kubectl describe pod awx-demo-postgres-0

Name: awx-demo-postgres-0
Namespace: default
Priority: 0
Node:
Labels: app.kubernetes.io/component=database
app.kubernetes.io/instance=postgres-awx-demo
app.kubernetes.io/managed-by=awx-operator
app.kubernetes.io/name=postgres
app.kubernetes.io/part-of=awx-demo
controller-revision-hash=awx-demo-postgres-79f76985cb
statefulset.kubernetes.io/pod-name=awx-demo-postgres-0
Annotations:
Status: Pending
IP:
IPs:
Controlled By: StatefulSet/awx-demo-postgres
Containers:
postgres:
Image: postgres:12
Port: 5432/TCP
Host Port: 0/TCP
Environment:
POSTGRESQL_DATABASE: <set to the key ‘database’ in secret ‘awx-demo-postgres-configuration’> Optional: false
POSTGRESQL_USER: <set to the key ‘username’ in secret ‘awx-demo-postgres-configuration’> Optional: false
POSTGRESQL_PASSWORD: <set to the key ‘password’ in secret ‘awx-demo-postgres-configuration’> Optional: false
POSTGRES_DB: <set to the key ‘database’ in secret ‘awx-demo-postgres-configuration’> Optional: false
POSTGRES_USER: <set to the key ‘username’ in secret ‘awx-demo-postgres-configuration’> Optional: false
POSTGRES_PASSWORD: <set to the key ‘password’ in secret ‘awx-demo-postgres-configuration’> Optional: false
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
Mounts:
/var/lib/postgresql/data from postgres (rw,path=“data”)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-stkg5 (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
postgres:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: postgres-awx-demo-postgres-0
ReadOnly: false
kube-api-access-stkg5:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional:
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message


Warning FailedScheduling 24h default-scheduler 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.

Create a PersistentVolumeClaim.

https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/

Thanks … I tried to follow the link but it is bit complicated for me :frowning: I am bit new to K8S domain.

I have 3 node and my understanding I can achieve this by creating NFS share shared among the three node, but I am not sure then how to proceed as the documentation assume single node cluster. I don’t too what is expected volume name by Postgres Pod it is not clear in AWX documentation.

You here to create a persistent volume to meet the requirement of the persistrnt volume claim by the postgres server which is 8gb iirc. If you are unsure on how to do create a persistent volume I suggest you go to some resources.

This one might help.

https://youtu.be/0swOh5C3OVM

This is a kubernetes requirement not a awx one

Thanks Weiye,

I went through the documentation and the video you shared: PVC will require PV, the best way to achieve this as per my understanding is to have a Storage Class in place, as Ansible operator doesn’t seem to have SC defined so we have to define Storage class, I could not find in AWX or Kubernetes documentation how can I use a shared NFS volume for a storage class that can be satisfy AWX requirements.

I thought of create a Persistent Volume manually that can be used by the Persistent Volume Claim, but I don’t know what the name has to be for it.

I have also tried to create Postgres DB on an external node and use for connection but it failed to as it seems AWX documentation is missing how to allow such a communication (I have already tried the Postgres parameters motioned in the documents).

Can any one help me out please ?

I haven’t deployed AWX on Kubernetes yet, so I don’t know what the requirements are, but creating a PV(C) is easy:

apiVersion: v1
kind: PersistentVolume
metadata:
name: YourPVname

labels:

app: volume-AWX

spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:

  • ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    nfs:
    path: /var/nfs/path/to/dir
    server: 172.17.0.2

and

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: yourPVname-myclaim
spec:
accessModes:

  • ReadWriteMany
    volumeMode: Filesystem
    volumeName: yourPVname
    resources:
    requests:
    storage: 5Gi
    selector:
    matchLabels:
    app: “volume-AWX”

Thanks a lot … it helped :slight_smile: