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
{{ message }}
Repository navigation
Commit a07cecd
Browse filesBrowse the repository at this point in the historyBrowse files
- With `auto` (the default) the operator decides whether a restart is needed based on the provided configuration.
199
+
- Use `"false"` for changes that can be applied dynamically without a restart.
200
+
- Use `"true"` for changes that require a restart to take effect.
196
201
197
202
Let's create the `MariaDBOpsRequest` CR we have shown above,
198
203
@@ -304,7 +309,7 @@ Bye
304
309
As we can see from the configuration has changed, the value of `max_connections` has been changed from `200` to `250` and and the `read_buffer_size` has been changed `1048576` to `122880`. So the reconfiguration of the database is successful.
305
310
306
311
307
-
### Reconfigure Existing Config Secret
312
+
### Reconfigure Using Apply Config
308
313
309
314
Now, we will create a new `MariaDBOpsRequest` to reconfigure our existing secret `new-md-configuration` by modifying our `new-md-config.cnf` file using `applyConfig`. The `MariaDBOpsRequest` yaml is given below,
310
315
@@ -319,6 +324,7 @@ spec:
319
324
databaseRef:
320
325
name: sample-mariadb
321
326
configuration:
327
+
restart: auto
322
328
applyConfig:
323
329
new-md-config.cnf: |
324
330
[mysqld]
@@ -511,9 +517,12 @@ spec:
511
517
databaseRef:
512
518
name: sample-mariadb
513
519
configuration:
520
+
restart: auto
514
521
removeCustomConfig: true
515
522
```
516
523
524
+
> **Note:** Removing custom configuration requires a restart; use `restart: auto` or `restart: "true"`, as `restart: "false"` causes the OpsRequest to fail.
525
+
517
526
Here,
518
527
519
528
- `spec.databaseRef.name`specifies that we are reconfiguring `mdops-reconfigure-remove` database.
Copy file name to clipboardExpand all lines: docs/guides/mariadb/reconfigure/overview/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ The Reconfiguring MariaDB process consists of the following steps:
47
47
48
48
7. Then the `KubeDB` Enterprise operator will replace the existing configuration with the new configuration provided or merge the new configuration with the existing configuration according to the `MariaDBOpsRequest` CR.
49
49
50
-
8. Then the `KubeDB` Enterprise operator will restart the related PetSet Pods so that they restart with the new configuration defined in the `MariaDBOpsRequest` CR.
50
+
8. Then the `KubeDB` Enterprise operator applies the configuration defined in the `MariaDBOpsRequest` CR, restarting the related PetSet Pods when needed according to `spec.configuration.restart`.
51
51
52
52
9. After the successful reconfiguring of the `MariaDB`, the `KubeDB` Enterprise operator resumes the `MariaDB` object so that the `KubeDB` Community operator resumes its usual operations.
- With `auto` (the default) the operator decides whether a restart is needed based on the provided configuration.
195
+
- Use `"false"` for changes that can be applied dynamically without a restart.
196
+
- Use `"true"` for changes that require a restart to take effect.
192
197
193
198
Let's create the `MariaDBOpsRequest` CR we have shown above,
194
199
@@ -297,7 +302,7 @@ Bye
297
302
As we can see from the configuration has changed, the value of `max_connections` has been changed from `200` to `250` and and the `read_buffer_size` has been changed `1048576` to `122880`. So the reconfiguration of the database is successful.
298
303
299
304
300
-
### Reconfigure Existing Config Secret
305
+
### Reconfigure Using Apply Config
301
306
302
307
Now, we will create a new `MariaDBOpsRequest` to reconfigure our existing secret `new-md-configuration` by modifying our `new-md-config.cnf` file using `applyConfig`. The `MariaDBOpsRequest` yaml is given below,
303
308
@@ -312,6 +317,7 @@ spec:
312
317
databaseRef:
313
318
name: sample-mariadb
314
319
configuration:
320
+
restart: auto
315
321
applyConfig:
316
322
new-md-config.cnf: |
317
323
[mysqld]
@@ -502,9 +508,12 @@ spec:
502
508
databaseRef:
503
509
name: sample-mariadb
504
510
configuration:
511
+
restart: auto
505
512
removeCustomConfig: true
506
513
```
507
514
515
+
> **Note:** Removing custom configuration requires a restart; use `restart: auto` or `restart: "true"`, as `restart: "false"` causes the OpsRequest to fail.
516
+
508
517
Here,
509
518
510
519
- `spec.databaseRef.name`specifies that we are reconfiguring `mdops-reconfigure-remove` database.
- With `auto` (the default) the operator decides whether a restart is needed based on the provided configuration.
339
+
- Use `"false"` for changes that can be applied dynamically without a restart.
340
+
- Use `"true"` for changes that require a restart to take effect.
341
+
336
342
337
343
Let's create the `MySQLOpsRequest` CR we have shown above,
338
344
@@ -491,6 +497,50 @@ mysql>
491
497
492
498
As we can see from the configuration has changed, the value of `max_connections` has been changed from `200` to `250` and and the `read_buffer_size` has been changed `1048576` to `122880`. So the reconfiguration of the database is successful.
493
499
500
+
### Reconfigure Using Apply Config
501
+
502
+
Use `spec.configuration.applyConfig` to update configuration files without creating a new config secret. The following request changes the two settings in `new-my-config.cnf`:
503
+
504
+
```yaml
505
+
apiVersion: ops.kubedb.com/v1alpha1
506
+
kind: MySQLOpsRequest
507
+
metadata:
508
+
name: myops-reconfigure-apply-config
509
+
namespace: demo
510
+
spec:
511
+
type: Reconfigure
512
+
databaseRef:
513
+
name: sample-mysql
514
+
configuration:
515
+
restart: auto
516
+
applyConfig:
517
+
new-my-config.cnf: |
518
+
[mysqld]
519
+
max_connections = 230
520
+
read_buffer_size = 1064960
521
+
```
522
+
523
+
`applyConfig` can modify multiple settings and can also be used when no config secret exists. Apply the request:
$ kubectl get mysqlopsrequest -n demo myops-reconfigure-apply-config -w
528
+
```
529
+
530
+
Once the request is `Successful`, connect to MySQL and verify the updated values:
531
+
532
+
```bash
533
+
$ kubectl exec -it -n demo sample-mysql-0 -- bash
534
+
bash-4.4# mysql -u${MYSQL_ROOT_USERNAME} -p${MYSQL_ROOT_PASSWORD}
535
+
```
536
+
537
+
```sql
538
+
mysql> SHOW VARIABLES LIKE 'max_connections';
539
+
-- Expected value: 230
540
+
mysql> SHOW VARIABLES LIKE 'read_buffer_size';
541
+
-- Expected value: 1064960
542
+
```
543
+
494
544
### Remove Custom Configuration
495
545
496
546
We can also remove exisiting custom config using `MySQLOpsRequest`. Provide `true` to field `spec.configuration.removeCustomConfig` and make an Ops Request to remove existing custom configuration.
@@ -510,9 +560,12 @@ spec:
510
560
databaseRef:
511
561
name: sample-mysql
512
562
configuration:
563
+
restart: auto
513
564
removeCustomConfig: true
514
565
```
515
566
567
+
> **Note:** Removing custom configuration requires a restart; use `restart: auto` or `restart: "true"`, as `restart: "false"` causes the OpsRequest to fail.
568
+
516
569
Here,
517
570
518
571
- `spec.databaseRef.name`specifies that we are reconfiguring `myops-reconfigure-remove` database.
@@ -586,6 +639,6 @@ To clean up the Kubernetes resources created by this tutorial, run:
0 commit comments