Mrugesh Shah
Mrugesh Shah

Reputation: 31

Azure Kubernetes Persistant Volume Azure Disk

I am using Azure Kubernetes and I have created Persistent Volume, Claims and Storage Class.

I want to deploy pods on the Persistent Volume so we can increase the Volume anytime as per the requirement. Right now our Pods are deployed in the Virtual Machines OS Disk. Since we are using the default Pods deployment on the VM Disk when we run out of the disk space the whole cluster will be destroyed and created again.

Please let me know how can I configure Pods to deploy in Azure (Managed) Disk.

Thanks, Mrugesh

Upvotes: 1

Views: 422

Answers (1)

Jonas
Jonas

Reputation: 128797

You don't have to create a Persistent Volume manually, if you want Azure Disk, this can be created dynamically for you.

From Azure Built-in storage classes:

The default storage class provisions a standard SSD Azure disk. Standard storage is backed by Standard SSDs and delivers cost-effective storage while still delivering reliable performance.

You only have to create the PersistentVolumeClaim with the storage class you want to use, e.g.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azure-managed-disk
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: default
  resources:
    requests:
      storage: 5Gi

and then refer to that PVC in your Deployment or Pods.

Upvotes: 2

Related Questions