Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Custom Resource Configuration Not Reflected in Pod Configuration Rendering #8889

Open
weicao opened this issue Feb 7, 2025 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@weicao
Copy link
Contributor

weicao commented Feb 7, 2025

Describe the bug
Custom Resource Configuration Not Applied to Memory-Related Parameters (e.g., innodb_buffer_pool_size) in Pod Configuration Rendering

When creating a cluster using KubeBlocks' instances API, one of the Pods is configured with custom resource configurations (e.g., higher CPU and memory). However, during the configuration rendering process for this Pod, the custom resource configuration is not considered.

For example, memory-related parameters such as innodb_buffer_pool_size are not dynamically adjusted based on the custom memory configuration of the Pod. Instead, the default resource settings seem to be applied uniformly across all Pods, regardless of their individual resource configurations.

This results in suboptimal configurations for Pods that are specifically designed to handle higher workloads due to their custom resource allocations.

To Reproduce

  1. Use the instances API to create a cluster. Configure one of the Pods with custom resource settings (e.g., higher memory allocation).
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: example-mysql-cluster
  namespace: demo
spec:
  clusterDef: mysql
  topology: semisync
  terminationPolicy: Delete
  componentSpecs:
    - name: mysql
      serviceVersion: 8.0.35
      replicas: 2
      resources:
        limits:
          cpu: '0.5'
          memory: 0.5Gi
        requests:
          cpu: '0.5'
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName: ""
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
      instances:
        - name: custom
          replicas: 1
          labels:
            custom-resource-config: "true"
          resources:
            limits:
              cpu: 1
              memory: 1Gi
            requests:
              cpu: 1
              memory: 1Gi
EOF
  1. Deploy the cluster and inspect the rendered configuration for the Pod with custom resources. Observe that parameters like innodb_buffer_pool_size do not reflect the custom memory configuration.
$ k exec -it -n demo example-mysql-cluster-mysql-custom-0 -- mysql -uroot -p5GGJU7869p
mysql> show variables like 'innodb_buffer_pool_size';
+-------------------------+-----------+
| Variable_name           | Value     |
+-------------------------+-----------+
| innodb_buffer_pool_size | 134217728 |
+-------------------------+-----------+


$ k exec -it -n demo example-mysql-cluster-mysql-0 -- mysql -uroot -p5GGJU7869p
mysql> show variables like 'innodb_buffer_pool_size';
+-------------------------+-----------+
| Variable_name           | Value     |
+-------------------------+-----------+
| innodb_buffer_pool_size | 134217728 |
+-------------------------+-----------+

Expected behavior
When rendering the configuration for a Pod with custom resource settings, parameters such as innodb_buffer_pool_size should be dynamically adjusted based on the Pod's allocated memory. This ensures that the Pod's configuration utilizes its resources effectively.

Actual Behavior
The configuration for the Pod does not consider its custom resource settings. Memory-related parameters remain set to default values, leading to inefficient resource utilization.

Desktop (please complete the following information):
KubeBlocks 1.0.0-beta.26

Additional context
Add any other context about the problem here.

@weicao weicao added the kind/bug Something isn't working label Feb 7, 2025
@shanshanying
Copy link
Contributor

These two replicas are managed by one SINGLE instanceset, and each instanceset manages only one copy of configuration, renderered from template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants