Can you mount a non persistent volume to AKS cluster?

RNC 21 Reputation points
2022-08-23T00:40:01.253+00:00

Hello,

I would like to know if we can mount a non persistent volume to the AKS cluster, if yes, can someone explain how with examples?

TIA,

RNC

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,841 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 16,956 Reputation points MVP
    2022-08-23T04:25:24.33+00:00

    An emptyDir volume is first created when a Pod is assigned to a node, and exists as long as that Pod is running on that node. All containers in the Pod can read and write the same files in the emptyDir volume, though that volume can be mounted at the same or different paths in each container. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted permanently.
    Following is the example. In this exercise, you create a Pod that runs one Container. This Pod has a Volume of type emptyDir that lasts for the life of the Pod, even if the Container terminates and restarts. Here is the configuration file for the Pod:

    apiVersion: v1  
    kind: Pod  
    metadata:  
      name: redis  
    spec:  
      containers:  
      - name: redis  
        image: redis  
        volumeMounts:  
        - name: redis-storage  
          mountPath: /data/redis  
      volumes:  
      - name: redis-storage  
        emptyDir: {}  
    

    I tested the code and works well !

    ----------

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful