> This page location: /docs.md > /docs/management.md > /docs/atlas/operator/current.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: api-keys, service-account
-->

# Configure Access to Atlas

Atlas Kubernetes Operator doesn't support Atlas Infinite Database clusters in public preview. To learn which features Atlas Infinite Database supports in public preview, see [Atlas Infinite Database Edition](https://www.mongodb.com/docs/atlas/infinite/atlas-infinite-landing/). To learn more about preview features, see [Preview Features](https://www.mongodb.com/docs/preview-features/).

To connect to the Atlas Administration API, Atlas Kubernetes Operator reads the organization ID and credentials from Atlas Kubernetes Operator [secrets](https://kubernetes.io/docs/concepts/configuration/secret/). You can authenticate using [API keys](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-about-org-api-keys) or [Service Accounts](https://www.mongodb.com/docs/atlas/operator/current/ak8so-service-accounts.md#std-label-ak8so-service-accounts-ref). You can also configure the following features:

- [secret storage.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-secret-storage.md#std-label-ak8so-secret-storage)

- [network peering.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-network-peering.md#std-label-ak8so-network-peering)

- [private endpoints.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-private-link.md#std-label-ak8so-private-endpoint)

- [Unified Cloud Provider Integrations.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-unified-access.md#std-label-ak8so-unified-access)

- [custom database roles.](https://www.mongodb.com/docs/atlas/operator/current/atlascustomrole-custom-resource.md#std-label-ak8so-configure-custom-database-roles)

- [X.509 authentication](https://www.mongodb.com/docs/atlas/operator/current/ak8so-x509.md#std-label-ak8so-x509)

- [Encryption at Rest.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-encryption-at-rest-customer-keys.md#std-label-ak8so-ear)

- [federated authentication](https://www.mongodb.com/docs/atlas/operator/current/ak8so-configure-federated-authentication.md#std-label-ak8so-federated-auth)

- [teams.](https://www.mongodb.com/docs/atlas/operator/current/ak8so-configure-teams.md#std-label-ak8so-team)

To learn more about creating an Atlas account, see [Register and Log in to Atlas.](https://www.mongodb.com/docs/atlas/tutorial/create-atlas-account.md#std-label-atlas-register-account)

## Atlas Kubernetes Operator Secrets

Depending on your configuration, Atlas Kubernetes Operator reads from one of the following Atlas Kubernetes Operator [secrets](https://kubernetes.io/docs/concepts/configuration/secret/):

| Scope | Location | Description |
| --- | --- | --- |
| Global | Atlas Kubernetes Operator [secret](https://kubernetes.io/docs/concepts/configuration/secret/) `<operator-deployment-name>-api-key` created in the same [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) where you installed Atlas Kubernetes Operator. | Atlas Kubernetes Operator uses this secret data to connect to the Atlas Administration API unless the [`AtlasProject` Custom Resource](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-custom-resource) specifies [spec.connectionSecretRef.name.](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-spec-connectionsecretref) `global` Atlas Kubernetes Operator [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) let you use one set of credentials for all the projects in an organization. Any new [`AtlasProject` Custom Resource](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-custom-resource) uses the same credentials for reduced overhead. The default name of the Atlas Kubernetes Operator deployment is `mongodb-atlas-operator`. So, the [secret](https://kubernetes.io/docs/concepts/configuration/secret/) should be named `mongodb-atlas-operator-api-key`. |
| Project | Atlas Kubernetes Operator [secret](https://kubernetes.io/docs/concepts/configuration/secret/) referenced with [spec.connectionSecretRef.name](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-spec-connectionsecretref) in the [`AtlasProject` Custom Resource.](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-custom-resource) By default, Atlas Kubernetes Operator keeps connection secrets in the same [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) as the [`AtlasProject` Custom Resource](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-custom-resource). To store secrets in another [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/), specify the [spec.connectionSecretRef.namespace](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-spec-connectionsecretref) parameter. | Atlas Kubernetes Operator uses this [secret](https://kubernetes.io/docs/concepts/configuration/secret/) data to connect to the Atlas Administration API for any [`AtlasDeployment` Custom Resource](https://www.mongodb.com/docs/atlas/operator/current/atlasdeployment-custom-resource.md#std-label-atlasdeployment-custom-resource) and `AtlasDatabaseUser` custom resource that references the project. If you do not specify [spec.connectionSecretRef.name](https://www.mongodb.com/docs/atlas/operator/current/atlasproject-custom-resource.md#std-label-atlasproject-spec-connectionsecretref), Atlas Kubernetes Operator uses the `global` Atlas Kubernetes Operator secret. Atlas Kubernetes Operator [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) per project allow for more granular access. You may want a single set of credentials to have access to a single Atlas project. |

## Parameters

Both `global` and `project` [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) require the following information:

### API Keys

| Parameter | Description |
| --- | --- |
| `orgId` | Unique 24-digit hexadecimal string used to identify your Atlas [organization.](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-organization) |
| `publicAPIKey` | Public part of the [API key.](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-about-org-api-keys) |
| `privateAPIKey` | Private part of the [API key.](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-about-org-api-keys) |

## Prerequisites

Choose one of the following authentication methods:

### API Keys

You need the following public API key, private API key, and the organization ID information to configure Atlas Kubernetes Operator access to Atlas.

- If you want Atlas Kubernetes Operator to create a new Atlas project, [Grant Programmatic Access to an Organization](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-create-org-api-key). If your organization requires an IP access list for the Atlas Administration API, you must also [configure the API access list.](https://www.mongodb.com/docs/atlas/configure-api-access-project.md#std-label-edit-project-api-key-access-list)

  **Important:**

  You must assign the API key the Organization Project Creator organization role or higher.

- If you want to work with an existing Atlas project, [Add Project Access from a Project](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-create-project-api-key). If your organization requires an IP access list for the Atlas Administration API, you must also [configure the API access list.](https://www.mongodb.com/docs/atlas/configure-api-access-project.md#std-label-edit-project-api-key-access-list)

  **Important:**

  You must assign the API key the Project Owner project role.

## Procedure

To configure Atlas Kubernetes Operator access to Atlas, create a [secret](https://kubernetes.io/docs/concepts/configuration/secret/) with your credentials. Choose the tab that matches your preferred authentication method:

### API Keys

- For a `global` Atlas Kubernetes Operator [secret](https://kubernetes.io/docs/concepts/configuration/secret/), run the following commands:

  **Note:**

  The name of the `global` Atlas Kubernetes Operator secret must conform to the predefined format. The default name of the Atlas Kubernetes Operator deployment is `mongodb-atlas-operator`. So, the [secret](https://kubernetes.io/docs/concepts/configuration/secret/) should be named `mongodb-atlas-operator-api-key`.

  ```sh
  kubectl create secret generic mongodb-atlas-operator-api-key \
     --from-literal="orgId=<the_atlas_organization_id>" \
     --from-literal="publicApiKey=<the_atlas_api_public_key>" \
     --from-literal="privateApiKey=<the_atlas_api_private_key>" \
     -n <operator_namespace>

  kubectl label secret mongodb-atlas-operator-api-key atlas.mongodb.com/type=credentials -n mongodb-atlas-system
  ```

- For a `project` Atlas Kubernetes Operator [secret](https://kubernetes.io/docs/concepts/configuration/secret/), run the following commands:

  ```sh
  kubectl create secret generic my-project-connection \
     --from-literal="orgId=<the_atlas_organization_id>" \
     --from-literal="publicApiKey=<the_atlas_api_public_key>" \
     --from-literal="privateApiKey=<the_atlas_api_private_key>" \
     -n <atlas_project_namespace>

  kubectl label secret my-project-connection atlas.mongodb.com/type=credentials -n <atlas_project_namespace>
  ```
