다음 절차에서는 Kubernetes Operator를 최신 버전으로 업그레이드 하는 방법을 간략하게 설명합니다. 이 업그레이드 프로세스 는 Kubernetes Operator 설치 프로세스 와 유사합니다.
참고
Kubernetes Operator 업그레이드 프로세스 각 마이너 버전을 통해 대상 버전으로 점진적으로 업그레이드 해야 합니다. 예시 들어, 버전 1.2.x에서 1.4.x로 업그레이드하는 경우, 1.4.x로 진행하기 전에 먼저 1.3.x로 업그레이드 해야 합니다.
에서 실행 중인 업그레이드 MongoDB Enterprise Kubernetes Operator Kubernetes
참고
전체적으로 동일한 네임스페이스 사용
기본값 으로 Kubernetes Operator는 Kubernetes 클러스터 의 모든 리소스를 네임스페이스 mongodb
에 배포합니다. mongodb-enterprise.yaml
에서 metadata.namespace
의 모든 값을 편집하여 Kubernetes Operator 리소스를 다른 네임스페이스 에 배포 할 수 있습니다.
##--- # 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 연산자 설치 설정에 학습 보려면 연산자 Helm 설치 설정을 참조하세요.
Kubernetes 용 MongoDB Helm Charts사용합니다.
Kubernetes 용 MongoDB Helm Charts를 최신 버전으로 업데이트합니다.
다음 명령을 실행하여 현재 Helm 템플릿의 버전을 확인합니다.
helm search repo mongodb/enterprise-operator
현재 설치된 버전이 최신 릴리스 가 아닌 경우 다음 명령을 실행 하여 Helm 리포지토리를 업데이트 합니다.
helm repo update mongodb
Helm 리포지토리가 로컬에 설치되어 있지 않은 경우 다음을 실행 하여 설치할 수 있습니다.
helm repo add mongodb https://mongodb.github.io/helm-charts
Helm 차트를 사용자 지정하기 전에 업그레이드하세요.
호환성이 손상되는 변경을 방지하려면 기존 배포서버 와 동일한 설정을 선택해야 합니다. 선택적 Kubernetes 연산자 설치 설정에 학습 보려면 연산자 Helm 설치 설정을 참조하세요.
Kubernetes Operator를 업그레이드합니다.
다음 helm
명령을 실행하여 Kubernetes 클러스터 의 기본값 네임스페이스 에 Kubernetes Operator를 배포 합니다.
helm install enterprise-operator mongodb/enterprise-operator
다음과 같이 --namespace
및 --namespace-create
플래그를 전달하여 기본이 아닌 네임스페이스 에 Kubernetes Operator를 배포 수 있습니다.
helm install enterprise-operator mongodb/enterprise-operator \ --namespace mongodb \ --create-namespace
에서 실행되는 업그레이드 MongoDB Enterprise Kubernetes Operator OpenShift
다음 단계는 환경이 구성된 방식에 따라 달라집니다:
참고
전체적으로 동일한 네임스페이스 사용
기본값으로 Kubernetes Operator는 Kubernetes 클러스터의 모든 리소스를 네임스페이스 mongodb
에 배포합니다. mongodb-enterprise-openshift.yaml
에서 metadata.namespace
의 모든 값을 편집하여 Kubernetes Operator 리소스를 다른 네임스페이스 에 배포 할 수 있습니다.
##--- # 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 ...
업그레이드하기 전에 Kubernetes Operator YAML을 사용자 지정합니다.
호환성이 손상되는 변경을 방지하려면 기존 배포서버 와 동일한 설정을 선택해야 합니다. 선택적 Kubernetes 연산자 설치 설정에 학습 보려면 연산자 Helm 설치 설정을 참조하세요.
ServiceAccount
정의에 <openshift-pull-secret>
를 추가해야 합니다.
# 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>
새 버전의 Kubernetes 연산자로 업그레이드합니다.
<version>
자리 표시자를 채우고 다음 oc를 실행 .
oc apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/<version>/mongodb-enterprise-openshift.yaml
MongoDB deployment를 위한 CustomResourceDefinitions를 업그레이드합니다.
다음 oc 명령을 실행합니다.
<version>
자리 표시자를 채우고 다음 oc 명령을 실행 선택한 버전의 CRD를 Kubernetes 클러스터에 배포.
oc apply -f https://raw.githubusercontent.com/mongodb/mongodb-enterprise-kubernetes/<version>/crds.yaml
Kubernetes 용 MongoDB Helm Charts를 최신 버전으로 업데이트합니다.
다음 명령을 실행하여 현재 Helm 템플릿의 버전을 확인합니다.
helm search repo mongodb/enterprise-operator
현재 설치된 버전이 최신 릴리스 가 아닌 경우 다음 명령을 실행 하여 Helm 리포지토리를 업데이트 합니다.
helm repo update mongodb
Helm 리포지토리가 로컬에 설치되어 있지 않은 경우 다음을 실행 하여 설치할 수 있습니다.
helm repo add mongodb https://mongodb.github.io/helm-charts
Helm 차트를 사용자 지정하기 전에 업그레이드하세요.
호환성이 손상되는 변경을 방지하려면 기존 배포서버 와 동일한 설정을 선택해야 합니다. 선택적 Kubernetes 연산자 설치 설정에 학습 보려면 연산자 Helm 설치 설정을 참조하세요.
Kubernetes Operator를 업그레이드합니다.
다음 helm
명령을 실행하여 Kubernetes 클러스터 의 기본값 네임스페이스 에 Kubernetes Operator를 배포 합니다.
helm install enterprise-operator mongodb/enterprise-operator
다음과 같이 --namespace
및 --namespace-create
플래그를 전달하여 기본이 아닌 네임스페이스 에 Kubernetes Operator를 배포 수 있습니다.
helm install enterprise-operator mongodb/enterprise-operator \ --namespace mongodb \ --create-namespace
Kubernetes 연산자 문제를 해결하려면 Kubernetes 연산자 의 로그 검토 및 기타 문제 해결 주제를 참조하세요.
중요
Kubernetes Operator 또는 네임스페이스 를 제거해야 하는 경우 먼저 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 를 업그레이드한 후 다음을 수행할 수 있습니다.