Description:
Cannot change resource request/limit via the operator.
How to repeat:
- Step 1: Create a new innodb cluster via mysql-operator/mysql-innodbcluster chart.
helmfile.yaml
------
repositories:
- name: mysql-operator
url: "https://mysql.github.io/mysql-operator"
releases:
- name: mysql-innodbcluster-p2
namespace: infra-databases
chart: mysql-operator/mysql-innodbcluster
version: 2.0.8
installed: true
values:
- values/mysql-innodbcluster-p2-config.yaml
values/mysql-innodbcluster-p2-config.yaml:
---------
...
serverVersion: 8.0.32
serverInstances: 3
routerInstances: 1 # or use router.instances
baseServerId: 1000
...
podSpec:
containers:
- name: mysql
resources:
requests:
memory: "1024Mi" # adapt to your needs
cpu: "200m" # adapt to your needs
limits:
memory: "2048Mi" # adapt to your needs
cpu: "3100m" # adapt to your needs
...
get innodb cluster status
---------
kubectl -n infra-databases get innodbcluster
NAME STATUS ONLINE INSTANCES ROUTERS AGE
mysql-innodbcluster-p2 ONLINE 3 3 1 15m
get statefulset resource request/limit
---------
[
{
"statefulset_name": "mysql-innodbcluster-p2",
"containers": [
{
"container_name": "sidecar",
"memory_requested": null,
"cpu_requested": null,
"memory_limit": null,
"cpu_limit": null
}
]
},
{
"statefulset_name": "mysql-innodbcluster-p2",
"containers": [
{
"container_name": "mysql",
"memory_requested": "1Gi",
"cpu_requested": "200m",
"memory_limit": "2Gi",
"cpu_limit": "3100m"
}
]
}
]
- Step 2: change resource request from 200m -> 300m
values/mysql-innodbcluster-p2-config.yaml:
---------
...
podSpec:
containers:
- name: mysql
resources:
requests:
memory: "1024Mi" # adapt to your needs
cpu: "300m" # adapt to your needs
limits:
memory: "2048Mi" # adapt to your needs
cpu: "3100m" # adapt to your needs
...
get innodb cluster status
---------
kubectl -n infra-databases get innodbcluster
NAME STATUS ONLINE INSTANCES ROUTERS AGE
mysql-innodbcluster-p2 ONLINE 3 3 1 19m
get statefulset resource request/limit
---------
[
{
"statefulset_name": "mysql-innodbcluster-p2",
"containers": [
{
"container_name": "sidecar",
"memory_requested": null,
"cpu_requested": null,
"memory_limit": null,
"cpu_limit": null
}
]
},
{
"statefulset_name": "mysql-innodbcluster-p2",
"containers": [
{
"container_name": "mysql",
"memory_requested": "1Gi",
"cpu_requested": "200m",
"memory_limit": "2Gi",
"cpu_limit": "3100m"
}
]
}
]