Last active
November 10, 2022 06:00
-
-
Save jenting/e8dd528672e1d88f710f289b288acc81 to your computer and use it in GitHub Desktop.
Pod block device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: block-dev | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
volumeMode: Block | |
storageClassName: rook-ceph-block | |
resources: | |
requests: | |
storage: 3Gi | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: workspace | |
namespace: default | |
spec: | |
containers: | |
- name: workspace | |
image: ubuntu:22.04 | |
imagePullPolicy: IfNotPresent | |
command: ["/usr/bin/sleep", "7200"] | |
volumeDevices: | |
- name: workspace | |
devicePath: /dev/workspace | |
securityContext: | |
privileged: true | |
volumes: | |
- name: workspace | |
persistentVolumeClaim: | |
claimName: block-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: block-dev | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
volumeMode: Block | |
storageClassName: rook-ceph-block | |
resources: | |
requests: | |
storage: 3Gi | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: workspace | |
namespace: default | |
spec: | |
initContainers: | |
- name: mkfs-mount | |
image: ubuntu:22.04 | |
command: ["/bin/bash","-c","/usr/sbin/mkfs.ext4 -m1 /dev/workspace && mount -t ext4 -o user_xattr /dev/workspace /workspace"] | |
securityContext: | |
privileged: true | |
volumeDevices: | |
- name: dev-workspace | |
devicePath: /dev/workspace | |
volumeMounts: | |
- name: dir-workspace | |
mountPath: /workspace | |
containers: | |
- name: workspace | |
image: ubuntu:22.04 | |
imagePullPolicy: IfNotPresent | |
command: ["/usr/bin/sleep", "3600"] | |
volumeMounts: | |
- name: dir-workspace | |
mountPath: /workspace | |
volumes: | |
- name: dev-workspace | |
persistentVolumeClaim: | |
claimName: block-dev | |
- name: dir-workspace | |
emptyDir: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment