Skip to content

Commit

Permalink
Improve redis docs (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-redback authored and tamalsaha committed Feb 15, 2018
1 parent 7f1e3ee commit a412a63
Show file tree
Hide file tree
Showing 37 changed files with 1,345 additions and 419 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/databases/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ KubeDB supports taking periodic snapshots for MongoDB database. This is an optio

### spec.imagePullSecret

`KubeDB` provides the flexibility of deploying MongoDB database from a Private Docker Registry. To learn how to deploym MongoDB from a Private Registry, please visit [here](/docs/guides/mongodb/private-registry/using-private-registry.md).
`KubeDB` provides the flexibility of deploying MongoDB database from a private Docker registry. To learn how to deploym MongoDB from a Private Registry, please visit [here](/docs/guides/mongodb/private-registry/using-private-registry.md).

### spec.monitor

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/databases/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ KubeDB supports taking periodic snapshots for MySQL database. This is an optiona

### spec.imagePullSecret

`KubeDB` provides the flexibility of deploying MySQL database from a Private Docker Registry. To learn how to deploym MySQL from a Private Registry, please visit [here](/docs/guides/mysql/private-registry/using-private-registry.md).
`KubeDB` provides the flexibility of deploying MySQL database from a private Docker registry. To learn how to deploym MySQL from a Private Registry, please visit [here](/docs/guides/mysql/private-registry/using-private-registry.md).

### spec.monitor

Expand Down
30 changes: 20 additions & 10 deletions docs/concepts/databases/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ section_menu_id: concepts
# Redis

## What is Redis

A `Redis` is a Kubernetes `Custom Resource Definitions` (CRD). It provides declarative configuration for [Redis](https://redis.io/) in a Kubernetes native way. You only need to describe the desired database configuration in a Redis object, and the KubeDB operator will create Kubernetes objects in the desired state for you.

## Redis Spec

As with all other Kubernetes objects, a Redis needs `apiVersion`, `kind`, and `metadata` fields. It also needs a `.spec` section. Below is an example Redis object.

```yaml
Expand Down Expand Up @@ -55,41 +57,49 @@ spec:
```
### spec.version
`spec.version` is a required field specifying the version of Redis database. Official [Redis docker images](https://hub.docker.com/r/library/redis/tags/) will be used for the specific version.
`spec.version` is a required field specifying the version of Redis database. Official [Redis docker images](https://hub.docker.com/r/library/redis/tags/) will be used for the specific version.

### spec.storage

`spec.storage` is an optional field that specifies the StorageClass of PVCs dynamically allocated to store data for the database. This storage spec will be passed to the StatefulSet created by KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests. If no storage spec is given, an `emptyDir` is used.

- `spec.storage.storageClassName` is the name of the StorageClass used to provision PVCs. PVCs don’t necessarily have to request a class. A PVC with its storageClassName set equal to "" is always interpreted to be requesting a PV with no class, so it can only be bound to PVs with no class (no annotation or one set equal to ""). A PVC with no storageClassName is not quite the same and is treated differently by the cluster depending on whether the DefaultStorageClass admission plugin is turned on.
- `spec.storage.storageClassName` is the name of the StorageClass used to provision PVCs. PVCs don’t necessarily have to request a class. A PVC with its storageClassName set equal to "" is always interpreted to be requesting a PV with no class, so it can only be bound to PVs with no class (no annotation or one set equal to ""). A PVC with no storageClassName is not quite the same and is treated differently by the cluster depending on whether the DefaultStorageClass admission plugin is turned on.

- `spec.storage.accessModes` uses the same conventions as Kubernetes PVCs when requesting storage with specific access modes.
- `spec.storage.accessModes` uses the same conventions as Kubernetes PVCs when requesting storage with specific access modes.

- `spec.storage.resources` can be used to request specific quantities of storage. This follows the same resource model used by PVCs.
- `spec.storage.resources` can be used to request specific quantities of storage. This follows the same resource model used by PVCs.

To learn how to configure `spec.storage`, please visit the links below:
- https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims

- https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims

### spec.nodeSelector
`spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) .

`spec.nodeSelector` is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) .

### spec.doNotPause

`spec.doNotPause` is an optional field that tells KubeDB operator that if this Redis object is deleted, whether it should be reverted automatically. This should be set to `true` for production databases to avoid accidental deletion. If not set or set to false, deleting a Redis object put the database into a dormant state. The StatefulSet for a DormantDatabase is deleted but the underlying PVCs are left intact. This allows user to resume the database later.

### spec.imagePullSecret

`KubeDB` provides the flexibility of deploying Redis database from a private Docker registry. To learn how to deploym Redis from a Private Registry, please visit [here](/docs/guides/redis/private-registry/using-private-registry.md).

### spec.monitor
To learn how to monitor Redis databases, please visit [here](/docs/concepts/monitoring.md).

Redis managed by KubeDB can be monitored with builtin-Prometheus and CoreOS-Prometheus operator out-of-the-box. To learn more,

- [Monitor Redis with builtin Prometheus](/docs/guides/redis/monitoring/using-builtin-prometheus.md)
- [Monitor Redis with CoreOS Prometheus operator](/docs/guides/redis/monitoring/using-coreos-prometheus-operator.md)

### spec.resources
`spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/).

`spec.resources` is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit [here](http://kubernetes.io/docs/user-guide/compute-resources/).

## Next Steps
- Learn how to use KubeDB to run a Redis database [here](/docs/guides/redis/overview.md).
- See the list of supported storage providers for snapshots [here](/docs/concepts/snapshot.md).

- Learn how to use KubeDB to run a Redis database [here](/docs/guides/redis/README.md).
- Thinking about monitoring your database? KubeDB works [out-of-the-box with Prometheus](/docs/guides/monitoring.md).
- Learn how to use KubeDB in a [RBAC](/docs/guides/rbac.md) enabled cluster.
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
Expand Down
13 changes: 9 additions & 4 deletions docs/concepts/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ section_menu_id: concepts
# Snapshot

## What is Snapshot

A `Snapshot` is a Kubernetes `Custom Resource Definitions` (CRD). It provides declarative configuration for database snapshots in a Kubernetes native way.
You only need to describe the desired backup behavior in a Snapshot object. KubeDB operator will launch a Job to perform backup operation. Once the snapshot process is complete, it uploads the snapshot data to various cloud providers S3, GCS, Azure, OpenStack Swift and/or locally mounted volumes using [osm](https://github.com/appscode/osm).

## Snapshot Spec

As with all other Kubernetes objects, a Snapshot needs `apiVersion`, `kind`, and `metadata` fields.
The metadata field must contain a label with `kubedb.com/kind` key.
The valid values for this label are `Postgres` or `Elasticsearch`. It also needs a `.spec` section. Below is an example Snapshot object.
Expand Down Expand Up @@ -49,6 +51,7 @@ spec:
The `.spec` section supports the following different storage providers for storing snapshot data:

### Local

`Local` backend refers to a local path inside snapshot job container. Any Kubernetes supported [persistent volume](https://kubernetes.io/docs/concepts/storage/volumes/) can be used here. Some examples are: `emptyDir` for testing, NFS, Ceph, GlusterFS, etc.
To configure this backend, no secret is needed. Following parameters are available for `Local` backend.

Expand Down Expand Up @@ -93,6 +96,7 @@ spec:
```

### AWS S3

KubeDB supports AWS S3 service or [Minio](https://minio.io/) servers as snapshot storage backend. To configure this backend, following secret keys are needed:

| Key | Description |
Expand Down Expand Up @@ -173,8 +177,8 @@ spec:
cpu: "500m"
```


### Google Cloud Storage (GCS)

KubeDB supports Google Cloud Storage(GCS) as snapshot storage backend. To configure this backend, following secret keys are needed:

| Key | Description |
Expand Down Expand Up @@ -254,6 +258,7 @@ spec:
```

### Microsoft Azure Storage

KubeDB supports Microsoft Azure Storage as snapshot storage backend. To configure this backend, following secret keys are needed:

| Key | Description |
Expand Down Expand Up @@ -333,6 +338,7 @@ spec:
```

### OpenStack Swift

KubeDB supports OpenStack Swift as snapshot storage backend. To configure this backend, following secret keys are needed:

| Key | Description |
Expand All @@ -356,7 +362,6 @@ KubeDB supports OpenStack Swift as snapshot storage backend. To configure this b
| `OS_STORAGE_URL` | For authentication based on tokens |
| `OS_AUTH_TOKEN` | For authentication based on tokens |


```console
$ echo -n '<your-auth-url>' > OS_AUTH_URL
$ echo -n '<your-tenant-id>' > OS_TENANT_ID
Expand Down Expand Up @@ -440,9 +445,9 @@ spec:
cpu: "500m"
```


## Next Steps

- Learn how to use KubeDB to run a PostgreSQL database [here](/docs/guides/postgres/overview.md).
- Learn how to use KubeDB to run an Elasticsearch database [here](/docs/guides/elasticsearch/overview.md).
- Wondering what features are coming next? Please visit [here](/docs/roadmap.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).
16 changes: 16 additions & 0 deletions docs/examples/redis/monitoring/builtin-prometheus/demo-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kubedb.com/v1alpha1
kind: Redis
metadata:
name: redis-mon-prometheus
namespace: demo
spec:
version: 4
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
monitor:
agent: prometheus.io/builtin
22 changes: 22 additions & 0 deletions docs/examples/redis/monitoring/coreos-operator/demo-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: kubedb.com/v1alpha1
kind: Redis
metadata:
name: redis-mon-coreos
namespace: demo
spec:
version: 4
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
monitor:
agent: prometheus.io/coreos-operator
prometheus:
namespace: demo
labels:
app: kubedb
interval: 10s

8 changes: 8 additions & 0 deletions docs/examples/redis/private-registry/demo-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: myregistrykey
namespace: demo
data:
.dockerconfigjson: <base-64-encoded-json-here>
type: kubernetes.io/dockerconfigjson
17 changes: 17 additions & 0 deletions docs/examples/redis/private-registry/demo-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha1
kind: Redis
metadata:
name: redis-pvt-reg
namespace: demo
spec:
version: 4
doNotPause: true
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
imagePullSecrets:
- name: myregistrykey
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kubedb.com/v1alpha1
kind: Redis
metadata:
name: r1
name: redis-quickstart
namespace: demo
spec:
version: 4
Expand Down
18 changes: 9 additions & 9 deletions docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ aliases:

Guides show you how to perform tasks with KubeDB.

- [Running PostgreSQL](/docs/guides/postgres/overview.md): This tutorial will show you how to use KubeDB to run a PostgreSQL database.
- [Running PostgreSQL](/docs/guides/postgres/overview.md): This tutorial will show you how to use KubeDB to run a PostgreSQL database.

- [Running Elasticsearch](/docs/guides/elasticsearch/overview.md): This tutorial will show you how to use KubeDB to run an Elasticsearch database.
- [Running Elasticsearch](/docs/guides/elasticsearch/overview.md): This tutorial will show you how to use KubeDB to run an Elasticsearch database.

- [Running MySQL](/docs/guides/mysql/README.md): This tutorial will show you how to use KubeDB to run a MySQL database.
- [Running MySQL](/docs/guides/mysql/README.md): This tutorial will show you how to use KubeDB to run a MySQL database.

- [Running MongoDB](/docs/guides/mongodb/README.md): This tutorial will show you how to use KubeDB to run a MongoDB database.
- [Running MongoDB](/docs/guides/mongodb/README.md): This tutorial will show you how to use KubeDB to run a MongoDB database.

- [Running Redis](/docs/guides/redis/overview.md): This tutorial will show you how to use KubeDB to run a Redis database.
- [Running Redis](/docs/guides/redis/README.md): This tutorial will show you how to use KubeDB to run a Redis database.

- [Running Memcached](/docs/guides/memcached/overview.md): This tutorial will show you how to use KubeDB to run a Memcached database.
- [Running Memcached](/docs/guides/memcached/overview.md): This tutorial will show you how to use KubeDB to run a Memcached database.

- [Manage KubeDB objects using CLIs](/docs/guides/cli.md): KubeDB comes with its own cli. It is called `kubedb` cli. kubedb can be used to deploy KubeDB operator in a cluster and manage all KubeDB crds.
- [Manage KubeDB objects using CLIs](/docs/guides/cli.md): KubeDB comes with its own cli. It is called `kubedb` cli. kubedb can be used to deploy KubeDB operator in a cluster and manage all KubeDB crds.

- [Using Prometheus with KubeDB](/docs/guides/monitoring.md): This tutorial will show you how to monitor KubeDB databases using Prometheus via [CoreOS Prometheus Operator](https://github.com/coreos/prometheus-operator).
- [Using Prometheus with KubeDB](/docs/guides/monitoring.md): This tutorial will show you how to monitor KubeDB databases using Prometheus via [CoreOS Prometheus Operator](https://github.com/coreos/prometheus-operator).

- [Using RBAC with KubeDB](/docs/guides/rbac.md): This tutorial will show you how to use KubeDB in a [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) enabled cluster.
- [Using RBAC with KubeDB](/docs/guides/rbac.md): This tutorial will show you how to use KubeDB in a [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) enabled cluster.
2 changes: 1 addition & 1 deletion docs/guides/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- Initialize [MongoDB with Snapshot](/docs/guides/mongodb/initialization/using-snapshot.md).
- Monitor your MongoDB database with KubeDB using [out-of-the-box CoreOS Prometheus Operator](/docs/guides/mongodb/monitoring/using-coreos-prometheus-operator.md).
- Monitor your MongoDB database with KubeDB using [out-of-the-box builtin-Prometheus](/docs/guides/mongodb/monitoring/using-builtin-prometheus.md).
- Use [Private Docker Registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Use [private Docker registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Detail concepts of [MongoDB object](/docs/concepts/databases/mongodb.md).
- Detail concepts of [Snapshot object](/docs/concepts/snapshot.md).
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/mongodb/initialization/using-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace "demo" deleted
- Initialize [MongoDB with Script](/docs/guides/mongodb/initialization/using-script.md).
- Monitor your MongoDB database with KubeDB using [out-of-the-box CoreOS Prometheus Operator](/docs/guides/mongodb/monitoring/using-coreos-prometheus-operator.md).
- Monitor your MongoDB database with KubeDB using [out-of-the-box builtin-Prometheus](/docs/guides/mongodb/monitoring/using-builtin-prometheus.md).
- Use [Private Docker Registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Use [private Docker registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Detail concepts of [MongoDB object](/docs/concepts/databases/mongodb.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).
2 changes: 1 addition & 1 deletion docs/guides/mongodb/initialization/using-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace "demo" deleted

- Monitor your MongoDB database with KubeDB using [out-of-the-box CoreOS Prometheus Operator](/docs/guides/mongodb/monitoring/using-coreos-prometheus-operator.md).
- Monitor your MongoDB database with KubeDB using [out-of-the-box builtin-Prometheus](/docs/guides/mongodb/monitoring/using-builtin-prometheus.md).
- Use [Private Docker Registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Use [private Docker registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Detail concepts of [MongoDB object](/docs/concepts/databases/mongodb.md).
- Detail concepts of [Snapshot object](/docs/concepts/snapshot.md).
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/mongodb/monitoring/using-builtin-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,6 @@ namespace "demo" deleted
- Take [Scheduled Snapshot](/docs/guides/mongodb/snapshot/scheduled-backup.md) of MongoDB databases using KubeDB.
- Initialize [MongoDB with Script](/docs/guides/mongodb/initialization/using-script.md).
- Initialize [MongoDB with Snapshot](/docs/guides/mongodb/initialization/using-snapshot.md).
- Use [Private Docker Registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Use [private Docker registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,6 @@ namespace "demo" deleted
- Take [Scheduled Snapshot](/docs/guides/mongodb/snapshot/scheduled-backup.md) of MongoDB databases using KubeDB.
- Initialize [MongoDB with Script](/docs/guides/mongodb/initialization/using-script.md).
- Initialize [MongoDB with Snapshot](/docs/guides/mongodb/initialization/using-snapshot.md).
- Use [Private Docker Registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Use [private Docker registry](/docs/guides/mongodb/private-registry/using-private-registry.md) to deploy MongoDB with KubeDB.
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
Loading

0 comments on commit a412a63

Please sign in to comment.