MongoDB Enterprise Kubernetes Operator 설치
전제 조건 및 고려 사항
Kubernetes Operator를 설치하기 전에 설치를 계획해야 합니다.
참고
이 튜토리얼은 Kubernetes에 대한 약간의 지식이 있다고 가정하고 관련 Kubernetes 문서에 대한 링크를 제공합니다. Kubernetes에 대해 잘 모르는 경우, 먼저 해당 문서를 검토하세요.
Kubernetes와 함께 설치
설치 절차는 환경 구성 방법에 따라 달라집니다.
참고
전체적으로 동일한 네임스페이스 사용
기본적으로 Kubernetes Operator는 Kubernetes 클러스터의 모든 리소스를 mongodb
네임스페이스 에 배포합니다. .metadata.namespace
에서 의 모든 값을 편집하여 Kubernetes Operator 리소스를 다른 네임스페이스에 배포할 수 있습니다.mongodb-enterprise.yaml
##--- # Source: mongodb-enterprise-operator/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: name: mongodb-enterprise-operator namespace: production ##--- # Source: mongodb-enterprise-operator/templates/operator.yaml apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-enterprise-operator namespace: production # Example truncated ...
선택 사항:설치하기 전에 Kubernetes 연산자YAML 을 사용자 지정합니다.
선택적 Kubernetes 연산자 설치 설정에 대해 알아보려면 연산자 kubectl 및 oc 설치 설정을 참조하세요.
참고
보안을 개선하고 간소화하는 정적 컨테이너의 공개 미리 보기를 활성화하려면 정적 컨테이너(공개 미리 보기) 를 참조하세요. 공개 미리 보기에 있는 동안 프로덕션 환경에서는 이 기능을 사용하지 않는 것이 좋습니다.
<version>
자리 표시자를 채우고 다음 kubectl
명령을 실행하여 선택한 버전의 Kubernetes Operator를 Kubernetes 클러스터에 배포합니다.
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/<version>/mongodb-enterprise.yaml
Kubernetes용 MongoDB Helm 차트를 사용하세요.
Kubernetes용 MongoDB Helm 차트 추가 .
다음을 실행하여 로컬에서 Kubernetes Operator Helm Chart를 추가할 수 있습니다.
helm repo add mongodb https://mongodb.github.io/helm-charts
배포하기 전에 Helm 차트를 사용자 지정합니다.
선택적 Kubernetes 연산자 설치 설정에 대해 알아보려면 연산자 Helm 설치 설정을 참조하세요.
Kubernetes 연산자를 배포합니다.
다음 helm
명령을 실행하여 Kubernetes 클러스터의 기본 네임스페이스에 Kubernetes Operator를 배포합니다.
helm install --upgrade enterprise-operator mongodb/enterprise-operator
다음과 같이 --namespace
및 --create-namespace
플래그를 전달하여 기본이 아닌 네임스페이스에 Kubernetes 연산자를 배포할 수 있습니다.
helm install --upgrade enterprise-operator mongodb/enterprise-operator \ --namespace mongodb \ --create-namespace
Helm으로 특정 일일 빌드 설치
MongoDB는 매일 Kubernetes 연산자 이미지를 재구축하여 최신 보안 및 OS 업데이트를 통합합니다.
기본적으로 helm
는 지정한 Kubernetes 연산자 버전에 대한 최신 빌드를 설치합니다.
이전 빌드를 설치하려면 --set build=<build-id>
을 사용하여 빌드 ID를 매개 변수로 지정합니다. 빌드 ID는 항상 -b<YYYYMMDD>T000000Z
형식이며, 여기서 <YYYYMMDD>
는 사용하려는 빌드가 생성된 날짜입니다.
예제
이 예에서는 최신 이미지로 Kubernetes 연산자를 설치하는 방법을 보여줍니다.
helm install enterprise-operator mongodb/enterprise-operator
이 예에서는 2021년 2월 5일 자정에 생성된 이미지로 Kubernetes 연산자를 설치하는 방법을 보여 줍니다.
helm install enterprise-operator mongodb/enterprise-operator \ --set build=-b20210205T000000Z
참고
MongoDB는 기본(최신) 빌드를 사용할 것을 권장합니다.
OpenShift로 설치
시작하기 전에 OpenShift에 Kubernetes Operator를 배포할 때 플래그가 으)로 설정되어 있는지 확인하세요. 이 값은 MANAGED_SECURITY_CONTEXT
true
values-openshift.yaml 파일 에 미리 정의되어 있습니다. 파일입니다.
설치 절차는 환경 구성 방법에 따라 달라집니다.
참고
전체적으로 동일한 네임스페이스 사용
기본적으로 Kubernetes Operator는 Kubernetes 클러스터의 모든 리소스를 mongodb
네임스페이스 에 배포합니다. .metadata.namespace
에서 의 모든 값을 편집하여 Kubernetes Operator 리소스를 다른 네임스페이스에 배포할 수 있습니다.mongodb-enterprise-openshift.yaml
##--- # Source: mongodb-enterprise-operator/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: name: enterprise-operator namespace: production ##--- # Source: mongodb-enterprise-operator/templates/operator.yaml apiVersion: apps/v1 kind: Deployment metadata: name: enterprise-operator namespace: production # Example truncated ...
MongoDB Enterprise Kubernetes Operator 리포지토리 복제.
다음 git
명령을 호출합니다.
git clone https://github.com/mongodb/mongodb-enterprise-kubernetes.git
MongoDB Enterprise Kubernetes Operator 리포지토리 를 복제한 디렉토리로 이동합니다. .
예를 들어 홈 디렉토리에서 리포지토리를 복제한 경우 다음을 실행합니다.
cd ~/mongodb-enterprise-kubernetes
CustomResourceDefinitions 설치 MongoDB deployment의 경우.
다음 oc 를 호출합니다. 명령:
oc apply -f crds.yaml
선택 사항: 설치하기 전에 Kubernetes 연산자 YAML 을 사용자 지정합니다.
선택적 Kubernetes 연산자 설치 설정에 대해 알아보려면 연산자 kubectl 및 oc 설치 설정을 참조하세요.
참고
보안을 개선하고 간소화하는 정적 컨테이너의 공개 미리 보기를 활성화하려면 정적 컨테이너(공개 미리 보기) 를 참조하세요. 공개 미리 보기에 있는 동안 프로덕션 환경에서는 이 기능을 사용하지 않는 것이 좋습니다.
설치하기 <openshift-pull-secret>
전에 Kubernetes ServiceAccount
Operator YAML 의 정의에 를 추가합니다.
# Source: mongodb-enterprise-operator/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: name: enterprise-operator namespace: mongodb imagePullSecrets: - name: <openshift-pull-secret> apiVersion: v1 kind: ServiceAccount metadata: name: mongodb-enterprise-appdb namespace: mongodb imagePullSecrets: - name: <openshift-pull-secret> apiVersion: v1 kind: ServiceAccount metadata: name: mongodb-enterprise-database-pods namespace: mongodb imagePullSecrets: - name: <openshift-pull-secret>
자세한 내용은 Helm 설치 설정에서 registry.imagePullSecrets
설정을 참조하세요.
Kubernetes용 MongoDB Helm 차트를 사용하세요.
Helm 3 을(를) 사용하여 Kubernetes Operator를 설치할 수 있습니다. .
Kubernetes용 MongoDB Helm 차트 추가 리포지토리를 Helm에 추가합니다.
helm repo add mongodb https://mongodb.github.io/helm-charts
을(를) 사용하여 Kubernetes helm
Operator를 설치합니다.
Kubernetes용 MongoDB Helm Charts를 설치합니다.
helm install enterprise-operator mongodb/enterprise-operator \ --values https://raw.githubusercontent.com/mongodb/helm-charts/main/charts/enterprise-operator/values-openshift.yaml
values-openshift.yaml 설정. 선택적 Kubernetes 연산자 설치 설정에 대해 자세히 알아보려면 연산자 Helm 설치 설정을 참조하세요.
참고
보안을 개선하고 간소화하는 정적 컨테이너의 공개 미리 보기를 활성화하려면 정적 컨테이너(공개 미리 보기) 를 참조하세요. 공개 미리 보기에 있는 동안 프로덕션 환경에서는 이 기능을 사용하지 않는 것이 좋습니다.
Helm으로 특정 일일 빌드 설치
MongoDB는 매일 Kubernetes 연산자 이미지를 재구축하여 최신 보안 및 OS 업데이트를 통합합니다.
기본적으로 helm
는 지정한 Kubernetes 연산자 버전에 대한 최신 빌드를 설치합니다.
이전 빌드를 설치하려면 --set build=<build-id>
을 사용하여 빌드 ID를 매개 변수로 지정합니다. 빌드 ID는 항상 -b<YYYYMMDD>T000000Z
형식이며, 여기서 <YYYYMMDD>
는 사용하려는 빌드가 생성된 날짜입니다.
예제
이 예에서는 최신 이미지로 Kubernetes 연산자를 설치하는 방법을 보여줍니다.
helm install enterprise-operator mongodb/enterprise-operator
이 예에서는 2021년 2월 5일 자정에 생성된 이미지로 Kubernetes 연산자를 설치하는 방법을 보여 줍니다.
helm install enterprise-operator mongodb/enterprise-operator \ --set build=-b20210205T000000Z
참고
MongoDB는 기본(최신) 빌드를 사용할 것을 권장합니다.
설치 확인
Kubernetes 연산자가 올바르게 설치되었는지 확인하려면 다음 명령을 실행하고 출력을 확인합니다.
kubectl describe deployments mongodb-enterprise-operator -n <metadata.namespace>
oc describe deployments mongodb-enterprise-operator -n <metadata.namespace>
기본적으로 배포는 mongodb
네임스페이스에 존재합니다. 다음 오류 메시지가 나타나면 올바른 네임스페이스를 사용하고 있는지 확인합니다.
Error from server (NotFound): deployments.apps "mongodb-enterprise-operator" not found
Kubernetes 연산자 문제를 해결하려면 Kubernetes 연산자 의 로그 검토 및 기타 문제 해결 주제를 참조하세요.
중요
Kubernetes Operator 또는 네임스페이스 를 제거해야 하는 경우 먼저 MongoDB 리소스를 제거해야 합니다.
다음 단계
MongoDB Enterprise Kubernetes Operator를 설치한 후 다음을 수행할 수 있습니다.