27.4.2.3. Cinder ボリュームのセキュリティー
お使いのアプリケーションで Cinder PV を使用する場合に、そのデプロイメント設定にセキュリティーを追加します。
注記
Cinder ボリュームを実装する前に、ボリュームのセキュリティー を確認します。
-
適切な
fsGroup
ストラテジーを使用する SCC を作成します。 サービスアカウントを作成して、そのアカウントを SCC に追加します。
[source,bash] $ oc create serviceaccount <service_account> $ oc adm policy add-scc-to-user <new_scc> -z <service_account> -n <project>
アプリケーションのデプロイ設定で、サービスアカウント名と
securityContext
を指定します。apiVersion: v1 kind: ReplicationController metadata: name: frontend-1 spec: replicas: 1 1 selector: 2 name: frontend template: 3 metadata: labels: 4 name: frontend 5 spec: containers: - image: openshift/hello-openshift name: helloworld ports: - containerPort: 8080 protocol: TCP restartPolicy: Always serviceAccountName: <service_account> 6 securityContext: fsGroup: 7777 7