scylladb / scylla-code-samples

Code samples for working with ScyllaDB
Apache License 2.0
243 stars 131 forks source link

Scylla readiness probe does not work #132

Open yuha0 opened 4 years ago

yuha0 commented 4 years ago

The readiness probe defined in here:

https://github.com/scylladb/scylla-code-samples/blob/0464f547e2dc3e974d62547cb35ae0f4cc96ebc9/kubernetes-scylla/scylla-statefulset.yaml#L58

It uses exec to execute the probe script, which will always return 0.

➤ kubectl get pods scylla-2
NAME       READY   STATUS    RESTARTS   AGE
scylla-2   1/1     Running   0          15m

➤ kubectl exec scylla-2 bash /opt/ready-probe.sh
command terminated with exit code 1

➤ kubectl exec scylla-2 -- bash -c exec /opt/ready-probe.sh
(returned 0 here)

➤ kubectl get pods scylla-2 -ojsonpath='{.spec.containers[].readinessProbe}'
map[exec:map[command:[/bin/bash -c exec /opt/ready-probe.sh]] failureThreshold:3 initialDelaySeconds:15 periodSeconds:10 successThreshold:1 timeoutSeconds:5]
tzach commented 4 years ago

@dahankzter is this example relevant? If its out of date we can (should) kill it and direct users to https://github.com/scylladb/scylla-operator

dahankzter commented 4 years ago

It's very much obsolete and we should either change it here or redirect them to the operator repo.

yuha0 commented 4 years ago

Unless the plan is to make the operator the only way to deploy scylla in k8s, I think a standalone example as a statefulset is still useful.

Also, I took a look at the operator and looks like it uses a sidecar to run nodetool and exposes an http endpoint. That is definitely a nicer interface, but the idea is the same.

dahankzter commented 4 years ago

The idea of the operator isn't to make it impossible the deploy scylla without it but simply to make it easier. It will be hard to keep these examples in sync though as time goes by but personally I don't mind it all.