Skip to content

Commit

Permalink
fix mg
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjid133 committed Aug 3, 2018
1 parent ce49d94 commit 8a1b4b1
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 55 deletions.
6 changes: 3 additions & 3 deletions docs/examples/etcd/snapshot/demo-4.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kubedb.com/v1alpha1
kind: MongoDB
kind: Etcd
metadata:
name: mgo-scheduled
name: etcd-scheduled
namespace: demo
spec:
version: "3.4"
Expand All @@ -14,6 +14,6 @@ spec:
storage: 50Mi
backupSchedule:
cronExpression: "@every 1m"
storageSecretName: mg-snap-secret
storageSecretName: etcd-snap-secret
gcs:
bucket: restic
2 changes: 1 addition & 1 deletion docs/guides/etcd/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: CLI | KubeDB
menu:
docs_0.8.0:
identifier: etcd-cli-mongodb
identifier: etcd-cli
name: Cli
parent: etcd-guides
weight: 45
Expand Down
54 changes: 27 additions & 27 deletions docs/guides/etcd/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu:
docs_0.8.0:
identifier: etcd-cli-cli
name: Quickstart
parent: etcd-cli-mongodb
parent: etcd-cli
weight: 10
menu_name: docs_0.8.0
section_menu_id: guides
Expand Down Expand Up @@ -44,7 +44,7 @@ To learn about various options of `create` command, please visit [here](/docs/re

### How to List Objects

`kubedb get` command allows users to list or find any KubeDB object. To list all MongoDB objects in `default` namespace, run the following command:
`kubedb get` command allows users to list or find any KubeDB object. To list all Etcd objects in `default` namespace, run the following command:

```console
$ kubedb get etcd
Expand Down Expand Up @@ -112,17 +112,17 @@ You can print labels with objects. The following command will list all Snapshots
```console
$ kubedb get snap --show-labels
NAME DATABASE STATUS AGE LABELS
mongodb-demo-20170605-073557 etcd/mongodb-demo Succeeded 11m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 etcd/mongodb-demo Succeeded 1h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
etcd-demo-20170605-073557 etcd/etcd-demo Succeeded 11m kubedb.com/kind=Etcd,kubedb.com/name=etcd-demo
snapshot-20171212-114700 etcd/etcd-demo Succeeded 1h kubedb.com/kind=Etcd,kubedb.com/name=etcd-demo
```

You can also filter list using `--selector` flag.

```console
$ kubedb get snap --selector='kubedb.com/kind=MongoDB' --show-labels
$ kubedb get snap --selector='kubedb.com/kind=Etcd' --show-labels
NAME DATABASE STATUS AGE LABELS
mongodb-demo-20171212-073557 etcd/mongodb-demo Succeeded 14m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 etcd/mongodb-demo Succeeded 2h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
etcd-demo-20171212-073557 etcd/etcd-demo Succeeded 14m kubedb.com/kind=Etcd,kubedb.com/name=etcd-demo
snapshot-20171212-114700 etcd/etcd-demo Succeeded 2h kubedb.com/kind=Etcd,kubedb.com/name=etcd-demo
```

To print only object name, run the following command:
Expand All @@ -138,7 +138,7 @@ To learn about various options of `get` command, please visit [here](/docs/refer

### How to Describe Objects

`kubedb describe` command allows users to describe any KubeDB object. The following command will describe MongoDB database `etcdb-demo` with relevant information.
`kubedb describe` command allows users to describe any KubeDB object. The following command will describe Etcd database `etcdb-demo` with relevant information.

```console
$ kubedb describe etcd etcdb-demo
Expand Down Expand Up @@ -190,13 +190,13 @@ To hide details about StatefulSet & Service, use flag `--show-workload=false`
To hide details about Secret, use flag `--show-secret=false`
To hide events on KubeDB object, use flag `--show-events=false`

To describe all MongoDB objects in `default` namespace, use following command
To describe all Etcd objects in `default` namespace, use following command

```console
$ kubedb describe etcd
```

To describe all MongoDB objects from every namespace, provide `--all-namespaces` flag.
To describe all Etcd objects from every namespace, provide `--all-namespaces` flag.

```console
$ kubedb describe etcd --all-namespaces
Expand All @@ -208,7 +208,7 @@ To describe all KubeDB objects from every namespace, use the following command:
$ kubedb describe all --all-namespaces
```

You can also describe KubeDb objects with matching labels. The following command will describe all MongoDB objects with specified labels from every namespace.
You can also describe KubeDb objects with matching labels. The following command will describe all Etcd objects with specified labels from every namespace.

```console
$ kubedb describe etcd --all-namespaces --selector='group=dev'
Expand All @@ -220,7 +220,7 @@ To learn about various options of `describe` command, please visit [here](/docs/

`kubedb edit` command allows users to directly edit any KubeDB object. It will open the editor defined by _KUBEDB_EDITOR_, or _EDITOR_ environment variables, or fall back to `nano`.

Lets edit an existing running MongoDB object to setup [Scheduled Backup](/docs/guides/mongodb/snapshot/scheduled-backup.md). The following command will open MongoDB `etcdb-demo` in editor.
Lets edit an existing running Etcd object to setup [Scheduled Backup](/docs/guides/etcd/snapshot/scheduled-backup.md). The following command will open Etcd `etcdb-demo` in editor.

```console
$ kubedb edit etcd etcdb-demo
Expand All @@ -232,7 +232,7 @@ $ kubedb edit etcd etcdb-demo
# gcs:
# bucket: bucket-name

etcd "mongodb-demo" edited
etcd "etcd-demo" edited
```

#### Edit Restrictions
Expand All @@ -245,7 +245,7 @@ Various fields of a KubeDb object can't be edited using `edit` command. The foll
- metadata.namespace
- status

If StatefulSets exists for a MongoDB database, following fields can't be modified as well.
If StatefulSets exists for a Etcd database, following fields can't be modified as well.

- spec.version
- spec.databaseSecret
Expand All @@ -259,30 +259,30 @@ To learn about various options of `edit` command, please visit [here](/docs/refe

### How to Delete Objects

`kubedb delete` command will delete an object in `default` namespace by default unless namespace is provided. The following command will delete a MongoDB `mongodb-dev` in default namespace
`kubedb delete` command will delete an object in `default` namespace by default unless namespace is provided. The following command will delete a Etcd `etcd-dev` in default namespace

```console
$ kubedb delete mongodb mongodb-dev
mongodb "mongodb-dev" deleted
$ kubedb delete etcd etcd-dev
etcd "etcd-dev" deleted
```

You can also use YAML files to delete objects. The following command will delete a mongodb using the type and name specified in `mongodb.yaml`.
You can also use YAML files to delete objects. The following command will delete a etcd using the type and name specified in `etcd.yaml`.

```console
$ kubedb delete -f mongodb-demo.yaml
mongodb "mongodb-dev" deleted
$ kubedb delete -f etcd-demo.yaml
etcd "etcd-dev" deleted
```

`kubedb delete` command also takes input from `stdin`.

```console
cat mongodb-demo.yaml | kubedb delete -f -
cat etcd-demo.yaml | kubedb delete -f -
```

To delete database with matching labels, use `--selector` flag. The following command will delete mongodb with label `mongodb.kubedb.com/name=mongodb-demo`.
To delete database with matching labels, use `--selector` flag. The following command will delete etcd with label `etcd.kubedb.com/name=etcd-demo`.

```console
$ kubedb delete mongodb -l mongodb.kubedb.com/name=mongodb-demo
$ kubedb delete etcd -l etcd.kubedb.com/name=etcd-demo
```

To learn about various options of `delete` command, please visit [here](/docs/reference/kubedb_delete.md).
Expand All @@ -293,15 +293,15 @@ You can use Kubectl with KubeDB objects like any other CRDs. Below are some comm

```console
# List objects
$ kubectl get mongodb
$ kubectl get mongodb.kubedb.com
$ kubectl get etcd
$ kubectl get etcd.kubedb.com

# Delete objects
$ kubectl delete mongodb <name>
$ kubectl delete etcd <name>
```

## Next Steps

- Learn how to use KubeDB to run a MongoDB database [here](/docs/guides/mongodb/README.md).
- Learn how to use KubeDB to run a Etcd database [here](/docs/guides/etcd/README.md).
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions docs/guides/mongodb/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: CLI | KubeDB
menu:
docs_0.8.0:
identifier: etcd-cli-mongodb
identifier: mg-cli-mongodb
name: Cli
parent: etcd-guides
parent: mg-mongodb-guides
weight: 45
menu_name: docs_0.8.0
---
44 changes: 22 additions & 22 deletions docs/guides/mongodb/cli/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: CLI | KubeDB
menu:
docs_0.8.0:
identifier: etcd-cli-cli
identifier: mg-cli-cli
name: Quickstart
parent: etcd-cli-mongodb
parent: mg-cli-mongodb
weight: 10
menu_name: docs_0.8.0
section_menu_id: guides
Expand All @@ -16,14 +16,14 @@ section_menu_id: guides

## KubeDB CLI

KubeDB comes with its own cli. It is called `kubedb` cli. `kubedb` can be used to manage any Etcd object. `kubedb` cli also performs various validations to improve ux. To install KubeDB cli on your workstation, follow the steps [here](/docs/setup/install.md).
KubeDB comes with its own cli. It is called `kubedb` cli. `kubedb` can be used to manage any KubeDB object. `kubedb` cli also performs various validations to improve ux. To install KubeDB cli on your workstation, follow the steps [here](/docs/setup/install.md).

### How to Create objects

`kubedb create` creates a database CRD object in `default` namespace by default. Following command will create a Etcd object as specified in `etcd.yaml`.
`kubedb create` creates a database CRD object in `default` namespace by default. Following command will create a MongoDB object as specified in `mongodb.yaml`.

```console
$ kubedb create -f etcd-demo.yaml
$ kubedb create -f mongodb-demo.yaml
mongodb "mongodb-demo" created
```

Expand Down Expand Up @@ -99,21 +99,21 @@ To list all KubeDB objects, use following command:
```console
$ kubedb get all -o wide
NAME VERSION STATUS AGE
etcd/mongodb-demo 3.4 Running 3h
etcd/mongodb-dev 3.4 Running 3h
etcd/mongodb-prod 3.4 Running 3h
etcd/mongodb-qa 3.4 Running 3h
mg/mongodb-demo 3.4 Running 3h
mg/mongodb-dev 3.4 Running 3h
mg/mongodb-prod 3.4 Running 3h
mg/mongodb-qa 3.4 Running 3h
NAME DATABASE BUCKET STATUS AGE
snap/mongodb-demo-20170605-073557 etcd/mongodb-demo gs:bucket-name Succeeded 9m
snap/snapshot-20171212-114700 etcd/mongodb-demo gs:bucket-name Succeeded 1h
snap/mongodb-demo-20170605-073557 mg/mongodb-demo gs:bucket-name Succeeded 9m
snap/snapshot-20171212-114700 mg/mongodb-demo gs:bucket-name Succeeded 1h
```

Flag `--output=wide` is used to print additional information.

List command supports short names for each object types. You can use it like `kubedb get <short-name>`. Below are the short name for KubeDB objects:

- MongoDB: `etcd`
- MongoDB: `mg`
- Snapshot: `snap`
- DormantDatabase: `drmn`

Expand All @@ -122,17 +122,17 @@ You can print labels with objects. The following command will list all Snapshots
```console
$ kubedb get snap --show-labels
NAME DATABASE STATUS AGE LABELS
mongodb-demo-20170605-073557 etcd/mongodb-demo Succeeded 11m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 etcd/mongodb-demo Succeeded 1h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
mongodb-demo-20170605-073557 mg/mongodb-demo Succeeded 11m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 mg/mongodb-demo Succeeded 1h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
```

You can also filter list using `--selector` flag.

```console
$ kubedb get snap --selector='kubedb.com/kind=MongoDB' --show-labels
NAME DATABASE STATUS AGE LABELS
mongodb-demo-20171212-073557 etcd/mongodb-demo Succeeded 14m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 etcd/mongodb-demo Succeeded 2h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
mongodb-demo-20171212-073557 mg/mongodb-demo Succeeded 14m kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
snapshot-20171212-114700 mg/mongodb-demo Succeeded 2h kubedb.com/kind=MongoDB,kubedb.com/name=mongodb-demo
```

To print only object name, run the following command:
Expand All @@ -154,7 +154,7 @@ To learn about various options of `get` command, please visit [here](/docs/refer
`kubedb describe` command allows users to describe any KubeDB object. The following command will describe MongoDB database `mongodb-demo` with relevant information.

```console
$ kubedb describe etcd mongodb-demo
$ kubedb describe mg mongodb-demo
Name: mongodb-demo
Namespace: default
StartTimestamp: Wed, 28 Feb 2018 14:21:29 +0600
Expand Down Expand Up @@ -214,13 +214,13 @@ To hide events on KubeDB object, use flag `--show-events=false`
To describe all MongoDB objects in `default` namespace, use following command

```console
$ kubedb describe etcd
$ kubedb describe mg
```

To describe all MongoDB objects from every namespace, provide `--all-namespaces` flag.

```console
$ kubedb describe etcd --all-namespaces
$ kubedb describe mg --all-namespaces
```

To describe all KubeDB objects from every namespace, use the following command:
Expand All @@ -232,7 +232,7 @@ $ kubedb describe all --all-namespaces
You can also describe KubeDb objects with matching labels. The following command will describe all MongoDB objects with specified labels from every namespace.

```console
$ kubedb describe etcd --all-namespaces --selector='group=dev'
$ kubedb describe mg --all-namespaces --selector='group=dev'
```

To learn about various options of `describe` command, please visit [here](/docs/reference/kubedb_describe.md).
Expand All @@ -244,12 +244,12 @@ To learn about various options of `describe` command, please visit [here](/docs/
Lets edit an existing running MongoDB object to setup [Scheduled Backup](/docs/guides/mongodb/snapshot/scheduled-backup.md). The following command will open MongoDB `mongodb-demo` in editor.

```console
$ kubedb edit etcd mongodb-demo
$ kubedb edit mg mongodb-demo
# Add following under Spec to configure periodic backups
# backupSchedule:
# cronExpression: '@every 1m'
# storageSecretName: etcd-snap-secret
# storageSecretName: mg-snap-secret
# gcs:
# bucket: bucket-name
Expand Down

0 comments on commit 8a1b4b1

Please sign in to comment.