| 31 | |
| 32 | == ユーザの作成と権限付与 |
| 33 | |
| 34 | {{{ |
| 35 | # oc create user myuser |
| 36 | # htpasswd /etc/openshift/openshift-passwd myuser |
| 37 | # oc policy add-role-to-user edit myuser -n myproject |
| 38 | }}} |
| 39 | |
| 40 | パスワードの設定は、htpasswdなり認証の仕組みを利用して行う必要があることに注意。 |
| 41 | |
| 42 | == ボリュームの利用(NFS) |
| 43 | Persistence Volumeをシステムで作成し、Persistence Volume Claimをプロジェクトで利用するボリューム領域として作成します。 |
| 44 | |
| 45 | === py.yml |
| 46 | {{{ |
| 47 | apiVersion: v1 |
| 48 | kind: PersistentVolume |
| 49 | metadata: |
| 50 | name: pv0001 |
| 51 | spec: |
| 52 | capacity: |
| 53 | storage: 2Gi |
| 54 | accessModes: |
| 55 | - ReadWriteOnce |
| 56 | nfs: |
| 57 | path: /var/lib/docker/nfs |
| 58 | server: 10.0.0.7 |
| 59 | persistentVolumeReclaimPolicy: Recycle |
| 60 | }}} |
| 61 | |
| 62 | {{{ |
| 63 | # oc login -u system:admin |
| 64 | ... |
| 65 | # oc create -f pv.yml |
| 66 | }}} |
| 67 | |
| 68 | === pvc.yml |
| 69 | {{{ |
| 70 | apiVersion: "v1" |
| 71 | kind: "PersistentVolumeClaim" |
| 72 | metadata: |
| 73 | name: "claim1" |
| 74 | spec: |
| 75 | accessModes: |
| 76 | - "ReadWriteOnce" |
| 77 | resources: |
| 78 | requests: |
| 79 | storage: "1Gi" |
| 80 | volumeName: "pv0001" |
| 81 | }}} |
| 82 | |
| 83 | {{{ |
| 84 | # oc login -u system:admin |
| 85 | ... |
| 86 | # oc create -f pv.yml |
| 87 | }}} |
| 88 | |