Closed graphicore closed 5 years ago
New incident reported here: https://github.com/googlefonts/fontbakery/issues/2010 Maybe the frequency is around ~ 10 days Restarted the DB pods with the commands from above.
The message from the rethink replica logs above:
No other nodes detected, will be a single instance.
is from the run.sh
script: https://github.com/rosskukulinski/rethinkdb-kubernetes/blob/master/run.sh
So at that point we can probably modify the command or replace it so that the pod fails and enters the k8s crashback loop until other instances to join are detected.
Apparently the Helm rethinkdb chart (=package, implementation), which is developed taking up from the rethinkdb-kubernetes we're using, ensures staring the rethink-cluster nodes using a StatefulSet, which ensures pods are started in order and more (from the docs):
StatefulSets are valuable for applications that require one or more of the following.
- Stable, unique network identifiers.
- Stable, persistent storage.
- Ordered, graceful deployment and scaling.
- Ordered, automated rolling updates.
That should solve the problem of this issue. Though, since we have already existing SSD-disks (persistent volumes) that we want to re-use: here seems to be the most important part of the answer: manually provisioning a regional pd persistentvolume. I'm hoping the ends meet in the middle, e.g. how to ensure the pods spawn in the zone where their volumes are (nodeAffinity).
This does not solve the "similar" helm/charts issue from above. Of witch I'm not sure if it ever happened to us. Rethink-proxies may be able to either join via a service (see comment) or to die and restart rethinkdb cli-options:
--cluster-reconnect-timeout secs
: the amount of time, in seconds, this server will try to reconnect to a cluster if it loses connection before giving up; default86400
Or we can have cluster servers join existing proxies see comment, also an interesting idea.
AND Using Stable Network Identities!. Money quote:
The Pods’ ordinals, hostnames, SRV records, and A record names have not changed, but the IP addresses associated with the Pods may have changed. In the cluster used for this tutorial, they have. This is why it is important not to configure other applications to connect to Pods in a StatefulSet by IP address."
About my question from above:
How to ensure the pods spawn in the zone where their volumes are?
Persistent storage in regional clusters:
Once a persistent disk is provisioned, any Pods referencing the disk are scheduled to the same zone as the disk.
That's a hint, seem like we don't need the affinity
at all, because the pods follow their disks!
More good documentation about Using preexisting persistent disks as PersistentVolumes
Very interesting: Regional Persistent Disks
Regional persistent disks replicate data between two zones in the same region, and can be used similarly to regular persistent disks. In the event of a zonal outage, Kubernetes can failover workloads using the volume to the other zone. You can use regional persistent disks to build highly available solutions for stateful workloads on GKE. Users must ensure that both the primary and failover zones are configured with enough resource capacity to run the workload.
Seems like the database (rethink) cluster is not finding it's nodes correctly when not started in a particular order. That means, when the db nodes are restarted automatically the db will end up in an not ready state.
here are some logs from db-clients:
Also the same for
fontbakery-manifest-master-6c78d566b5-48hlj
andfontbakery-api-7cd64d55fb-vnsfz
TODO Fix DB initialisation!
in
http://localhost:8001/api/v1/namespaces/default/services/rethinkdb-admin/proxy/
we have (3) issues about "Table availability", like this:
Rethink db servers will log that they didn't found a cluster and will stay single, Money quote:
from ~
rethinkdb-replica-1-77495f8f89-lj68b
~rethinkdb_replica_2_7d74bcb558_lq5hx
(obviously):Turning it off and on again:
This is manually stopping and restarting all rethinkdb related pods, in the right order. Just a quick and dirty fix.
Now all dependent pods need to be restarted (or will be restarted by the kubernetes restart/backoff mechanics)