Merge pull request #2160 from brandond/dqlite_args

Remove lingering references to dqlite
This commit is contained in:
Brad Davidson 2020-08-25 21:43:09 -07:00 committed by GitHub
commit 9687d814d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 16 deletions

View File

@ -1,7 +0,0 @@
// +build dqlite
package cmds
const (
hideDqlite = false
)

7
pkg/cli/cmds/etcd.go Normal file
View File

@ -0,0 +1,7 @@
// +build !no_etcd
package cmds
const (
hideClusterFlags = false
)

View File

@ -1,7 +1,7 @@
// +build !dqlite
// +build no_etcd
package cmds
const (
hideDqlite = true
hideClusterFlags = true
)

View File

@ -275,21 +275,22 @@ func NewServerCommand(action func(*cli.Context) error) *cli.Command {
},
&cli.StringFlag{
Name: "server,s",
Hidden: hideClusterFlags,
Usage: "(experimental/cluster) Server to connect to, used to join a cluster",
EnvVars: []string{version.ProgramUpper + "_URL"},
Destination: &ServerConfig.ServerURL,
},
&cli.BoolFlag{
Name: "cluster-init",
Hidden: hideDqlite,
Usage: "(experimental/cluster) Initialize new cluster master",
Hidden: hideClusterFlags,
Usage: "(experimental/cluster) Initialize a new cluster",
EnvVars: []string{version.ProgramUpper + "_CLUSTER_INIT"},
Destination: &ServerConfig.ClusterInit,
},
&cli.BoolFlag{
Name: "cluster-reset",
Hidden: hideDqlite,
Usage: "(experimental/cluster) Forget all peers and become a single cluster new cluster master",
Hidden: hideClusterFlags,
Usage: "(experimental/cluster) Forget all peers and become sole member of a new cluster",
EnvVars: []string{version.ProgramUpper + "_CLUSTER_RESET"},
Destination: &ServerConfig.ClusterReset,
},

View File

@ -11,7 +11,7 @@ DEBUG=1
## K3S DB VARIABLES ##
##########################
DB_ENGINE="dqlite"
DB_ENGINE="embedded-etcd"
DB_INSTANCE_TYPE="db.m4.4xlarge"
DB_NAME="k3s"
DB_USERNAME="k3suser"

View File

@ -25,7 +25,7 @@ write_files:
fi
while true; do
if [ ${db_engine} == "dqlite" ]; then
if [ ${db_engine} == "embedded-etcd" ]; then
curl -sfL https://get.k3s.io | K3S_CLUSTER_SECRET="${k3s_cluster_secret}" \
INSTALL_K3S_VERSION="${install_k3s_version}" \
INSTALL_K3S_EXEC="${k3s_server_args} --cluster-cidr=10.0.0.0/8 --no-deploy traefik --no-deploy servicelb --tls-san ${lb_address} %{ if master_index != 0 } --server https://${lb_address}:6443 %{ else } --cluster-init %{ endif }" sh -

View File

@ -156,7 +156,7 @@ resource "aws_instance" "k3s-server" {
install_k3s_version = local.install_k3s_version,
k3s_server_args = var.k3s_server_args,
db_engine = var.db_engine,
db_address = "${var.db_engine == "etcd" ? join(",",aws_instance.k3s_etcd.*.private_ip) : var.db_engine == "dqlite" ? "null" : aws_db_instance.k3s_db[0].address}",
db_address = "${var.db_engine == "etcd" ? join(",",aws_instance.k3s_etcd.*.private_ip) : var.db_engine == "embedded-etcd" ? "null" : aws_db_instance.k3s_db[0].address}",
db_name = var.db_name,
db_username = var.db_username,
db_password = var.db_password,