Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save guptaashwanee/d3d5454f508ea361c7186700fb776d25 to your computer and use it in GitHub Desktop.
Save guptaashwanee/d3d5454f508ea361c7186700fb776d25 to your computer and use it in GitHub Desktop.
Install MongoDB Kubernetes Operator

MongoDB Kubernetes Operator Installation Using Helm

This guide walks you through the steps to install the MongoDB Kubernetes Operator in a specific namespace using Helm.


Prerequisites

  • 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.

Step-by-Step Installation

1. Add the MongoDB Helm Repository

Add the MongoDB chart repository to your Helm configuration:

helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update

2. Create a Namespace(optional)

Create the namespace where the MongoDB Operator will be installed:

kubectl create namespace <your-namespace>

Replace <your-namespace> with the desired namespace.

3. Install the MongoDB Operator

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.

4. Verify the Installation

To confirm the installation, check the pods in the target namespace:

kubectl get pods -n <your-namespace>

5. Customizing the Installation

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:

6. Troubleshooting

  • 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment