Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
the-redback committed Feb 14, 2018
1 parent 50da0e6 commit 1fcfea8
Show file tree
Hide file tree
Showing 29 changed files with 2,390 additions and 754 deletions.
30 changes: 22 additions & 8 deletions docs/concepts/databases/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
requests:
storage: 50Mi
databaseSecret:
secretName: m1-admin-auth
secretName: m1-auth
nodeSelector:
disktype: ssd
init:
Expand All @@ -59,7 +59,7 @@ spec:
cpu: "500m"
doNotPause: true
monitor:
agent: coreos-prometheus-operator
agent: prometheus.io/coreos-operator
prometheus:
namespace: demo
labels:
Expand Down Expand Up @@ -88,15 +88,26 @@ spec:
- `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


### spec.databaseSecret
`spec.databaseSecret` is an optional field that points to a Secret used to hold credentials for `mysql` super user. If not set, KubeDB operator creates a new Secret `{mysql-object-name}-admin-auth` for storing the password for `mysql` superuser for each MySQL object. If you want to use an existing secret please specify that when creating the MySQL object using `spec.databaseSecret.secretName`.
`spec.databaseSecret` is an optional field that points to a Secret used to hold credentials for `mysql` super user. If not set, KubeDB operator creates a new Secret `{mysql-object-name}-auth` for storing the password for `mysql` superuser for each MySQL object. If you want to use an existing secret please specify that when creating the MySQL object using `spec.databaseSecret.secretName`.

This secret contains a `.admin` key with a ini formatted key-value pairs. Example:
This secret contains a `user` key and a `password` key which contains the `username` and `password` respectively for `mysql` root user. Here the value of `user` key is fixed to be `root`. Example:
```ini
vPlT2PzewCaC3XZP
apiVersion: v1
data:
password: NnE4dV8yak1PVy1PT1pYaw==
user: cm9vdA==
kind: Secret
metadata:
...
name: m1-auth
namespace: demo
...
type: Opaque
```


Expand Down Expand Up @@ -163,17 +174,20 @@ KubeDB supports taking periodic snapshots for MySQL database. This is an optiona
### spec.doNotPause
`spec.doNotPause` is an optional field that tells KubeDB operator that if this MySQL 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 MySQL 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 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
To learn how to monitor MySQL databases, please visit [here](/docs/concepts/monitoring.md).

MySQL can be monitored with KubeDB using out-of-the-box builtin-Prometheus and out-of-the-box CoreOS-Prometheus Operator. To learn more,
- [Monitor MySQL with builtin-Prometheus](/docs/guides/mysql/monitoring/using-builtin-prometheus.md)
- [Monitor MySQL with CoreOS-Prometheus Operator](/docs/guides/mysql/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/).


## Next Steps
- Learn how to use KubeDB to run a MySQL database [here](/docs/guides/mysql/overview.md).
- Learn how to use KubeDB to run a MySQL database [here](/docs/guides/mysql/README.md).
- See the list of supported storage providers for snapshots [here](/docs/concepts/snapshot.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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: m1
name: mysql-init-script
namespace: demo
spec:
version: 8.0
Expand Down
18 changes: 18 additions & 0 deletions docs/examples/mysql/Initialization/demo-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: mysql-init-snapshot
namespace: demo
spec:
version: 8.0
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
init:
snapshotSource:
name: snap-mysql-infant
namespace: demo
45 changes: 0 additions & 45 deletions docs/examples/mysql/demo-0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,3 @@ spec:
finalizers:
- kubernetes

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: myadmin
name: myadmin
namespace: demo
spec:
replicas: 1
template:
metadata:
labels:
app: myadmin
spec:
containers:
- image: phpmyadmin/phpmyadmin
imagePullPolicy: Always
name: phpmyadmin
ports:
- containerPort: 80
name: http
protocol: TCP
env:
- name: PMA_ARBITRARY
value: '1'

---
apiVersion: v1
kind: Service
metadata:
labels:
app: myadmin
name: myadmin
namespace: demo
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
app: myadmin
type: LoadBalancer

16 changes: 16 additions & 0 deletions docs/examples/mysql/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: MySQL
metadata:
name: mysql-mon-prometheus
namespace: demo
spec:
version: 8.0
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
monitor:
agent: prometheus.io/builtin
22 changes: 22 additions & 0 deletions docs/examples/mysql/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: MySQL
metadata:
name: mysql-mon-coreos
namespace: demo
spec:
version: 8.0
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/mysql/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/mysql/private-registry/demo-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: mysql-pvt-reg
namespace: demo
spec:
version: 8.0
doNotPause: true
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
imagePullSecrets:
- name: myregistrykey
43 changes: 43 additions & 0 deletions docs/examples/mysql/quickstart/demo-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: myadmin
name: myadmin
namespace: demo
spec:
replicas: 1
template:
metadata:
labels:
app: myadmin
spec:
containers:
- image: phpmyadmin/phpmyadmin
imagePullPolicy: Always
name: phpmyadmin
ports:
- containerPort: 80
name: http
protocol: TCP
env:
- name: PMA_ARBITRARY
value: '1'

---
apiVersion: v1
kind: Service
metadata:
labels:
app: myadmin
name: myadmin
namespace: demo
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
app: myadmin
type: LoadBalancer
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: recovered
name: mysql-quickstart
namespace: demo
spec:
version: 8.0
doNotPause: true
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
init:
snapshotSource:
name: m1-xyz

15 changes: 15 additions & 0 deletions docs/examples/mysql/snapshot/demo-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: mysql-infant
namespace: demo
spec:
version: 8.0
doNotPause: true
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: kubedb.com/v1alpha1
kind: Snapshot
metadata:
name: m1-xyz
name: snap-mysql-infant
namespace: demo
labels:
kubedb.com/kind: MySQL
spec:
databaseName: m1
storageSecretName: ms-snap-secret
databaseName: mysql-infant
storageSecretName: my-snap-secret
gcs:
bucket: restic
18 changes: 18 additions & 0 deletions docs/examples/mysql/snapshot/demo-3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: mysql-recovered
namespace: demo
spec:
version: 8.0
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
init:
snapshotSource:
name: snap-mysql-infant
namespace: demo
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: m1
name: mysql-scheduled
namespace: demo
spec:
version: 8.0
doNotPause: true
storage:
storageClassName: "standard"
accessModes:
Expand All @@ -20,6 +19,6 @@ spec:
directory: .
backupSchedule:
cronExpression: "@every 1m"
storageSecretName: ms-snap-secret
storageSecretName: my-snap-secret
gcs:
bucket: restic
2 changes: 1 addition & 1 deletion docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Guides show you how to perform tasks with KubeDB.

- [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/overview.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/overview.md): This tutorial will show you how to use KubeDB to run a MongoDB database.

Expand Down
Loading

0 comments on commit 1fcfea8

Please sign in to comment.