You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__NOTE__: MySQL Operator 0.2.x requires at least Kubernetes 1.11.x (or 1.10.x with alpha features) while version 0.1.x is known to work with Kubernetes up 1.9.x. For upgrading check the [0.2.x upgrade notes](#v02x-upgrade) since some manual seps are required.
2
-
3
1
# MySQL Operator
4
2
5
-
MySQL Operator enables bulletproof MySQL on Kubernetes. It manages all the necessary resources for deploying and managing a highly available MySQL cluster. It provides efortless backups, while keeping the cluster highly-available.
3
+
MySQL Operator enables bulletproof MySQL on Kubernetes. It manages all the necessary resources for
4
+
deploying and managing a highly available MySQL cluster. It provides efortless backups, while
5
+
keeping the cluster highly-available.
6
6
7
-
MySQL Operator was developed by the awesome engineering team at[Presslabs](https://www.presslabs.com/),
8
-
a Managed WordPress Hosting provider.
7
+
MySQL Operator was developed by the awesome engineering team at
8
+
[Presslabs](https://www.presslabs.com/), a Managed WordPress Hosting provider.
9
9
10
-
For more open-source projects, check [Presslabs Code](https://www.presslabs.org/).
10
+
For more open-source projects, check [Presslabs Code](https://www.presslabs.com/code/).
11
11
12
12
## Goals and status
13
13
@@ -18,251 +18,60 @@ The main goals of this operator are:
18
18
3. Out-of-the-box backups (scheduled and on demand) and point-in-time recovery
19
19
4. Support for cloning in cluster and across clusters
20
20
21
-
The operator is to be considered alpha and not suited for critical production workloads. We (Presslabs) sucessfully use it at the moment for some non-critical production workloads.
21
+
The operator is to be considered alpha and not suited for critical production workloads. We
22
+
(Presslabs) sucessfully use it at the moment for some non-critical production workloads.
22
23
23
24
## Contributing
24
25
25
-
We welcome all contributions in the form of new issues for feature requests, bugs or directly pull requests.
26
-
We are open to discuss ideas to improve the operator and would also love to find out where and how it is used.
27
-
The discussion related to the project should happen on [Gitter](https://gitter.im/PressLabs/mysql-operator).
28
-
The current developers of the project can be reached via [email](mailto:[email protected]) too.
26
+
We welcome all contributions in the form of new issues for feature requests, bugs or directly pull
27
+
requests. We are open to discuss ideas to improve the operator and would also love to find out where
28
+
and how it is used. The discussion related to the project should happen on Kubernetes Community
29
+
[Slack](https://kubernetes.slack.com/messages/CEKQXFR0E/). The current developers of the project can
Before creating a cluster, you need a secret that contains the ROOT_PASSWORD key.
67
-
An example for this secret can be found at [examples/example-cluster-secret.yaml](examples/example-cluster-secret.yaml).
68
-
69
-
Create a file named `example-cluster-secret.yaml` and copy into it the following YAML code:
70
-
71
-
```yaml
72
-
apiVersion: v1
73
-
kind: Secret
74
-
metadata:
75
-
name: my-secret
76
-
type: Opaque
77
-
data:
78
-
# root password is required to be specified
79
-
ROOT_PASSWORD: bm90LXNvLXNlY3VyZQ==
80
-
```
81
-
#### Note.
82
-
`ROOT_PASSWORD` must be base64 encoded.
83
-
84
-
Now, to create a cluster you need just a simple YAML file that defines it.
85
-
An example can be found at [examples/example-cluster.yaml](examples/example-cluster.yaml).
86
-
87
-
Create a file named `example-cluster.yaml` and copy into it the following YAML code:
88
-
89
-
```yaml
90
-
apiVersion: mysql.presslabs.org/v1alpha1
91
-
kind: MysqlCluster
92
-
metadata:
93
-
name: my-cluster
94
-
spec:
95
-
replicas: 2
96
-
secretName: my-secret
97
-
```
98
-
99
-
To deploy the cluster, run:
100
-
101
-
```shell
102
-
kubectl apply -f example-cluster-secret.yaml
103
-
kubectl apply -f example-cluster.yaml
104
-
```
105
-
106
-
For a more in depth configuration, check [examples](examples/).
107
-
108
-
### To list the deployed clusters use
109
-
```shell
110
-
$ kubectl get mysql
111
-
NAME AGE
112
-
my-cluster 1m
113
-
```
114
-
115
-
### To check cluster state use
116
-
```shell
117
-
$ kubectl describe mysql my-cluster
118
-
...
119
-
Status:
120
-
Ready Nodes: 2
121
-
Conditions:
122
-
Last Transition Time: 2018-03-28T10:20:23Z
123
-
Message: Cluster is ready.
124
-
Reason: statefulset ready
125
-
Status: True
126
-
Type: Ready
127
-
...
128
-
```
129
-
130
-
## Backups
131
-
132
-
Backups are stored on object storage services like S3 or google cloud storage.
133
-
In order to be able to store backup, the secret defined under `backupBucketSecretName` must the credentials to store those backups.
134
-
The backups are uploaded using [Rclone](https://rclone.org/).
135
-
The contents of the secret are used to generate an rclone.conf in [hack/docker/mysql-helper/docker-entrypoint.sh](hack/docker/mysql-helper/docker-entrypoint.sh).
136
-
137
-
### Setup backup to S3
138
-
139
-
You need to specify the `backupBucketUri` for the cluster to an uri like `s3://BUCKET_NAME`, and a secret.
140
-
141
-
```yaml
142
-
apiVersion: v1
143
-
kind: Secret
144
-
metadata:
145
-
name: my-cluster-backup-secret
146
-
type: Opaque
147
-
data:
148
-
AWS_ACCESS_KEY_ID: #
149
-
AWS_SECRET_KEY: #
150
-
# Optional, the AWS region to connect
151
-
# AWS_REGION: us-east1
152
-
# Optional, specify the storage class
153
-
# AWS_STORAGE_CLASS: standard
154
-
# Optional, canned ACL to use
155
-
# AWS_ACL:
156
-
# Optional, the S3 provider to use (default: AWS)
157
-
# S3_PROVIDER: AWS
158
-
# Optional, the S3 endpoint to use (for when you use a different S3_PROVIDER)
159
-
# S3_ENDPOINT:
160
-
```
161
-
162
-
Then run this command:
163
-
164
-
```yaml
165
-
apiVersion: v1
166
-
kind: Secret
167
-
metadata:
168
-
name: my-cluster-backup-secret
169
-
type: Opaque
170
-
data:
171
-
GCS_SERVICE_ACCOUNT_JSON_KEY: #
172
-
GCS_PROJECT_ID: #
173
-
```
174
-
175
-
Then run this command:
176
-
177
-
```shell
178
-
kubectl apply -f example-backup-secret.yaml
179
-
```
180
-
181
-
#### Note
182
-
`GCS_SERVICE_ACCOUNT_JSON_KEY`and `GCS_PROJECT_ID` must be base64 encoded.
183
-
184
-
### Requesting a backup
185
-
186
-
You need to create a file named `example-backup.yaml` and copy into it the following YAML code:
187
-
188
-
```yaml
189
-
apiVersion: mysql.presslabs.org/v1alpha1
190
-
kind: MysqlBackup
191
-
metadata:
192
-
name: my-cluster-backup
193
-
spec:
194
-
clusterName: my-cluster
195
-
```
196
-
197
-
Run the following command:
198
-
199
-
```shell
200
-
kubectl apply -f example-backup.yaml
201
-
```
202
-
203
-
You need to specify the `backupBucketUri` for the corresponding cluster to an URI like `gs://BUCKET_NAME` and `backupSecretName`.
204
-
Open the file named `example-cluster.yaml` and copy into it the following YAML code:
205
-
206
-
```yaml
207
-
apiVersion: mysql.presslabs.org/v1alpha1
208
-
kind: MysqlCluster
209
-
metadata:
210
-
name: my-cluster
211
-
spec:
212
-
replicas: 2
213
-
secretName: my-secret
214
-
backupSecretName: my-cluster-backup-secret
215
-
backupUri: gs://pl-test-mysql-operator/
216
-
```
217
-
218
-
Then run the following command:
219
-
220
-
```shell
221
-
kubectl apply -f example-cluster.yaml
222
-
```
223
-
224
-
### Listing all backups
225
-
```shell
226
-
$ kubectl get mysqlbackup
227
-
NAME AGE
228
-
my-cluster-backup 1m
229
-
my-cluster-auto-backup-20180402-1604 1d
230
-
```
231
-
232
-
### Checking the backup state
233
-
```shell
234
-
$ kubectl describe backup my-cluster-backup
235
-
...
236
-
Status:
237
-
Completed: true
238
-
Conditions:
239
-
Last Transition Time: 2018-03-21T16:02:56Z
240
-
Message:
241
-
Reason:
242
-
Status: True
243
-
Type: Complete
244
-
...
245
-
```
246
-
247
-
## Access orchestrator
248
-
To connect to orchestrator dashboard you have to port forward orchestrator port
249
-
3000 to your local machine. Ensure it's a healthy pod if using raft:
0 commit comments