AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

Kubernetes Operator용 MongoDB 컨트롤러 설치

Kubernetes 연산자를 설치하기 전에 설치 계획을확인하십시오.

참고

이 튜토리얼은 Kubernetes에 대한 약간의 지식이 있다고 가정하고 관련 Kubernetes 문서에 대한 링크를 제공합니다. Kubernetes에 대해 잘 모르는 경우, 먼저 해당 문서를 검토하세요.

설치 절차는 환경 구성 방법에 따라 달라집니다.

참고

전체적으로 동일한 네임스페이스 사용

기본값으로 Kubernetes Operator는 Kubernetes 클러스터의 모든 리소스를 네임스페이스 mongodb에 배포합니다. mongodb-kubernetes.yaml에서 metadata.namespace의 모든 값을 편집하여 Kubernetes 연산자 리소스를 다른 네임스페이스에 배포할 수 있습니다. 또한 동일한 파일의 모든 RoleBinding 및 ClusterRoleBinding에서 subjects[0].namespace 값을 업데이트해야 합니다. 이 값을 생략하면 바인딩은 기본값 mongodb 네임스페이스에서 ServiceAccount을 찾지만 찾을 수 없습니다.

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongodb-kubernetes-operator
namespace: production
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: mongodb-kubernetes-operator
namespace: production
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: mongodb-kubernetes-operator
subjects:
- kind: ServiceAccount
name: mongodb-kubernetes-operator
namespace: production
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb-kubernetes-operator
namespace: production
---
# Example truncated
---
...
1

선택적 Kubernetes 연산자 설치 설정에 대해 알아보려면 연산자 kubectl 및 oc 설치 설정을 참조하세요.

참고

To enable the Public Preview of static containers, which improve and simplify security, see Static Containers (Public Preview). We don't recommend using this feature in production while it's in Public Preview. To learn more, see Preview Features.

2

다음 kubectl 명령을 실행하여 선택한 버전의 CRD를 Kubernetes 클러스터 에 배포 .

kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-kubernetes/1.5.0/public/crds.yaml
3

다음 kubectl 명령을 실행하여 선택한 버전의 Kubernetes Operator를 Kubernetes 클러스터 에 배포 .

kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-kubernetes/1.5.0/public/mongodb-kubernetes.yaml

시작하기 전에 OpenShift 에 Kubernetes Operator를 배포 때 MANAGED_SECURITY_CONTEXT 플래그가 true (으)로 설정하다 있는지 확인하세요. 이 값은 values-openshift.yaml 파일에 미리 정의되어 있습니다.

설치 절차는 환경 구성 방법에 따라 달라집니다.

참고

전체적으로 동일한 네임스페이스 사용

기본값으로 Kubernetes Operator는 Kubernetes 클러스터의 모든 리소스를 네임스페이스 mongodb에 배포합니다. mongodb-kubernetes-openshift.yaml에서 metadata.namespace의 모든 값을 편집하여 Kubernetes 연산자 리소스를 다른 네임스페이스에 배포할 수 있습니다. 또한 동일한 파일의 모든 RoleBinding 및 ClusterRoleBinding에서 subjects[0].namespace 값을 업데이트해야 합니다. 이 값을 생략하면 바인딩은 기본값 mongodb 네임스페이스에서 ServiceAccount을 찾지만 찾을 수 없습니다.

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongodb-kubernetes-operator
namespace: production
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: mongodb-kubernetes-operator
namespace: production
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: mongodb-kubernetes-operator
subjects:
- kind: ServiceAccount
name: mongodb-kubernetes-operator
namespace: production
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb-kubernetes-operator
namespace: production
---
# Example truncated
---
...
1

다음 git 명령을 실행합니다.

git clone https://github.com/mongodb/mongodb-kubernetes.git
cd mongodb-kubernetes
git checkout 1.5.0
2

예를 들어 홈 디렉토리에서 리포지토리를 복제한 경우 다음을 실행합니다.

cd ~/mongodb-kubernetes
3

다음 oc 명령을 실행합니다.

oc apply -f crds.yaml
4

선택적 Kubernetes 연산자 설치 설정에 대해 알아보려면 연산자 kubectl 및 oc 설치 설정을 참조하세요.

참고

To enable the Public Preview of static containers, which improve and simplify security, see Static Containers (Public Preview). We don't recommend using this feature in production while it's in Public Preview. To learn more, see Preview Features.

5
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: enterprise-operator
namespace: mongodb
imagePullSecrets:
- name: <openshift-pull-secret>
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongodb-kubernetes-appdb
namespace: mongodb
imagePullSecrets:
- name: <openshift-pull-secret>
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongodb-kubernetes-database-pods
namespace: mongodb
imagePullSecrets:
- name: <openshift-pull-secret>

자세한 내용은 Helm 설치 설정에서 registry.imagePullSecrets 설정을 참조하세요.

6

다음 oc 명령을 실행합니다.

oc apply -f mongodb-kubernetes-openshift.yaml

Kubernetes 연산자가 올바르게 설치되었는지 확인하려면 다음 명령을 실행하고 출력을 확인합니다.

kubectl describe deployments mongodb-kubernetes-operator -n <metadata.namespace>

기본적으로 배포는 mongodb 네임스페이스에 존재합니다. 다음 오류 메시지가 나타나면 올바른 네임스페이스를 사용하고 있는지 확인합니다.

Error from server (NotFound): deployments.apps "mongodb-kubernetes-operator" not found

Kubernetes 연산자 문제를 해결하려면 Kubernetes 연산자 의 로그 검토 및 기타 문제 해결 주제를 참조하세요.

중요

Kubernetes Operator 또는 네임스페이스 를 제거해야 하는 경우 먼저 MongoDB 리소스를 제거해야 합니다.

Kubernetes Operator용 MongoDB 컨트롤러를 설치한 후 다음을 수행할 수 있습니다.