- Install and Configure the Kubernetes Operator >
- Install the MongoDB Enterprise Kubernetes Operator
Install the MongoDB Enterprise Kubernetes Operator¶
Prerequisites and Considerations¶
Before you install the Kubernetes Operator, make sure you plan for your installation:
- Choose a deployment topology.
- Read the Considerations.
- Complete the Prerequisites.
Note
This tutorial presumes some knowledge of Kubernetes, but does link to relevant Kubernetes documentation where possible. If you are unfamiliar with Kubernetes, please review that documentation first.
Procedure¶
The install procedure varies based on how you want to configure your environment:
- Kubernetes
- OpenShift
- Online using kubectl
- Online using Helm
- Offline using Helm and Docker
Use the same namespace throughout
The following examples assume that you created a namespace
using the default Kubernetes Operator namespace of mongodb
.
If you specified a different label for your namespace when
you created it, change all
values for metadata.namespace
to that namespace.
To change the label for the namespace for the following
deployment to production
, edit all values for
metadata.namespace
in mongodb-enterprise.yaml
:
Change to the directory in which you cloned the repository.¶
Install the CustomResourceDefinitions for MongoDB deployments using the following kubectl
command:¶
Invoke the following kubectl
command:
Optional: Customize the Kubernetes Operator YAML before installing 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.
You can install the Kubernetes Operator with Helm 3.
Change to the directory in which you cloned the repository.¶
Install the Kubernetes Operator using the following helm
command:¶
Invoke the following helm
command:
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
You can install the Kubernetes Operator with Helm 3.
To install the Kubernetes Operator on a host not connected to the Internet:
Use docker
to request the files on a host connected to the Internet.¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Export the Kubernetes Operator images as .tar
archive files:¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Copy these .tar
files to the host running the Kubernetes docker
daemon.¶
Import the .tar
files into docker
.¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Install the Kubernetes Operator with modified pull policy values using the following helm
command:¶
Invoke the following helm
command:
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
- Online using oc
- Online using Helm
- Offline using Helm and Docker
Use the same namespace throughout
The following examples assume that you created a namespace
using the default Kubernetes Operator namespace of mongodb
.
If you specified a different label for your namespace when
you created it, change all
values for metadata.namespace
to that namespace.
To change the label for the namespace for the following
deployment to production
, edit all values for
metadata.namespace
in mongodb-enterprise-openshift.yaml
:
Change to the directory in which you cloned the repository.¶
Install 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 installing 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.
You can install the Kubernetes Operator with Helm 3.
Change to the directory in which you cloned the repository.¶
Add your OpenShift Pull Secret to the OpenShift Values file.¶
Add the name of your <openshift-pull-secret>
to the
registry.imagePullSecrets
setting in the
helm_chart/values-openshift.yaml
file:
Install the Kubernetes Operator using helm
.¶
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 helm
command:
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
You can install the Kubernetes Operator with Helm 3.
To install the Kubernetes Operator on a host not connected to the Internet:
Use docker
to request the files on a host connected to the Internet.¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Export the Kubernetes Operator images as .tar
archive files:¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Copy these .tar
files to the host running the Kubernetes docker
daemon.¶
Import the .tar
files into docker
.¶
Replace the following values:
<op-version>
with the Kubernetes Operator version you’re installing<om-version>
with the Ops Manager version you’re installing.<db-version>
with the version of the MongoDB Enterprise Database image that you want to use.
See also
Add your OpenShift Pull Secret to the OpenShift Values file.¶
Add the name of your <openshift-pull-secret>
to the
registry.imagePullSecrets
setting in the
helm_chart/values-openshift.yaml
file:
Install the Kubernetes Operator with modified pull policy values.¶
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 helm
command:
To learn about optional Kubernetes Operator installation settings, see Operator Helm Installation Settings.
Verify the Installation¶
To verify that the Kubernetes Operator installed correctly, run the following command and verify the output:
By default, deployments exist in the mongodb
namespace. If the
following error message appears, ensure you use the correct
namespace:
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.
Next Steps¶
After installing the MongoDB Enterprise Kubernetes Operator, you can: