Installation AWX using awx-operator 0.9.0 on Kubernetes cluster

3,066 views
Skip to first unread message

Kana Yabuno

unread,
Jun 3, 2021, 9:36:05 PM6/3/21
to AWX Project
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
---
kind: AWX
metadata:
  name: awx-demo
spec:
  tower_ingress_type: NodePort
  tower_postgres_storage_class: manual


persistentvolume.yaml
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: k8sdata
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual 
  mountOptions:
    - hard
    - nfsvers=4.2
  nfs:
    path: /var/lib/postgresql
    server: XXXXXXXX
...



logs.txt

Dennis McCarthy

unread,
Jun 7, 2021, 8:13:55 AM6/7/21
to AWX Project
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.

Kana Yabuno

unread,
Jun 17, 2021, 2:20:08 PM6/17/21
to AWX Project
Thank you, the video helped a lot!

Sam

unread,
Jun 23, 2021, 7:23:23 AM6/23/21
to AWX Project
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:           <none>
                app.kubernetes.io/name=postgres
                app.kubernetes.io/part-of=awx-demo
                controller-revision-hash=awx-demo-postgres-79f76985cb
Annotations:    <none>
Status:         Pending
IP:             
IPs:            <none>
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:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
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.

Lucas

unread,
Jun 23, 2021, 11:02:57 AM6/23/21
to AWX Project

Sam

unread,
Jun 23, 2021, 11:37:41 AM6/23/21
to AWX Project
Thanks ... I tried to follow the link but it is bit complicated for me :-( 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.

Wei-Yen Tan

unread,
Jun 23, 2021, 12:03:55 PM6/23/21
to Sam, AWX Project
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. 


This is a kubernetes requirement not a awx one 

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/5a903932-f49c-45ce-a099-87830f0299dcn%40googlegroups.com.

Sam

unread,
Jun 25, 2021, 7:31:33 AM6/25/21
to AWX Project
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 ?

Sinan Polat

unread,
Jun 29, 2021, 6:35:46 AM6/29/21
to AWX Project
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"
Op vrijdag 25 juni 2021 om 13:31:33 UTC+2 schreef Sam:

Sam

unread,
Jul 1, 2021, 4:44:13 PM7/1/21
to AWX Project
Thanks a lot ... it helped :-)
Reply all
Reply to author
Forward
0 new messages