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

Unable to declare custom resources for initContainers-server-config-init in k8ssandra values.yaml #1606

Open
anihe85 opened this issue May 8, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@anihe85
Copy link

anihe85 commented May 8, 2023

I am getting below error with initContainers-server-config-init default value

  server-config-init:
    Container ID:   containerd://9431efb3d765e0f0d32365c355f22f2ba6efb2afd219eb5bf2a5715419940e6c
    Image:          docker.io/datastax/cass-config-builder:1.0.4
    Image ID:       docker.io/datastax/cass-config-builder@sha256:7b12c7303356307f451380e11f13be12dfb3aa33e6dd5b9e1704d89bacf9226a
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       OOMKilled
      Exit Code:    137
      Started:      Sat, 06 May 2023 00:58:06 +0530
      Finished:     Sat, 06 May 2023 00:58:12 +0530
    Ready:          False
    Restart Count:  2
    Limits:
      cpu:     1
      memory:  256M
    Requests:
      cpu:     1
      memory:  256M

I have tried to declare like this but it seems it is not picking up

  initContainers:
    name: server-config-init
    resources:
      limits:
        cpu: 2
        memory: 1024M
      requests:
        cpu: 2
        memory: 1024M
@anihe85 anihe85 added the enhancement New feature or request label May 8, 2023
@olim7t
Copy link

olim7t commented May 23, 2023

Hi @anihe85,

I was able to customize the limits, here is a full cluster definition:

apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
  namespace: k8ssandra-operator
  name: demo
spec:
  cassandra:
    serverVersion: 4.0.6

    initContainers:
      - name: server-config-init
        resources:
          limits:
            cpu: 2
            memory: 1024M
          requests:
            cpu: 2
            memory: 1024M

    datacenters:
      - metadata:
          name: dc1
        size: 1
        racks:
          - name: rack1
            nodeAffinityLabels:
              "topology.kubernetes.io/zone": region1-zone1
        storageConfig:
          cassandraDataVolumeClaimSpec:
            storageClassName: standard
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 100Mi
        # (you can also have a per-DC `initContainers` at this level)

Checking the values once the pod is created:

kubectl get pod demo-dc1-rack1-sts-0 -o yaml -nk8ssandra-operator \
  | yq '.spec.initContainers[0] | {"name": .name, "resources": .resources}'

name: server-config-init
resources:
  limits:
    cpu: "2"
    memory: 1024M
  requests:
    cpu: "2"
    memory: 1024M

It would also be interesting to find out why the container OOM'ed in the first place, did you capture any logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants