mongodb-kubernetes-operator

module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2020 License: Apache-2.0

README

MongoDB Community Kubernetes Operator

This is a Kubernetes Operator which deploys MongoDB Community into Kubernetes clusters.

This codebase is currently pre-alpha, and is not ready for use.

If you are a MongoDB Enterprise customer, or need Enterprise features such as Backup, you can use the MongoDB Enterprise Operator for Kubernetes.

Installation

Prerequisites

Before you install the MongoDB Community Kubernetes Operator, you must:

  1. Install kubectl.
  2. Have a Kubernetes solution available to use. If you need a Kubernetes solution, see the Kubernetes documentation on picking the right solution. For testing, MongoDB recommends Kind.
  3. Clone this repository.
    git clone https://github.com/mongodb/mongodb-kubernetes-operator.git
    
Installing the MongoDB Community Kubernetes Operator

The MongoDB Community Kubernetes Operator is a Custom Resource Definition and a controller.

To install the MongoDB Community Kubernetes Operator:

  1. Change to the directory in which you cloned the repository.
  2. Install the Custom Resource Definitions. a. Invoke the following kubectl command:
    kubectl create -f deploy/crds/mongodb.com_mongodb_crd.yaml
    
    b. Verify that the Custom Resource Definitions installed successfully:
    kubectl get crd/mongodb.mongodb.com
    
  3. Install the Operator. a. Invoke the following kubectl command to install the Operator in the specified namespace:
    kubectl create -f deploy --namespace <my-namespace>
    
    b. Verify that the Operator installed successsfully:
    kubectl get pods --namespace <my-namespace>
    

Usage

The /deploy/crds directory contains example MongoDB resources that you can modify and deploy.

Deploying a MongoDB Resource

To deploy your first replica set:

  1. Invoke the following kubectl command:
    kubectl apply -f deploy/crds/mongodb.com_v1_mongodb_cr.yaml --namespace <my-namespace>
    
  2. Verify that the MongoDB resource deployed:
    kubectl get mongodb --namespace <my-namespace>
    

Contributing

Please file issues before filing PRs. For PRs to be accepted, contributors must sign our CLA.

Reviewers, please ensure that the CLA has been signed by referring to the contributors tool (internal link).

License

The source code of this Operator is available under the Apache v2 license.

The MongoDB Agent binary in the agent/ directory may be used under the "Free for Commercial Use" license found in agent/LICENSE.

Directories

Path Synopsis
cmd
pkg
apis/mongodb
Package mongodb contains mongodb API versions.
Package mongodb contains mongodb API versions.
apis/mongodb/v1
Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodb.com Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodb.com
Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodb.com Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodb.com
scripts
ci
test
e2e

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL