Kubernetes Operator가 Cloud Manager 또는 Ops Manager 프로젝트에서 객체를 생성하거나 업데이트 하려면 시크릿 저장 도구에 프로그래밍 방식 API 키를 저장 해야 합니다.
동일한 네임스페이스에 여러 시크릿이 존재할 수 있습니다. 각 사용자에게는 고유한 비밀이 있어야 합니다.
아래 절차에 따라 프로그래밍 방식 API 키를 Kubernetes 시크릿으로 수동으로 저장 수 있습니다. 또는 다음을 수행할 수도 있습니다.
Store the Programmatic API Key as a Vault secret using the procedure to Create a Vault Secret. To use Vault, you must also configure the secret storage.
전제 조건
Kubernetes Operator에 대한 자격 증명을 생성하려면 다음을 수행해야 합니다.
Have or create an Ops Manager Organization.
Have or generate a Programmatic API Key.
이 새 프로그래밍 방식 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.Add the IP or CIDR block of any hosts that serve the Kubernetes Operator to the API Access List.
절차
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 연산자는 인증을 위해 두 버전을 모두 허용합니다.