Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation][Add] Added installation steps in the documentation (#25)
* Updated documentation with installation steps Signed-off-by: iamabhishek-dubey <abhishekbhardwaj510@gmail.com>
- Loading branch information
1 parent
6f37901
commit 39badfa
Showing
6 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "Getting Started" | ||
linkTitle: "Getting Started" | ||
weight: 2 | ||
description: > | ||
For guide to install, setup and manage MongoDB Operator | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: "Installation" | ||
weight: 2 | ||
linkTitle: "Installation" | ||
description: > | ||
MongoDB Operator installation, upgrade guide | ||
--- | ||
|
||
MongoDB operator is based on the CRD framework of Kubernetes, for more information about the CRD framework please refer to the [official documentation](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/). In a nutshell, CRD is a feature through which we can develop our own custom API's inside Kubernetes. | ||
|
||
The API versions for MongoDB Operator available are:- | ||
|
||
- MongoDB | ||
- MongoDBCluster | ||
|
||
MongoDB Operator requires a Kubernetes cluster of version >=1.16.0. If you have just started with the CRD and Operators, its highly recommended using the latest version of Kubernetes. | ||
|
||
Setup of MongoDB operator can be easily done by using simple [helm](https://helm.sh) and [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) commands. | ||
|
||
{{< alert title="Note" >}}The recommded of way of installation is helm.{{< /alert >}} | ||
|
||
## Helm | ||
|
||
The setup can be done by using helm. The mongodb-operator can easily get installed using helm commands. | ||
|
||
```shell | ||
# Add the helm chart | ||
$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/ | ||
... | ||
"ot-helm" has been added to your repositories | ||
``` | ||
|
||
```shell | ||
# Deploy the MongoDB Operator | ||
$ helm upgrade mongodb-operator ot-helm/mongdb-operator \ | ||
--install --namespace ot-operators --install | ||
... | ||
Release "mongodb-operator" does not exist. Installing it now. | ||
NAME: mongodb-operator | ||
LAST DEPLOYED: Sun Jan 9 23:05:13 2022 | ||
NAMESPACE: ot-operators | ||
STATUS: deployed | ||
REVISION: 1 | ||
``` | ||
|
||
Once the helm chart is deployed, we can test the status of operator pod by using: | ||
|
||
```shell | ||
# Testing Operator | ||
$ helm test mongodb-operator --namespace ot-operators | ||
... | ||
NAME: mongodb-operator | ||
LAST DEPLOYED: Sun Jan 9 23:05:13 2022 | ||
NAMESPACE: ot-operators | ||
STATUS: deployed | ||
REVISION: 1 | ||
TEST SUITE: mongodb-operator-test-connection | ||
Last Started: Sun Jan 9 23:05:54 2022 | ||
Last Completed: Sun Jan 9 23:06:01 2022 | ||
Phase: Succeeded | ||
``` | ||
|
||
## Kubectl | ||
|
||
In any case using helm chart is not a possiblity, the MongoDB operator can be installed by `kubectl` commands as well. | ||
|
||
As a first step, we need to setup a namespace and then deploy the CRD definitions inside Kubernetes. | ||
|
||
```shell | ||
$ kubectl create namespace ot-operators | ||
$ kubectl apply -f https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/config/crd/bases/opstreelabs.in_mongodbs.yaml | ||
$ kubectl apply -f https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/config/crd/bases/opstreelabs.in_mongodbclusters.yaml | ||
``` | ||
|
||
Once we have namespace in the place, we need to setup the RBAC related stuff like:- **ClusterRoleBindings**, **ClusterRole**, **Serviceaccount**. | ||
|
||
```shell | ||
$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/mongodb-operator/main/config/rbac/service_account.yaml | ||
$ kubectl apply -f https://raw.githubusercontent.com/OT-CONTAINER-KIT/mongodb-operator/main/config/rbac/role.yaml | ||
$ kubectl apply -f https://github.com/OT-CONTAINER-KIT/mongodb-operator/blob/main/config/rbac/role_binding.yaml | ||
``` | ||
|
||
As last part of the setup, now we can deploy the MongoDB Operator as deployment of Kubernetes. | ||
|
||
```shell | ||
$ kubectl apply -f https://github.com/OT-CONTAINER-KIT/mongodb-operator/raw/main/config/manager/manager.yaml | ||
``` |
7 changes: 7 additions & 0 deletions
7
docs/content/en/docs/Getting Started/replicaset-cluster-setup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "Replication Setup" | ||
weight: 4 | ||
linkTitle: "Replication Setup" | ||
description: > | ||
MongoDB database replication setup guide | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: "Standalone Setup" | ||
weight: 3 | ||
linkTitle: "Standalone Setup" | ||
description: > | ||
MongoDB database standalone setup guide | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters