epi82
(Elia)
December 6, 2022, 10:22am
1
Hello,
I’m trying to modify an istance group with a customize pod specification.
I have this with a volume mount to an azure file share.
apiVersion: v1
kind: Pod
metadata:
namespace: awx
spec:
serviceAccountName: default
automountServiceAccountToken: false
containers:
- image: xxx/awx:awx-custom-22
name: worker
args:
- ansible-runner
- worker
- ‘–private-data-dir=/runner’
volumeMounts:
- name: varlog
mountPath: /var/awx-log
resources:
requests:
cpu: 250m
memory: 100Mi
volumes:
- name: varlog
azureFile:
secretName: awx-share-secret
shareName: awx-logs
readOnly: false
If I try to add an addictional volume mounts like this:
volumeMounts:
- name: varlog
mountPath: /var/awx-log
- name: vartest
mountPath: /var/test
the automation pod starts without volumes attached.
There is a limit to number of volumes? I can add only one? Where I’m wrong?
Thank you,
Elia
the volumeMount “-name references” the volume name. Therefore the 2nd entry should also be -name: varlog
does that work?
epi82
(Elia)
December 13, 2022, 10:45am
3
That is only an example to understand if there are known problems with more volumes specified in pod yaml.
This is my completed pod specification:
apiVersion: v1
kind: Pod
metadata:
namespace: awx
spec:
serviceAccountName: default
automountServiceAccountToken: false
containers:
- image: xxx/awx:awx-custom-22
name: worker
args:
- ansible-runner
- worker
- ‘–private-data-dir=/runner’
volumeMounts:
- name: varlog
mountPath: /var/awx-log
- name: awx-runner-entrypoint-volume
mountPath: /usr/bin/entrypoint
subPath: entrypoint
resources:
requests:
cpu: 250m
memory: 100Mi
volumes:
- name: varlog
azureFile:
secretName: awx-share-secret
shareName: awx-logs
readOnly: false
- name: awx-runner-entrypoint-volume
configMap:
name: awx-runner-entrypoint
items:
- key: entrypoint
path: entrypoint
mode: 0775
if I set a pod specification with only one volume (“varlog” or “awx-runner-entrypoint-volume” both works) I have not any problem.
If I try with both defined the pod starts without volumes attached. Where I am wrong? It’s possible to define a pod specification with more volumes?
Thank you very much for your help.
Elia
epi82
(Elia)
December 16, 2022, 10:26am
4
That’s my fault. It was a banal indentation error
Sorry. Now it’s working mounting both vloumes that I need.
Thank you,
Elia