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

Kubernetes Operator용 MongoDB 컨트롤러 설치

참고

이 튜토리얼은 Kubernetes 에 대한 약간의 지식이 있다고 가정합니다. Kubernetes 에 익숙하지 않은 경우 시작하기 전에 Kubernetes 객체 및 사용자 지정 리소스에 대한 Kubernetes 설명서를 검토 . Kubernetes Operator는 Ops Manager 및 MongoDB deployment를 사용자 지정 리소스로 나타냅니다. 다른 Kubernetes 객체 관리 것과 동일한 방식으로 kubectl을 사용하여 객체를 생성하고 관리 . 이러한 사용자 지정 리소스가 서로 어떤 관련이 있는지 학습 보려면 Kubernetes 용 MongoDB 컨트롤러 연산자 아키텍처 개요를 참조하세요.

Kubernetes Operator를 설치하기 전에 다음 전제 조건을 완료하세요.

1

Kubernetes 솔루션이 필요한 경우 올바른 솔루션 선택에 대한 Kubernetes 설명서를 참조하세요. 지원되는 hardware 아키텍처를 검토합니다.

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

참고

Helm 을 사용하여 Kubernetes Operator를 설치할 수 있습니다. Helm을 설치하는 방법을 학습하려면 Github 의 설명서를 참조하세요.

3

기본값 으로 Kubernetes Operator는 mongodb 네임스페이스 사용합니다. 설치를 간소화하려면 다음 mongodb kubectl 명령을 사용하여(으)로 레이블된 네임스페이스 생성하는 것이 좋습니다.

kubectl create namespace mongodb

mongodb 네임스페이스를 사용하지 않으려면 네임스페이스에 원하는 레이블을 지정할 수 있습니다.

kubectl create namespace <namespaceName>
4

Kubernetes 연산자로 Ops Manager 리소스를 배포하지 않는 경우, Kubernetes cluster 외부에서 Ops Manager를 실행해야 합니다. Kubernetes 연산자를 사용하여 Kubernetes에 Ops Manager 리소스를 배포하려는 경우 이 사전 조건을 건너뛰세요.

중요

Ops Manager 설치에서는 활성 NTP 서비스를 실행해야 합니다. Ops Manager 호스트의 시계가 동기화되지 않으면 해당 호스트는 Kubernetes 연산자와 통신할 수 없습니다.

MongoDB Ops Manager 호스트의 NTP 서비스를 확인하는 방법을 알아보려면 RHEL 설명서를 참조하세요.

다음 계획 주제를 검토합니다. 자세한 내용은 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.10.0/public/crds.yaml
3

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

kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-kubernetes/1.10.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.10.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 컨트롤러를 설치한 후 다음을 수행할 수 있습니다.