Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

27.21.3.2. スナップショットユーザーの管理

クラスターの設定によっては、管理者以外のユーザーが API サーバーで VolumeSnapshot オブジェクトを操作できるようにする必要があります。これは、特定のユーザーまたはグループにバインドされる ClusterRole を作成することで実行できます。

たとえば、ユーザー alice がクラスター内のスナップショットを操作する必要があるとします。クラスター管理者は以下の手順を実行します。

  1. 新規の ClusterRole を定義します。

    apiVersion: v1
    kind: ClusterRole
    metadata:
      name: volumesnapshot-admin
    rules:
    - apiGroups:
      - "volumesnapshot.external-storage.k8s.io"
      attributeRestrictions: null
      resources:
      - volumesnapshots
      verbs:
      - create
      - delete
      - deletecollection
      - get
      - list
      - patch
      - update
      - watch
  2. ClusterRole バインドオブジェクトを作成してクラスターロールをユーザー alice にバインドします。

    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRoleBinding
    metadata:
      name: volumesnapshot-admin
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: volumesnapshot-admin
    subjects:
    - kind: User
      name: alice
注記

これは API アクセス設定の一例にすぎません。VolumeSnapshot オブジェクトの動作は他の OpenShift Container Platform API オブジェクトと同様です。API RBAC の管理についての詳細は、API アクセス制御についてのドキュメント を参照してください。