Skip to content

Commit

Permalink
Update value of resource name in examples (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaogaozi authored May 31, 2021
1 parent 95c32f8 commit decfc00
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions examples/static-provisioning-mount-options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Patch the persistent volume spec with `csi/volumeAttributes/mountOptions`.
apiVersion: v1
kind: PersistentVolume
metadata:
name: juicefs-aws-us-east-1
name: juicefs-pv
spec:
csi:
volumeAttributes:
Expand All @@ -42,7 +42,7 @@ kustomize build | kubectl apply -f -
After the configuration is applied, verify that pod is running:

```sh
kubectl get pods
kubectl get pods juicefs-app-mount-options
```

Also you can verify that mount options are customized in the mounted JuiceFS file system:
Expand Down
2 changes: 1 addition & 1 deletion examples/static-provisioning-mount-options/patches.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: juicefs-aws-us-east-1
name: juicefs-pv
spec:
csi:
volumeAttributes:
Expand Down
18 changes: 9 additions & 9 deletions examples/static-provisioning-permissions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ The `owner` container is run as user `1000` and group `3000`. Check the file it
umask is `0022`

```sh
>> kubectl exec -it app-perms-7c6c95b68-76g8g -c owner -- id
>> kubectl exec -it juicefs-app-perms-7c6c95b68-76g8g -c owner -- id
uid=1000 gid=3000 groups=3000
>> kubectl exec -it app-perms-7c6c95b68-76g8g -c owner -- umask
>> kubectl exec -it juicefs-app-perms-7c6c95b68-76g8g -c owner -- umask
0022
>> kubectl exec -it app-perms-7c6c95b68-76g8g -c owner -- ls -l /data
>> kubectl exec -it juicefs-app-perms-7c6c95b68-76g8g -c owner -- ls -l /data
total 707088
-rw-r--r-- 1 1000 3000 3780 Aug 9 11:23 out-app-perms-7c6c95b68-76g8g.txtkubectl get pods
-rw-r--r-- 1 1000 3000 3780 Aug 9 11:23 out-juicefs-app-perms-7c6c95b68-76g8g.txtkubectl get pods
```

The `group` container is run as user `2000` and group `3000`. Check the file is readable by other user in the group.

```sh
>> kubectl exec -it app-perms-7c6c95b68-76g8g -c group -- id
>> kubectl exec -it juicefs-app-perms-7c6c95b68-76g8g -c group -- id
uid=2000 gid=3000 groups=3000
>> kubectl logs app-perms-7c6c95b68-76g8g group
>> kubectl logs juicefs-app-perms-7c6c95b68-76g8g group
Fri Aug 9 10:08:32 UTC 2019
Fri Aug 9 10:08:37 UTC 2019
...
Expand All @@ -53,9 +53,9 @@ Fri Aug 9 10:08:37 UTC 2019
The `other` container is run as user `3000` and group `4000`. Check the file is not writable for users not in the group.

```sh
>> kubectl exec -it app-perms-7c6c95b68-76g8g -c other -- id
>> kubectl exec -it juicefs-app-perms-7c6c95b68-76g8g -c other -- id
uid=3000 gid=4000 groups=4000
>> kubectl logs app-perms-7c6c95b68-76g8g -c other
/bin/sh: /data/out-app-perms-7c6c95b68-76g8g.txt: Permission denied
>> kubectl logs juicefs-app-perms-7c6c95b68-76g8g -c other
/bin/sh: /data/out-juicefs-app-perms-7c6c95b68-76g8g.txt: Permission denied
...
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: default
nameSuffix: -perms
commonLabels:
app: perms
app: juicefs-perms
bases:
- ../static-provisioning
resources:
Expand Down
4 changes: 2 additions & 2 deletions examples/static-provisioning-permissions/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
name: juicefs-app
spec:
template:
spec:
Expand Down Expand Up @@ -67,4 +67,4 @@ spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: ten-pb-fs
claimName: juicefs-pvc
6 changes: 3 additions & 3 deletions examples/static-provisioning-rwx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ kubectl apply -k .
Scale up

```s
kubectl scale -n default deployment scaling-app-rwx --replicas=64
kubectl scale -n default deployment juicefs-app-rwx --replicas=64
```

Scale down

```s
kubectl scale -n default deployment scaling-app-rwx --replicas=1
kubectl scale -n default deployment juicefs-app-rwx --replicas=1
```

## Check JuiceFS file system is used

After the configuration is applied, verify that pod is running:

```sh
>> kubectl get pods
>> kubectl get pods -l app=juicefs-pv-rwx
```

Also you can verify that data is written onto JuiceFS file system:
Expand Down
2 changes: 1 addition & 1 deletion examples/static-provisioning-rwx/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization
namespace: default
nameSuffix: -rwx
commonLabels:
app: pv-rwx
app: juicefs-pv-rwx
bases:
- ../static-provisioning
resources:
Expand Down
4 changes: 2 additions & 2 deletions examples/static-provisioning-rwx/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: scaling-app
name: juicefs-app
spec:
template:
spec:
Expand Down Expand Up @@ -42,4 +42,4 @@ spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: ten-pb-fs
claimName: juicefs-pvc
8 changes: 4 additions & 4 deletions examples/static-provisioning-subpath/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Persisten volume can be provisioned as a subpath in juicefs file system.

Ensure you have already get familiar with [static-provisioning](../static-provisioning/README.md) example.

Patch the persistent volume spec with `csi/volumeAttributes/subPath`. The subPath must pre-exist.
Patch the persistent volume spec with `csi/volumeAttributes/subPath`. The `subPath` must pre-exist.

```yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: juicefs-aws-us-east-1
name: juicefs-pv
spec:
csi:
volumeAttributes:
Expand All @@ -38,11 +38,11 @@ kubectl apply -k .
After the objects are created, verify that pod is running:

```sh
>> kubectl get pods
>> kubectl get pods juicefs-app-subpath
```

Also you can verify that data is written onto JuiceFS file system:

```sh
>> kubectl exec -ti juicefs-app -- tail -f /data/out.txt
>> kubectl exec -ti juicefs-app-subpath -- tail -f /data/out.txt
```
2 changes: 1 addition & 1 deletion examples/static-provisioning-subpath/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
nameSuffix: -fluentd
nameSuffix: -subpath
bases:
- ../static-provisioning
patchesStrategicMerge:
Expand Down
2 changes: 1 addition & 1 deletion examples/static-provisioning-subpath/patches.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: juicefs-aws-us-east-1
name: juicefs-pv
spec:
csi:
volumeAttributes:
Expand Down
2 changes: 1 addition & 1 deletion examples/static-provisioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kubectl apply -k .
After the objects are created, verify that pod is running:

```sh
kubectl get pods
kubectl get pods juicefs-app
```

Also you can verify that data is written onto JuiceFS file system:
Expand Down
2 changes: 1 addition & 1 deletion examples/static-provisioning/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ configurations:
resources:
- resources.yaml
secretGenerator:
- name: juicefs-aws-us-east-1
- name: juicefs-secret
envs:
- secrets.env
12 changes: 6 additions & 6 deletions examples/static-provisioning/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: juicefs-aws-us-east-1
name: juicefs-pv
spec:
capacity:
storage: 10Pi
Expand All @@ -12,16 +12,16 @@ spec:
persistentVolumeReclaimPolicy: Retain
csi:
driver: csi.juicefs.com
volumeHandle: aws-us-east-1
volumeHandle: test-bucket
fsType: juicefs
nodePublishSecretRef:
name: juicefs-aws-us-east-1
name: juicefs-secret
namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ten-pb-fs
name: juicefs-pvc
namespace: default
spec:
accessModes:
Expand All @@ -35,7 +35,7 @@ spec:
apiVersion: v1
kind: Pod
metadata:
name: app
name: juicefs-app
namespace: default
spec:
containers:
Expand All @@ -55,4 +55,4 @@ spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: ten-pb-fs
claimName: juicefs-pvc

0 comments on commit decfc00

Please sign in to comment.