# Installation AWX using awx-operator 0.9.0 on Kubernetes cluster

**URL:** <https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280>\
**Category:** AWX Project\
**Tags:** kubernetes, awx\
**Created:** [June 4, 2021, 1:36am UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280 "2021-06-04T01:36:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kana\_Yabuno](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@Kana\_Yabuno](https://forum.ansible.com/u/Kana_Yabuno)\
**Post date:** [June 4, 2021, 1:36am UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/1 "2021-06-04T01:36:05Z")

</div>

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](https://forum.ansible.com/uploads/short-url/gcyvPHHZCVb55EDjQGSHOCHaZcu.txt) (4.8 KB)

---

<div class="post-metadata">

**Author:** ![Dennis\_McCarthy1](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Dennis\_McCarthy1](https://forum.ansible.com/u/Dennis_McCarthy1)\
**Post date:** [June 7, 2021, 12:13pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/2 "2021-06-07T12:13:55Z")

</div>

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](https://youtu.be/AYfqkTbCDAw)

---

<div class="post-metadata">

**Author:** ![Kana\_Yabuno](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@Kana\_Yabuno](https://forum.ansible.com/u/Kana_Yabuno)\
**Post date:** [June 17, 2021, 6:20pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/3 "2021-06-17T18:20:08Z")

</div>

Thank you, the video helped a lot!

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [June 23, 2021, 11:23am UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/4 "2021-06-23T11:23:23Z")

</div>

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](http://app.kubernetes.io/component=database)  
[app.kubernetes.io/instance=postgres-awx-demo](http://app.kubernetes.io/instance=postgres-awx-demo)  
[app.kubernetes.io/managed-by=awx-operator](http://app.kubernetes.io/managed-by=awx-operator)  
[app.kubernetes.io/name=postgres](http://app.kubernetes.io/name=postgres)  
[app.kubernetes.io/part-of=awx-demo](http://app.kubernetes.io/part-of=awx-demo)  
controller-revision-hash=awx-demo-postgres-79f76985cb  
[statefulset.kubernetes.io/pod-name=awx-demo-postgres-0](http://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](http://node.kubernetes.io/not-ready:NoExecute) op=Exists for 300s  
[node.kubernetes.io/unreachable:NoExecute](http://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.

---

<div class="post-metadata">

**Author:** ![Lucas](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@Lucas](https://forum.ansible.com/u/Lucas)\
**Post date:** [June 23, 2021, 3:02pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/5 "2021-06-23T15:02:57Z")

</div>

Create a PersistentVolumeClaim.

[https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/)

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [June 23, 2021, 3:37pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/6 "2021-06-23T15:37:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 23, 2021, 4:03pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/7 "2021-06-23T16:03:40Z")

</div>

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](https://youtu.be/0swOh5C3OVM)

This is a kubernetes requirement not a awx one

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [June 25, 2021, 11:31am UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/8 "2021-06-25T11:31:33Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Sinan\_Polat](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Sinan\_Polat](https://forum.ansible.com/u/Sinan_Polat)\
**Post date:** [June 29, 2021, 10:35am UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/9 "2021-06-29T10:35:46Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [July 1, 2021, 8:44pm UTC](https://forum.ansible.com/t/installation-awx-using-awx-operator-0-9-0-on-kubernetes-cluster/35280/10 "2021-07-01T20:44:13Z")

</div>

Thanks a lot … it helped 🙂
