Skip to content

Instantly share code, notes, and snippets.

@mbaykara
Created March 4, 2021 17:13
Show Gist options
  • Save mbaykara/2715da024bab997f69c079c795670398 to your computer and use it in GitHub Desktop.
Save mbaykara/2715da024bab997f69c079c795670398 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolume
metadata:
name: azurefile-pv
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
azureFile:
secretName: demo-secret
shareName: aksshare
readOnly: false
mountOptions:
- dir_mode=0760
- file_mode=0760
- uid=1000
- gid=1000
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: azurefile-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
kind: Pod
apiVersion: v1
metadata:
name: azurefile-pod
spec:
containers:
- name: demo-pvc-pod
image: ubuntu
command: ["sleep", "3600"]
volumeMounts:
- name: azure
mountPath: /mnt/azure
imagePullPolicy: IfNotPresent
initContainers:
- name: init-con
image: alpine
command: [/bin/sh, -c,'mkdir -p /mnt/azure/foo && date > /mnt/azure/foo/file.txt']
volumeMounts:
- name: azure
mountPath: /mnt/azure
imagePullPolicy: IfNotPresent
volumes:
- name: azure
persistentVolumeClaim:
claimName: azurefile-pvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment