# Problem mapping extra volume to AWX

**URL:** <https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249>\
**Category:** Get Help\
**Tags:** kubernetes, documentation, awx\
**Created:** [July 12, 2024, 4:46pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249 "2024-07-12T16:46:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dexrva](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Dexrva](https://forum.ansible.com/u/Dexrva)\
**Post date:** [July 12, 2024, 4:46pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/1 "2024-07-12T16:46:55Z")

</div>

I tried to mount a volume from my K3s host to AWX using the guide from awx but I get the error:

strict decoding error: unknown field “spec.init\_container\_extra\_volume\_mounts[0].mount”, unknown field “spec.init\_container\_extra\_volume\_mounts[0].name”

My awx.yaml file is the next:

```auto
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  # These parameters are designed for use with:
  # - AWX Operator: 2.17.0
  # https://github.com/ansible/awx-operator/blob/2.17.0/README.md

  admin_user: admin
  admin_password_secret: awx-admin-password

  ingress_type: ingress
  ingress_hosts:
    - hostname: ###########
      tls_secret: awx-secret-tls

  postgres_configuration_secret: awx-postgres-configuration

  postgres_data_volume_init: true
  postgres_storage_class: awx-postgres-volume
  postgres_storage_requirements:
    requests:
      storage: 8Gi

  projects_persistence: true
  projects_existing_claim: awx-projects-claim

  web_replicas: 1
  task_replicas: 1

  web_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 2000m
      memory: 6Gi
  task_resource_requirements:
    requests:
      cpu: 100m
      memory: 128Mi
      ephemeral-storage: 500M
    limits:
      cpu: 4000m
      memory: 8Gi
      ephemeral-storage: 4Gi
  extra_volumes: |
    - name: awx-data-volume
      persistentVolumeClaim:
        claimName: awx-data-claim
  init_container_extra_volume_mounts:
    - name: awx-data-volume
      mount: /data_awx
  init_container_extra_commands: |
    chmod 775 /data_awx
    chgrp 1000 /data_awx
  ee_resource_requirements: {}
  init_container_resource_requirements: {}
  postgres_resource_requirements: {}
  redis_resource_requirements: {}
  rsyslog_resource_requirements: {}

  # Uncomment to reveal "censored" logs
  #no_log: false

```

My pv.yaml is the next:

```auto
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: awx-postgres-15-volume
spec:
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  capacity:
    storage: 8Gi
  storageClassName: awx-postgres-volume
  hostPath:
    path: /data_awx/postgres

---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: awx-projects-volume
spec:
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  capacity:
    storage: 2Gi
  storageClassName: awx-projects-volume
  hostPath:
    path: /data_awx/project

---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: awx-data-volume
spec:
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  capacity:
    storage: 20Gi
  storageClassName: awx-data-volume
  hostPath:
    path: /data_awx/data

```

And my pvc.yaml is:

```auto
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: awx-projects-claim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 2Gi
  storageClassName: awx-projects-volume

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: awx-data-claim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 20Gi
  storageClassName: awx-data-volume

```

Please your help. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 12, 2024, 4:56pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/2 "2024-07-12T16:56:16Z")

</div>

I think you gave it a list when it expects a multi-line string like the other values.

> [@Dexrva](#):
>
> ```diff
> - init_container_extra_volume_mounts:
> + init_container_extra_volume_mounts: |
> - name: awx-data-volume
> mount: /data_awx
> 
> ```

[https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/custom-volume-and-volume-mount-options.html](https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/custom-volume-and-volume-mount-options.html)

---

<div class="post-metadata">

**Author:** ![Dexrva](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Dexrva](https://forum.ansible.com/u/Dexrva)\
**Post date:** [July 12, 2024, 5:06pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/3 "2024-07-12T17:06:40Z")

</div>

Thanks Denny, with that the error no longer appears but when I login inside the pod the path does not appear.

```auto
bash-5.1$ pwd
/
bash-5.1$ df -h
Filesystem Size Used Avail Use% Mounted on
overlay 54G 27G 25G 52% /
tmpfs 64M 0 64M 0% /dev
/dev/mapper/ubuntu--vg-lv--var 12G 1.1G 11G 10% /etc/hosts
shm 64M 144K 64M 1% /dev/shm
/dev/mapper/app_vg-lv_rancher 54G 27G 25G 52% /etc/hostname
tmpfs 16G 8.0K 16G 1% /etc/receptor/work_private_key.pem
tmpfs 16G 4.0K 16G 1% /etc/tower/SECRET_KEY
/dev/mapper/app_vg-awx_lv_proj 3.0G 225M 2.8G 8% /var/lib/awx/projects
tmpfs 16G 12K 16G 1% /etc/tower/conf.d/ldap.py
tmpfs 16G 12K 16G 1% /run/secrets/kubernetes.io/serviceaccount
tmpfs 7.9G 0 7.9G 0% /proc/acpi
tmpfs 7.9G 0 7.9G 0% /proc/scsi
tmpfs 7.9G 0 7.9G 0% /sys/firmware
bash-5.1$ cd /data_awx
bash: cd: /data_awx: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 12, 2024, 5:17pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/4 "2024-07-12T17:17:46Z")

</div>

You have configured the volume, mounted it to the init container and processed the permissions with the init commands. You have _not_ mounted the volume anywhere else.

Please see the following table excerpt from the link above to determine where all you want the volume to be mounted:

| Name | Description | Default |
| --- | --- | --- |
| extra\_volumes | Specify extra volumes to add to the application pod | ‘’ |
| web\_extra\_volume\_mounts | Specify volume mounts to be added to Web container | ‘’ |
| task\_extra\_volume\_mounts | Specify volume mounts to be added to Task container | ‘’ |
| rsyslog\_extra\_volume\_mounts | Specify volume mounts to be added to Rsyslog container | ‘’ |
| ee\_extra\_volume\_mounts | Specify volume mounts to be added to Execution container | ‘’ |
| init\_container\_extra\_volume\_mounts | Specify volume mounts to be added to Init container | ‘’ |
| init\_container\_extra\_commands | Specify additional commands for Init container | ‘’ |

---

<div class="post-metadata">

**Author:** ![Dexrva](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Dexrva](https://forum.ansible.com/u/Dexrva)\
**Post date:** [July 12, 2024, 5:45pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/5 "2024-07-12T17:45:37Z")

</div>

> [@Denney-tech](#):
>
> task\_extra\_volume\_mounts

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [August 11, 2024, 5:45pm UTC](https://forum.ansible.com/t/problem-mapping-extra-volume-to-awx/7249/6 "2024-08-11T17:45:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
