Skip to content

Commit

Permalink
Optimise the driver to localstorage.caoyingjunz.io (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
caoyingjunz authored May 23, 2023
1 parent 3d543ef commit fec3843
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This driver allows Kubernetes to access LocalStorage on Linux node.
## Getting Started

### Installation
- 安装 `csi-localstorage` 组件
- 安装 `localstorage` 组件
```shell
kubectl apply -f deploy/v1.0.0

Expand All @@ -25,9 +25,9 @@ This driver allows Kubernetes to access LocalStorage on Linux node.
kubectl apply -f deploy/storageclass.yaml
# 验证
kubectl get sc localstorage.caoyingjunz.io
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
localstorage.caoyingjunz.io localstorage.csi.caoyingjunz.io Delete WaitForFirstConsumer false 2m54s
kubectl get sc pixiu-localstorage
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
pixiu-localstorage localstorage.csi.caoyingjunz.io Delete WaitForFirstConsumer false 2m54s
```

- 创建 `pvc` 验证
Expand All @@ -37,7 +37,7 @@ This driver allows Kubernetes to access LocalStorage on Linux node.
# 验证
kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
test-pvc Bound pvc-2b2c809f-33b5-437f-a4b8-61906c10a3e1 1Mi RWX localstorage.caoyingjunz.io 5s
test-pvc Bound pvc-2b2c809f-33b5-437f-a4b8-61906c10a3e1 1Mi RWX pixiu-localstorage 5s
```

## Feature
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: localstorage.caoyingjunz.io
name: pixiu-localstorage
mountOptions:
- owner=caoyingjunz
parameters:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
metadata:
name: test-pvc
annotations:
volume.beta.kubernetes.io/storage-class: "localstorage.caoyingjunz.io"
volume.beta.kubernetes.io/storage-class: "pixiu-localstorage"
spec:
accessModes:
- ReadWriteMany
Expand Down
36 changes: 36 additions & 0 deletions examples/sts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test-sts
spec:
selector:
matchLabels:
app: test-sts
serviceName: test-sts
replicas: 1
template:
metadata:
labels:
app: test-sts
spec:
terminationGracePeriodSeconds: 10
containers:
- name: test-sts
imagePullPolicy: IfNotPresent
image: nginx
ports:
- containerPort: 80
name: web
volumeMounts:
- name: pixiu
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: pixiu
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "pixiu-localstorage"
resources:
requests:
storage: 1Gi

0 comments on commit fec3843

Please sign in to comment.