From 6cf47aaefdb71677edaef00a8b2305e6b6ed059a Mon Sep 17 00:00:00 2001 From: Melissa Mahoney Date: Mon, 27 Apr 2020 22:44:57 -0700 Subject: [PATCH 1/2] (DOCSP-9305): Simple CRD/install instructions --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6681e8cf8..c79ed7538 100644 --- a/README.md +++ b/README.md @@ -6,20 +6,73 @@ This is a Kubernetes Operator (https://coreos.com/operators/) which deploys Mong 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 may be looking for the [MongoDB Enterprise Operator for Kubernetes](https://github.com/mongodb/mongodb-enterprise-kubernetes). +If you are a MongoDB Enterprise customer, or need Enterprise features such as Backup, you can use the [MongoDB Enterprise Operator for Kubernetes](https://github.com/mongodb/mongodb-enterprise-kubernetes). +## Installation +### Prerequisites +Before you install the MongoDB Community Kubernetes Operator, you must: -## Licensing +1. Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +2. Install [kind](https://kind.sigs.k8s.io/) +3. Clone this repository. + ``` + git clone https://github.com/mongodb/mongodb-kubernetes-operator.git + ``` -The source code of this Operator is available under the Apache v2 license. +### Installing the MongoDB Community Kubernetes Operator -The MongoDB Agent binary in the agent/ directory may be used under the "Free for Commercial Use" license found in agent/LICENSE. +The MongoDB Community Kubernetes Operator is a collection of [Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) 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](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/). + 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 `default` namespace: + ``` + kubectl create -f deploy + ``` + To install the Operator in a different namespace, append the `--namespace ` option. + b. Verify that the Operator installed successsfully: + ``` + kubectl get pods + ``` + +## 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 + ``` +2. Verify that the MongoDB resource deployed: + ``` + kubectl get mongodb + ``` ## Contributing Please file issues before filing PRs. For PRs to be accepted, contributors must sign our [CLA](https://www.mongodb.com/legal/contributor-agreement). Reviewers, please ensure that the CLA has been signed by referring to [the contributors tool](https://contributors.corp.mongodb.com/) (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. From e827cc7d9340a04a752e5b085492aee13ab128f0 Mon Sep 17 00:00:00 2001 From: Melissa Mahoney Date: Tue, 28 Apr 2020 14:21:12 -0700 Subject: [PATCH 2/2] Tech review --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c79ed7538..92e4f6196 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -This is a Kubernetes Operator (https://coreos.com/operators/) which deploys MongoDB Community into Kubernetes clusters. +This is a [Kubernetes Operator](https://coreos.com/operators/) which deploys MongoDB Community into Kubernetes clusters. This codebase is currently _pre-alpha_, and is not ready for use. @@ -14,8 +14,9 @@ If you are a MongoDB Enterprise customer, or need Enterprise features such as Ba Before you install the MongoDB Community Kubernetes Operator, you must: -1. Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -2. Install [kind](https://kind.sigs.k8s.io/) +1. Install [kubectl](https://kubernetes.io/docs/tasks/tools/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](https://kubernetes.io/docs/setup). For testing, MongoDB recommends [Kind](https://kind.sigs.k8s.io/). 3. Clone this repository. ``` git clone https://github.com/mongodb/mongodb-kubernetes-operator.git @@ -23,7 +24,7 @@ Before you install the MongoDB Community Kubernetes Operator, you must: ### Installing the MongoDB Community Kubernetes Operator -The MongoDB Community Kubernetes Operator is a collection of [Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) and a controller. +The MongoDB Community Kubernetes Operator is a [Custom Resource Definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) and a controller. To install the MongoDB Community Kubernetes Operator: @@ -38,14 +39,13 @@ To install the MongoDB Community Kubernetes Operator: kubectl get crd/mongodb.mongodb.com ``` 3. Install the Operator. - a. Invoke the following `kubectl` command to install the Operator in the `default` namespace: + a. Invoke the following `kubectl` command to install the Operator in the specified namespace: ``` - kubectl create -f deploy + kubectl create -f deploy --namespace ``` - To install the Operator in a different namespace, append the `--namespace ` option. b. Verify that the Operator installed successsfully: ``` - kubectl get pods + kubectl get pods --namespace ``` ## Usage @@ -58,11 +58,11 @@ To deploy your first replica set: 1. Invoke the following `kubectl` command: ``` - kubectl apply -f deploy/crds/mongodb.com_v1_mongodb_cr.yaml + kubectl apply -f deploy/crds/mongodb.com_v1_mongodb_cr.yaml --namespace ``` 2. Verify that the MongoDB resource deployed: ``` - kubectl get mongodb + kubectl get mongodb --namespace ``` ## Contributing