mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 00:07:55 +00:00
runtime-rs: add examples about Kata pod with directvol by CSI.
Fixes: #8602 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
15
src/tools/csi-kata-directvolume/examples/pod-apply.sh
Executable file
15
src/tools/csi-kata-directvolume/examples/pod-apply.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 Ant Group
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
BASE_DIR=$(dirname "$0")/pod-with-directvol
|
||||||
|
|
||||||
|
kubectl apply -f ${BASE_DIR}/csi-storageclass.yaml
|
||||||
|
kubectl apply -f ${BASE_DIR}/csi-pvc.yaml
|
||||||
|
kubectl apply -f ${BASE_DIR}/csi-app.yaml
|
15
src/tools/csi-kata-directvolume/examples/pod-delete.sh
Executable file
15
src/tools/csi-kata-directvolume/examples/pod-delete.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 Ant Group
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
BASE_DIR=$(dirname "$0")/pod-with-directvol
|
||||||
|
|
||||||
|
kubectl delete -f ${BASE_DIR}/csi-app.yaml
|
||||||
|
kubectl delete -f ${BASE_DIR}/csi-pvc.yaml
|
||||||
|
kubectl delete -f ${BASE_DIR}/csi-storageclass.yaml
|
@@ -0,0 +1,18 @@
|
|||||||
|
kind: Pod
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: kata-driectvol-01
|
||||||
|
spec:
|
||||||
|
runtimeClassName: kata
|
||||||
|
containers:
|
||||||
|
- name: first-container
|
||||||
|
image: ubuntu:22.04
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/data"
|
||||||
|
name: kata-driectvol0-volume
|
||||||
|
command: [ "sleep", "1000000" ]
|
||||||
|
volumes:
|
||||||
|
- name: kata-driectvol0-volume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: csi-directvolume-pvc # defined in csi-pvc.yaml
|
||||||
|
|
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: csi-directvolume-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: csi-kata-directvolume-sc # defined in csi-storageclass.yaml
|
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: csi-kata-directvolume-sc
|
||||||
|
parameters:
|
||||||
|
katacontainers.direct.volume/volumetype: directvol
|
||||||
|
katacontainers.direct.volume/fstype: ext4
|
||||||
|
provisioner: directvolume.csi.katacontainers.io
|
||||||
|
reclaimPolicy: Delete
|
||||||
|
volumeBindingMode: Immediate
|
||||||
|
allowVolumeExpansion: false
|
||||||
|
|
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: node.k8s.io/v1
|
||||||
|
kind: RuntimeClass
|
||||||
|
metadata:
|
||||||
|
name: kata
|
||||||
|
handler: kata
|
Reference in New Issue
Block a user