Difference between revisions of "VolumeMounts:"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
+ | * https://kubernetes.io/docs/concepts/storage/volumes/ | ||
− | * | + | [[.spec.containers]][*].[[volumeMounts]] |
apiVersion: v1 | apiVersion: v1 | ||
Line 8: | Line 9: | ||
name: test-ebs | name: test-ebs | ||
spec: | spec: | ||
− | containers: | + | [[containers:]] |
- image: registry.k8s.io/test-webserver | - image: registry.k8s.io/test-webserver | ||
name: test-container | name: test-container | ||
Line 14: | Line 15: | ||
- mountPath: /test-ebs | - mountPath: /test-ebs | ||
name: test-volume | name: test-volume | ||
− | volumes: | + | [[volumes:]] |
- name: test-volume | - name: test-volume | ||
# This AWS EBS volume must already exist. | # This AWS EBS volume must already exist. | ||
Line 20: | Line 21: | ||
volumeID: "<volume id>" | volumeID: "<volume id>" | ||
fsType: ext4 | fsType: ext4 | ||
+ | |||
+ | |||
+ | [[volumeMounts]]: | ||
+ | - mountPath: /data | ||
+ | name: persistent-storage | ||
+ | - [[mountPath]]: [[/var/run/secrets/]]kubernetes.io/serviceaccount | ||
+ | name: kube-api-access-jhnds | ||
+ | readOnly: true | ||
+ | |||
+ | |||
+ | {{alpine cp example}} | ||
+ | |||
== Related == | == Related == | ||
* <code>[[Kubernetes volumes|volumes:]]</code> | * <code>[[Kubernetes volumes|volumes:]]</code> | ||
+ | * <code>[[spec.volumes]]</code> | ||
+ | * [[Access a volume with a temporary pod]] | ||
+ | * [[Distribute Credentials Securely Using Secrets]] | ||
== See also == | == See also == | ||
+ | * {{containers:}} | ||
* {{K8s sto}} | * {{K8s sto}} | ||
[[Category:K8s]] | [[Category:K8s]] |
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]
volumes:
spec.volumes
- Access a volume with a temporary pod
- Distribute Credentials Securely Using Secrets
See also[edit]
containers:
:spec.containers, env:, volumeMounts:, image:, resources:
- Kubernetes storage, storage classes, PersistentVolume (PV), PVC, CSI,
kind: StorageClass, kind: PersistentVolumeClaim, kind: PersistentVolume
,kubectl [ get | describe | edit ] pvc
,volumeClaimTemplates:
,kubectl patch pv
,FailedMount
, Volume Expansion, Volume Cloning, snapshots, ExtraVolumes, NotTriggerScaleUp,volumePVCDataSource, AllowVolumeExpansion
, EKS storage, provisioner, Storage Capacity Tracking,VolumeBinding, VolumeClaimTemplate, storage.k8s.io
, CKA Storage, DoKC, EmptyDir, Volume populators,storageclass.kubernetes.io
Advertising: