Skip to content

Commit e0c9f43

Browse files
committed
CSI Inline Volumes: secret store csi driver example
1 parent f89fffd commit e0c9f43

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

content/en/blog/_posts/2022-08-29-csi-inline-volumes-ga.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,18 @@ A CSI driver is not suitable for inline use when:
2929

3030
## How to use this feature
3131

32-
In order to use this feature, the `CSIDriver` spec must explicitly list `Ephemeral` as one of the supported `volumeLifecycleModes`. Here is a simple example from the [CSI host-path driver](https://github.com/kubernetes-csi/csi-driver-host-path).
32+
In order to use this feature, the `CSIDriver` spec must explicitly list `Ephemeral` as one of the supported `volumeLifecycleModes`. Here is a simple example from the [Secrets Store CSI Driver](https://github.com/kubernetes-sigs/secrets-store-csi-driver).
3333

3434
```
3535
apiVersion: storage.k8s.io/v1
3636
kind: CSIDriver
3737
metadata:
38-
name: hostpath.csi.k8s.io
38+
name: secrets-store.csi.k8s.io
3939
spec:
40+
podInfoOnMount: true
41+
attachRequired: false
4042
volumeLifecycleModes:
41-
- Persistent
4243
- Ephemeral
43-
podInfoOnMount: true
44-
fsGroupPolicy: File
4544
```
4645

4746
Any pod spec may then reference that CSI driver to create an inline volume, as in this example.
@@ -52,24 +51,21 @@ apiVersion: v1
5251
metadata:
5352
name: my-csi-app-inline
5453
spec:
55-
affinity:
56-
nodeAffinity:
57-
requiredDuringSchedulingIgnoredDuringExecution:
58-
nodeSelectorTerms:
59-
- matchExpressions:
60-
- key: topology.hostpath.csi/node
61-
operator: Exists
6254
containers:
6355
- name: my-frontend
6456
image: busybox
6557
volumeMounts:
66-
- mountPath: "/data"
67-
name: my-csi-volume
58+
- name: secrets-store-inline
59+
mountPath: "/mnt/secrets-store"
60+
readOnly: true
6861
command: [ "sleep", "1000000" ]
6962
volumes:
70-
- name: my-csi-volume
63+
- name: secrets-store-inline
7164
csi:
72-
driver: hostpath.csi.k8s.io
65+
driver: secrets-store.csi.k8s.io
66+
readOnly: true
67+
volumeAttributes:
68+
secretProviderClass: "my-provider"
7369
```
7470

7571
If the driver supports any volume attributes, you can provide these as part of the `spec` for the Pod as well:

0 commit comments

Comments
 (0)