Docs Menu
Docs Home
/
MongoDB Enterprise Kubernetes Operator
/ /

Create Credentials for the Kubernetes Operator

On this page

  • Prerequisites
  • Procedure

For the Kubernetes Operator to create or update objects in your Cloud Manager or Ops Manager Project, you need to store your Programmatic API Key in your secret storage tool.

Multiple secrets can exist in the same namespace. Each user should have their own secret.

You can follow the Procedure below to manually store the Programmatic API Key as a Kubernetes secret. Alternatively, you can:

To create credentials for the Kubernetes Operator, you must:

  1. Have or create an Ops Manager Organization.

  2. Have or generate a Programmatic API Key.

  3. Grant this new Programmatic API Key:

  4. Add the IP or CIDR block of any hosts that serve the Kubernetes Operator to the API Access List.

To create your Kubernetes secret:

1
  1. Ensure you have the Public and Private Keys for your desired Ops Manager Programmatic API Key.

  2. Invoke the following Kubernetes command to create your secret:

    kubectl -n <metadata.namespace> \
    create secret generic <mycredentials> \
    --from-literal="publicKey=<publicKey>" \
    --from-literal="privateKey=<privateKey>"

    The -n flag limits the namespace to which this secret applies. All MongoDB Kubernetes resources must exist in the same namespace as the secrets and ConfigMaps. The Kubernetes Operator doesn't use either the secrets or ConfigMaps.

    Note

    The deprecated version of this command specifies a user and publicApiKey instead of a publicKey and privateKey. Kubernetes Operator accepts either version for authentication.

2

Invoke the following Kubernetes command to verify your secret:

kubectl describe secrets/<mycredentials> -n <metadata.namespace>

This command returns a secret description in the shell:

Name: <mycredentials>
Namespace: <metadata.namespace>
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
privateKey: 31 bytes
publicKey: 22 bytes

Back

Configure the

Next

Create One Project using a ConfigMap