- Install and Configure the Kubernetes Operator >
- Upgrade the Kubernetes Operator from Prior Versions >
- Upgrade from Operator Version 0.10 or Later
Upgrade from Operator Version 0.10 or Later¶
On this page
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).
Procedure¶
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 using the following kubectl
command:¶
You can edit the Operator YAML file to further customize your Operator before upgrading it.¶
Open your
mongodb-enterprise.yaml
in your preferred text editor.You may need to add one or more of the following options:
Environment Variable When to Use OPERATOR_ENV
Label for the Operator’s deployment environment. The
env
value affects default timeouts and the format and level of logging.If OPERATOR_ENV
isLog Level is set to Log Format is set to dev
debug text prod
info json Accepted values are:
dev
,prod
.Default value is:
prod
.You can set the following pair of values:
Example
WATCH_NAMESPACE
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
*
means all namespaces and requires the ClusterRole assigned to themongodb-enterprise-operator
ServiceAccount which is the ServiceAccount used to run the Kubernetes Operator.Default value is:
<metadata.namespace>
.Important
To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform.
You can set the following pair of values:
Example
OPS_MANAGER_IMAGE_REPOSITORY
URL of the repository from which the image for an Ops Manager resource is downloaded.
Default value is:
quay.io/mongodb/mongodb-enterprise-ops-manager
Example
OPS_MANAGER_IMAGE_PULL_POLICY
Pull policy for the image deployed to an Ops Manager resource.
Accepted values are:
Always
,IfNotPresent
,Never
Default value is:
Always
Example
MANAGED_SECURITY_CONTEXT
Flag that determines if the Kubernetes Operator inherits the
securityContext
settings that your Kubernetes cluster manages.Set this field to
true
if you want to run the Kubernetes Operator in OpenShift or in a restrictive environment.Default value is
false
.Example
Upgrade the Kubernetes Operator using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the values.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Set this field to Default value is Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
To upgrade the Kubernetes Operator on a host not connected to the Internet, you have two options, you can download the Kubernetes Operator files from either:
- The Internet
- Another Host
Upgrade the latest version of the Kubernetes Operator with modified pull policy values using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the values.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Set this field to Default value is Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
Upgrade the latest version of the Kubernetes Operator with modified pull policy values using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the values.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Set this field to Default value is Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
- 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 using the following oc
command:¶
You can edit the Operator YAML file to further customize your Operator before upgrading it.¶
Open your
mongodb-enterprise-openshift.yaml
in your preferred text editor.You must add your
<openshift-pull-secret>
to theServiceAccount
definitions:You may need to add one or more of the following options:
Environment Variable | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
OPERATOR_ENV |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: You can set the following pair of values: Example |
|||||||||
WATCH_NAMESPACE |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. You can set the following pair of values: Example |
|||||||||
OPS_MANAGER_IMAGE_REPOSITORY |
URL of the repository from which the image for an Ops Manager resource is downloaded. Default value is:
Example |
|||||||||
OPS_MANAGER_IMAGE_PULL_POLICY |
Pull policy for the image deployed to an Ops Manager resource. Accepted values are: Default value is: Example |
|||||||||
MANAGED_SECURITY_CONTEXT |
Flag that determines if the Kubernetes Operator inherits the
For OpenShift, Default value is Example |
Upgrade the Kubernetes Operator using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the
values-openshift.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
registry.imagePullSecrets |
secret that contains the credentials required to pull imagePullSecrets from the repository. Important This setting is mandatory for OpenShift installs. You must either define it in this file or pass it when you install the Kubernetes Operator using Helm. Example |
|||||||||
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Default value is For OpenShift, Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
To upgrade the Kubernetes Operator on a host not connected to the Internet, you have two options, you can download the Kubernetes Operator files from either:
- The Internet
- Another Host
Upgrade the latest version of the Kubernetes Operator with modified pull policy values using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the
values-openshift.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
registry.imagePullSecrets |
secret that contains the credentials required to pull imagePullSecrets from the repository. Important This setting is mandatory for OpenShift installs. You must either define it in this file or pass it when you install the Kubernetes Operator using Helm. Example |
|||||||||
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Default value is For OpenShift, Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
Upgrade the latest version of the Kubernetes Operator with modified pull policy values using the following helm
command:¶
You can customize your Helm Chart before installing it. To modify it,
add one or more of the following options to the
values-openshift.yaml
file:
Setting | When to Use | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
registry.imagePullSecrets |
secret that contains the credentials required to pull imagePullSecrets from the repository. Important This setting is mandatory for OpenShift installs. You must either define it in this file or pass it when you install the Kubernetes Operator using Helm. Example |
|||||||||
namespace |
To use a different namespace, you need to specify that
Default value is: Example |
|||||||||
managedSecurityContext |
Flag that determines if the Kubernetes Operator inherits the
Default value is For OpenShift, Example |
|||||||||
operator.env |
Label for the Operator’s deployment environment. The
Accepted values are: Default value is: Example |
|||||||||
operator.watchNamespace |
Namespace that the Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Operator’s ServiceAccount can access that different namespace.
Default value is: Important To watch Ops Manager and MongoDB Kubernetes resources in a different namespace to which you deploy the Kubernetes Operator, see Kubernetes Operator Deployment Scopes for values you must use and additional steps you might have to perform. Example |
Note
You can also pass these values as options when you apply the Helm Chart:
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.