Difference between revisions of "VolumeMounts:"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:
 
  {{alpine cp example}}
 
  {{alpine cp example}}
  
{{Alpine cp example}}
+
 
  
 
== Related ==
 
== Related ==
Line 39: Line 39:
 
* <code>[[spec.volumes]]</code>
 
* <code>[[spec.volumes]]</code>
 
* [[Access a volume with a temporary pod]]
 
* [[Access a volume with a temporary pod]]
 +
* [[Distribute Credentials Securely Using Secrets]]
  
 
== See also ==
 
== See also ==

Latest revision as of 11:03, 15 October 2024

.spec.containers[*].volumeMounts
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[edit]

See also[edit]

Advertising: