This guide walks you through the steps to install the MongoDB Kubernetes Operator in a specific namespace using Helm.
- Kubernetes Cluster: Ensure you have access to a running Kubernetes cluster.
- Helm: Make sure Helm is installed. If not, you can install it following the Helm Installation Guide.
- kubectl: Ensure
kubectl
is installed and properly configured to interact with your Kubernetes cluster. - MongoDB Helm Chart Repository: You need to add the MongoDB Helm chart repository.
Add the MongoDB chart repository to your Helm configuration:
helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update
Create the namespace where the MongoDB Operator will be installed:
kubectl create namespace <your-namespace>
Replace <your-namespace>
with the desired namespace.
Install the MongoDB Kubernetes Operator into the specified namespace using Helm:
helm install mongodb-operator mongodb/community-operator \
--namespace <your-namespace>
Parameters:
mongodb-operator
: The Helm release name (changeable if desired).mongodb/community-operator
: The Helm chart name from the MongoDB repository.--namespace <your-namespace>
: Specifies the namespace for installation.
To confirm the installation, check the pods in the target namespace:
kubectl get pods -n <your-namespace>
If customization is needed (e.g., resource limits, RBAC settings), create a values.yaml
file with the desired configurations:
# values.yaml
namespace: <your-namespace>
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 250m
memory: 256Mi
rbac:
create: true
Install the chart using the customized values.yaml
file:
- Check the Helm release in the specified namespace:
helm list -n <your-namespace>
- Inspect the logs of the MongoDB Operator pod:
kubectl logs -n <your-namespace> <operator-pod-name>