docker-library / cassandra

Docker Official Image packaging for Cassandra
Apache License 2.0
262 stars 282 forks source link

Readiness probe failed On Kubernetes: /bin/bash: /ready-probe.sh: No such file or directory #240

Closed amleshk66 closed 2 years ago

amleshk66 commented 2 years ago

Hi,

I have deployed Cassandra on Kubernetes but when i am starting i am getting below issues.

Readiness probe failed: /bin/bash: /ready-probe.sh: No such file or directory

Below is My stateful script.. Your support will be great help to me:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: cassandra
  labels:
    app: cassandra
spec:
  serviceName: cassandra
  replicas: 2
  selector:
    matchLabels:
      app: cassandra
  template:
    metadata:
      labels:
        app: cassandra
    spec:
      terminationGracePeriodSeconds: 1800
      containers:
      - name: cassandra
        image: cassandra
        imagePullPolicy: Always
        ports:
        - containerPort: 7000
          name: intra-node
        - containerPort: 7001
          name: tls-intra-node
        - containerPort: 7199
          name: jmx
        - containerPort: 9042
          name: cql
        resources:
          limits:
            cpu: "500m"
            memory: 1Gi
          requests:
            cpu: "500m"
            memory: 1Gi
        securityContext:
          capabilities:
            add:
              - IPC_LOCK
        lifecycle:
          preStop:
            exec:
              command:
              - /bin/sh
              - -c
              - nodetool drain
        env:
          - name: MAX_HEAP_SIZE
            value: 512M
          - name: HEAP_NEWSIZE
            value: 100M
          - name: CASSANDRA_SEEDS
            value: "cassandra-0.cassandra.casandra.svc.cluster.local"
          - name: CASSANDRA_CLUSTER_NAME
            value: "K8Demo"
          - name: CASSANDRA_DC
            value: "DC1-K8Demo"
          - name: CASSANDRA_RACK
            value: "Rack1-K8Demo"
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
        readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - /ready-probe.sh
          initialDelaySeconds: 15
          timeoutSeconds: 5
        # These volume mounts are persistent. They are like inline claims,
        # but not exactly because the names need to match exactly one of
        # the stateful pod volumes.
        volumeMounts:
        - name: cassandra-data
          mountPath: /data
wglambert commented 2 years ago

Yeah that tutorial uses a readinessProbe

readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - /ready-probe.sh

If you change the image line back to image: gcr.io/google-samples/cassandra:v13 it should work. It uses this custom image https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile

This is the github repo for that tutorial https://github.com/kubernetes/examples/tree/master/cassandra

And since that's not our image so I'm going to close. If you need further help you could try asking over at Stack Overflow. Since these repos aren't really a user-help forum

djuwa4 commented 2 years ago

Yeah that tutorial uses a readinessProbe

readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - /ready-probe.sh

If you change the image line back to image: gcr.io/google-samples/cassandra:v13 it should work. It uses this custom image https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile

This is the github repo for that tutorial https://github.com/kubernetes/examples/tree/master/cassandra

And since that's not our image so I'm going to close. If you need further help you could try asking over at Stack Overflow. Since these repos aren't really a user-help forum

I am using the correct image but getting the same error. My image: gcr.io/google-samples/cassandra:v13

yosifkit commented 2 years ago

The gcr.io/google-samples/cassandra image is not related to the images we build from the Dockerfiles in this repo. Please go to their docs repo or some other user help forum like StackOverflow.