Difference between revisions of "Kubernetes Persistent Volumes (PV)"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
  
 
== Examples ==
 
== Examples ==
  Volumes:
+
  [[volumes:]]
 
   your-vol-1:
 
   your-vol-1:
 
     Type:      [[ConfigMap]] (a volume populated by a ConfigMap)
 
     Type:      [[ConfigMap]] (a volume populated by a ConfigMap)
 
     Name:      prod-admin-config
 
     Name:      prod-admin-config
 
     Optional:  false
 
     Optional:  false
 +
 
   your-vol-2:
 
   your-vol-2:
 
     Type:        [[Secret]] (a volume populated by a Secret)
 
     Type:        [[Secret]] (a volume populated by a Secret)
 
     [[SecretName]]:  your-secret-name
 
     [[SecretName]]:  your-secret-name
 
     Optional:    false
 
     Optional:    false
 +
 
   your-vol-3:
 
   your-vol-3:
 
     Type:                    [[Projected]] (a volume that contains injected data from multiple sources)
 
     Type:                    [[Projected]] (a volume that contains injected data from multiple sources)

Revision as of 14:37, 16 January 2023

Kubernetes Persistent Volumes subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed

Volumes:
VolumeMounts:
ExtraVolumes

Examples

volumes:
 your-vol-1:
   Type:      ConfigMap (a volume populated by a ConfigMap)
   Name:      prod-admin-config
   Optional:  false
 your-vol-2:
   Type:        Secret (a volume populated by a Secret)
   SecretName:  your-secret-name
   Optional:    false
 your-vol-3:
   Type:                    Projected (a volume that contains injected data from multiple sources)
   TokenExpirationSeconds:  3607
   ConfigMapName:          your-kube-root-ca.crt
   ConfigMapOptional:       <nil>
   DownwardAPI:             true
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: nginx
      volumeMounts:
      - mountPath: "/var/www/html"
        name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
        claimName: myclaim



spec:
  volumes:
    - name: elasticsearch-master
      persistentVolumeClaim:
        claimName: elasticsearch-master-elasticsearch-master-0
    - name: mynewvolumen
      emptyDir: {}

Providers

News

  • Jun 2018 v1.11 Resizing Persistent Volumes using Kubernetes in alpha

Related terms

See also

Advertising: