cluster: k0: move cockroachdb away from bc01n01, fixup joins
Reminded by a power failure on bc01n0{1,2}, we migrate away from at
least one of them into another server.
We also fix up the startup join parameter to not include the node itself
(which is not necessary, but a nice thing to have nonetheless).
Since bc01n01 was the initial node of the cluster, we also disable the
init job for k0 (which we don't care about anyway).
Change-Id: I3406471c0f9542e9d802d39138e400b5a5e74794
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1176
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/cluster/kube/lib/cockroachdb.libsonnet b/cluster/kube/lib/cockroachdb.libsonnet
index 2486570..dff2ebd 100644
--- a/cluster/kube/lib/cockroachdb.libsonnet
+++ b/cluster/kube/lib/cockroachdb.libsonnet
@@ -215,6 +215,13 @@
},
},
spec+: {
+ strategy+: {
+ type: "RollingUpdate",
+ rollingUpdate: {
+ maxSurge: 0,
+ maxUnavailable: 1,
+ },
+ },
template+: {
metadata: server.deploy.metadata,
spec+: {
@@ -287,7 +294,7 @@
"--certs-dir", "/cockroach/cockroach-certs",
"--advertise-host", "%s.cluster.local" % server.service.host,
"--cache", "25%", "--max-sql-memory", "25%",
- "--join", std.join(",", ["%s.cluster.local:%d" % [s.service.host, cluster.cfg.portServe] for s in cluster.servers]),
+ "--join", std.join(",", ["%s.cluster.local:%d" % [s.service.host, cluster.cfg.portServe] for s in cluster.servers if s.service.host != server.service.host]),
"--listen-addr=0.0.0.0:%d" % cluster.cfg.portServe,
"--http-addr=0.0.0.0:%d" % cluster.cfg.portHttp,
],