DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Persistent Volumes

azure-disk

List storage classes available.
1
kubectl get sc
Copied!
Create a Persistent Volume Claim.
1
apiVersion: v1
2
kind: PersistentVolumeClaim
3
metadata:
4
name: azure-managed-disk
5
spec:
6
accessModes:
7
- ReadWriteOnce
8
storageClassName: managed-premium
9
resources:
10
requests:
11
storage: 5Gi
Copied!
Use it.
1
kind: Pod
2
apiVersion: v1
3
metadata:
4
name: mypod
5
spec:
6
containers:
7
- name: mypod
8
image: nginx:1.15.5
9
resources:
10
requests:
11
cpu: 100m
12
memory: 128Mi
13
limits:
14
cpu: 250m
15
memory: 256Mi
16
volumeMounts:
17
- mountPath: "/mnt/azure"
18
name: volume
19
volumes:
20
- name: volume
21
persistentVolumeClaim:
22
claimName: azure-managed-disk
Copied!

References

azure-file

Create a StorageClass.
1
kind: StorageClass
2
apiVersion: storage.k8s.io/v1
3
metadata:
4
name: azurefile
5
provisioner: kubernetes.io/azure-file
6
mountOptions:
7
- dir_mode=0777
8
- file_mode=0777
9
- uid=1000
10
- gid=1000
11
- mfsymlinks
12
- nobrl
13
- cache=none
14
parameters:
15
skuName: Standard_LRS
Copied!
Create a PVC.
1
apiVersion: v1
2
kind: PersistentVolumeClaim
3
metadata:
4
name: pvc-my-disk
5
namespace: my-namespace
6
spec:
7
accessModes:
8
- ReadWriteMany
9
volumeMode: Filesystem
10
resources:
11
requests:
12
storage: 30Gi
13
storageClassName: azurefile
Copied!

References