- Install and Configure the Kubernetes Operator >
- Configure the Kubernetes Operator for MongoDB Resources >
- Create Credentials for the Kubernetes Operator
Create Credentials for the Kubernetes Operator¶
On this page
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 as a Kubernetes secret. Creating a secret stores authentication credentials so only Kubernetes can access them.
Multiple secrets can exist in the same namespace. Each user should have their own secret.
Prerequisites¶
To create credentials for the Kubernetes Operator, you must:
Have or create an Ops Manager Organization.
Note
Unlike earlier Kubernetes Operator versions, use the Operator to create your Ops Manager project. The Operator adds additional metadata to Projects that it creates to help manage the deployments.
Have or generate a Programmatic API Key.
Grant this new Programmatic API Key the
Project Owner
role.Add the IP or CIDR block of any hosts that serve the Kubernetes Operator to the API Whitelist.
Procedure¶
To create your Kubernetes secret:
Make sure you have the Public and Private Keys for your desired Ops Manager Programmatic API Key.
Invoke the following Kubernetes command to create your secret:
Note
The
-n
flag limits the namespace to which this secret applies. All MongoDB Kubernetes resources must be in the same namespace with the secrets and ConfigMaps. The Kubernetes Operator does not use either the secrets or ConfigMaps.Invoke the following Kubernetes command to verify your secret:
This command returns a secret description in the shell: