mirror of
https://github.com/rancher/k3k.git
synced 2026-03-04 18:54:14 +00:00
* Default to dynamic persistence and fix HA restarts Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> --------- Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
17 lines
556 B
Go
17 lines
556 B
Go
package server
|
|
|
|
var singleServerTemplate string = `
|
|
if [ -d "{{.ETCD_DIR}}" ]; then
|
|
# if directory exists then it means its not an initial run
|
|
/bin/k3s server --cluster-reset --config {{.INIT_CONFIG}} {{.EXTRA_ARGS}}
|
|
fi
|
|
rm -f /var/lib/rancher/k3s/server/db/reset-flag
|
|
/bin/k3s server --config {{.INIT_CONFIG}} {{.EXTRA_ARGS}}`
|
|
|
|
var HAServerTemplate string = `
|
|
if [ ${POD_NAME: -1} == 0 ] && [ ! -d "{{.ETCD_DIR}}" ]; then
|
|
/bin/k3s server --config {{.INIT_CONFIG}} {{.EXTRA_ARGS}}
|
|
else
|
|
/bin/k3s server --config {{.SERVER_CONFIG}} {{.EXTRA_ARGS}}
|
|
fi`
|