k8ssandra / k8ssandra-operator

The Kubernetes operator for K8ssandra
https://k8ssandra.io/
Apache License 2.0
168 stars 78 forks source link

Memory limits for server-config-init doesn't get modified #1006

Open poleszcz opened 1 year ago

poleszcz commented 1 year ago

What did you do?

I've encountered issue similar to the one here https://github.com/k8ssandra/k8ssandra-operator/issues/723 and want to set higher memory limit for the init container server-config-init.

To achieve that I've already upgraded helm chart to version 1.5.1.

I've already new values in K8ssandraCluster object....

   - config:
        jvmOptions:
          gc: G1GC
          heapSize: 16G
      initContainers:
      - name: server-config-init
        resources:
          limits:
            cpu: 1
            memory: 1G
          requests:
            cpu: 1
            memory: 1G
      jmxInitContainerImage:
        name: busybox
        registry: docker.io
        tag: 1.34.1
      metadata:
        name: myname

but when I delete STS it gets recreated with default limits.

  server-config-init:
    Container ID:   containerd://17433e9a9e770f757ba225308ed3715cb65196432eb329ecd38cf486aba0c9bd
    Image:          datastax/cass-config-builder:1.0-ubi7
    Image ID:       docker.io/datastax/cass-config-builder@sha256:e1d2154f93034d670586049534c6281f59a26d39c25885a6eba1737677ad6319
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Fri, 23 Jun 2023 18:50:37 +0200
    Last State:     Terminated
      Reason:       OOMKilled
      Exit Code:    137
      Started:      Fri, 23 Jun 2023 18:50:33 +0200
      Finished:     Fri, 23 Jun 2023 18:50:37 +0200
    Ready:          False
    Restart Count:  1
    Limits:
      cpu:     1
      memory:  256M
    Requests:
      cpu:     1
      memory:  256M

Maybe I wrongly understood how the fix was implemented and I should set these limits somehow differently ? Please advice.

Did you expect to see some different?

My understanding is that sts should get recreated with modified limits.

Environment

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: K8OP-86

qveensi commented 1 year ago

I have the same problem

avnerse3 commented 1 year ago
  config:
  configBuilderResources:
    limits:
      cpu: 1
      memory: 1G
    requests:
      cpu: 1
      memory: 1G

This fixed for me on v1.5.2 - note it's under configBuilderResources - separate from the initContainers.

Miles-Garnsey commented 1 year ago

@poleszcz did @avnerse3 suggestion resolve your problem? I will close this ticket if so.