Creating a Secret

Create an array Secret YAML file to define the storage credentials (username and password) and address for use with Ceph Block Devices (RBD) for Ceph-CSI driver.

Before you begin

Be sure that you have the following permissions before creating a Secret.
  • Kubernetes Administrator permissions.
  • Ceph Manager (ceph-mgr) permissions. For more information, see User roles and permissions.
  • userID and userKey for your username or role. If needed, get the unique generated key, by using the ceph auth get-or-create and ceph auth get-or-create-key commands. Encode the generated values with the following Base64 commands:
    echo -n USER_ID | base64
    echo -n USER_KEY | base64
    For more information about getting the unique generated values, see Adding Ceph user in the IBM Storage Ceph documentation.

About this task

Important: When your storage system password is changed, be sure to also change the passwords in the corresponding Secrets, particularly when LDAP is used on the storage systems.

Failing to do so causes mismatched passwords across the storage systems and the Secrets, causing the user to be locked out of the storage systems.

Procedure

  1. Create the Secret file, similar to the following ceph-admin-secret.yaml file.
    kind: Secret
    metadata:
      name: ceph-admin
      namespace: default
    type: kubernetes.io/rbd
    data:
      userID: USER_ID
      userKey: USER_KEY
    Replace the following values:
    USER_ID
    Base64 encoded username or role.

    For example, bXlQb29sQWRtaW4=.

    USER_KEY
    Base64 encoded key that was generated when the user or role was created.

    For example, QVFCK0hDVmdXSjQ1T0JBQXBrc0VtcVhlZFpjc0JwaStIcmU5M3c9PQ==

  2. Apply the Secret, by using the kubectl apply command.
    kubectl apply -f FILENAME.YAML
    The secret/SECRET_NAME created message is emitted.