- Install and Configure the Kubernetes Operator >
- Upgrade the Kubernetes Operator from Prior Versions >
- Upgrade the MongoDB Enterprise Kubernetes Operator
Upgrade the MongoDB Enterprise Kubernetes Operator¶
The following procedure outlines how to upgrade the Kubernetes Operator to its latest version.
Upgrading to version 1.3.0 and newer
Starting in MongoDB Enterprise Kubernetes Operator version 1.3.0, you can only have one MongoDB resource per project. To learn how to migrate your project to a single-cluster configuration, see Migrate to One Resource per Project (Required for Version 1.3.0).
The following steps depend on how your environment is configured:
- Kubernetes
- OpenShift
- Online using kubectl
- Online using Helm
- Offline using Helm and Docker
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
Invoke the following kubectl
command:
Optional: Customize the Kubernetes Operator YAML before upgrading it.¶
You might need to add one or more optional settings.
To learn about optional Kubernetes Operator installation settings, see Operator kubectl and oc Installation Settings.
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Upgrade to the new version of the Kubernetes Operator.¶
Invoke the following kubectl
command:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
kubectl apply
command to upgrade to the new version of the Kubernetes Operator.
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
Invoke the following kubectl
command:
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Optional: Customize your Helm Chart before upgrading it.¶
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
Upgrade the Kubernetes Operator.¶
Invoke the following helm
command:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
helm
command to upgrade to the new version of the Kubernetes Operator.
To upgrade the Kubernetes Operator on a host not connected to the Internet:
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
Invoke the following kubectl
command:
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Optional: Customize your Helm Chart before upgrading it.¶
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
Upgrade to the latest version of the Kubernetes Operator.¶
Invoke the following helm
command to upgrade with modified pull
policy values:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
helm
command to upgrade to the new version of the Kubernetes Operator.
- Online using oc
- Online using Helm
- Offline using Helm and Docker
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
OpenShift 3.11 or earlier
If you run OpenShift 3.11 or earlier, you must first manually edit the CustomResourceDefinitions to remove subresources. In each CustomResourceDefinition, remove the following option:
Invoke the following oc
command:
Optional: Customize the Kubernetes Operator YAML before upgrading it.¶
You must add your
<openshift-pull-secret>
to theServiceAccount
definitions:You might need to add one or more optional settings.
To learn about optional Kubernetes Operator installation settings, see Operator kubectl and oc Installation Settings.
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Upgrade to the new version of the Kubernetes Operator.¶
Invoke the following oc
command:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
oc apply
command to upgrade to the new version of the Kubernetes Operator.
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
OpenShift 3.11 or earlier
If you run OpenShift 3.11 or earlier, you must first manually edit the CustomResourceDefinitions to remove subresources. In each CustomResourceDefinition, remove the following option:
Invoke the following oc
command:
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Optional: Customize your Helm Chart before upgrading it.¶
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
Upgrade the Kubernetes Operator.¶
Invoke the following helm
command:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
helm
command to upgrade to the new version of the Kubernetes Operator.
To upgrade the Kubernetes Operator on a host not connected to the Internet:
Change to the directory in which you cloned the repository.¶
Upgrade the CustomResourceDefinitions for MongoDB deployments.¶
OpenShift 3.11 or earlier
If you run OpenShift 3.11 or earlier, you must first manually edit the CustomResourceDefinitions to remove subresources. In each CustomResourceDefinition, remove the following option:
Invoke the following oc
command:
If all of the following are true, provide the name of the ConfigMap for your TLS CA with the spec.security.tls.ca
setting:¶
- You secure your Ops Manager deployment using TLS certificates.
- You sign your TLS certificates using a custom CA.
- You want to upgrade the Kubernetes Operator from a version earlier than 1.7.1 to version 1.7.1 or later.
Use the following command to add the
spec.security.tls.ca
setting to your Ops Manager resource
definition:
Optional: Customize your Helm Chart before upgrading it.¶
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
Upgrade to the latest version of the Kubernetes Operator.¶
Invoke the following helm
command with
modified pull policy values:
Troubleshooting
You might receive the following error when you upgrade the Kubernetes Operator:
To resolve this error:
Remove the old Kubernetes Operator deployment.
Note
Removing the Kubernetes Operator deployment doesn’t affect the lifecycle of your MongoDB resources.
Repeat the
helm
command to upgrade to the new version of the Kubernetes Operator.
To troubleshoot your Kubernetes Operator, see Review Logs from the Kubernetes Operator.
Important
If you need to remove the Kubernetes Operator or the namespace, you first must remove MongoDB resources.