Difference between revisions of "VolumeMounts:"

From wikieduonline
Jump to navigation Jump to search
Line 34: Line 34:
 
== Related ==
 
== Related ==
 
* <code>[[Kubernetes volumes|volumes:]]</code>
 
* <code>[[Kubernetes volumes|volumes:]]</code>
 +
* <code>[[spec.volumes]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 10:03, 8 February 2024

apiVersion: v1 
kind: Pod
metadata:
  name: test-ebs
spec:
  containers:
  - image: registry.k8s.io/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-ebs
      name: test-volume
  volumes:
  - name: test-volume
    # This AWS EBS volume must already exist.
    awsElasticBlockStore:
      volumeID: "<volume id>"
      fsType: ext4


   volumeMounts:
   - mountPath: /data
     name: persistent-storage
   - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
     name: kube-api-access-jhnds
     readOnly: true


 apiVersion: v1
kind: Pod
metadata:
  name: myalpinewithvolume
spec:
  containers:
  - name: alpine
    image: alpine:latest
    command: ['ash']
    tty: true
    stdin: true
    volumeMounts:
    - name: myvolume
      mountPath: /myvolume
  volumes:
  - name: myvolume
    persistentVolumeClaim:
      claimName: myPVCtoMount

Related

See also

Advertising: