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.
동일한 네임스페이스에 여러 시크릿이 존재할 수 있습니다. 각 사용자에게는 고유한 비밀이 있어야 합니다.
아래 절차 에 따라 프로그래밍 방식 API 키 를 Kubernetes 시크릿 으로 수동으로 저장할 수 있습니다. . 또는 다음을 수행할 수도 있습니다.
볼트 시크릿 생성 절차에 따라 프로그래밍 방식 API 키 를 볼트 시크릿으로 저장합니다. Vault를 사용하려면 시크릿 스토리지도 구성해야 합니다.
전제 조건
Kubernetes Operator에 대한 자격 증명을 생성하려면 다음을 수행해야 합니다.
MongoDB Ops Manager 조직을 보유하거나 생성합니다.
프로그래매틱 API 키를 보유하거나 생성합니다.
이 새 프로그래밍 방식 API 키를 부여합니다.
The Organization Owner or
Global Ownerrole, if you want the Kubernetes Operator to create projects and manage them.프로젝트 소유자 역할: Kubernetes Operator가 프로젝트만 관리하도록 하려는 경우.
참고
You must grant the Programmatic API Key the Organization Owner or
Global Ownerrole. If you want to grant the Programmatic API Key only the Project Owner role, you must first create the project and then the Programmatic API Key for the project with the Project Owner role. The Kubernetes Operator can't create projects if the Programmatic API Key has only the Project Owner role.Kubernetes Operator를 제공 하는 모든 호스트의 IP 또는 CIDR 차단 을 API 액세스 목록에 추가합니다.
절차
Kubernetes 시크릿을 생성하려면 다음을 수행합니다.
새 Kubernetes 시크릿 만들기
원하는 Ops Manager 프로그래밍 방식 API 키에 대한 공개 키와 비공개 키가 있는지 확인합니다.
다음 Kubernetes 명령을 호출하여 시크릿을 생성합니다.
kubectl -n <metadata.namespace> \ create secret generic <mycredentials> \ --from-literal="publicKey=<publicKey>" \ --from-literal="privateKey=<privateKey>" 플래그는 네임스페이스 를 제한합니다. 이
-n시크릿이 적용됩니다. 모든 MongoDB Kubernetes 리소스는 시크릿 과 동일한 네임스페이스에 존재해야 합니다. 및 ConfigMaps . Kubernetes Operator는 시크릿이나 ConfigMap을 사용하지 않습니다.참고
이 명령의 더 이상 사용되지 않는 버전은
publicKey및privateKey대신user및publicApiKey를 지정합니다. Kubernetes 연산자는 인증을 위해 두 버전을 모두 허용합니다.