Skip to content

Commit

Permalink
chore: clean up options
Browse files Browse the repository at this point in the history
fix: cleanup
  • Loading branch information
drpebcak committed Jun 10, 2022
1 parent 0b9dd8d commit 8cf2f92
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ No modules.
| <a name="input_k3s_cluster_secret"></a> [k3s\_cluster\_secret](#input\_k3s\_cluster\_secret) | Override to set k3s cluster registration secret | `string` | `null` | no |
| <a name="input_k3s_datastore_cafile"></a> [k3s\_datastore\_cafile](#input\_k3s\_datastore\_cafile) | Location to download RDS CA Bundle | `string` | `"/srv/rds-combined-ca-bundle.pem"` | no |
| <a name="input_k3s_datastore_endpoint"></a> [k3s\_datastore\_endpoint](#input\_k3s\_datastore\_endpoint) | Storage Backend for K3S cluster to use. Valid options are 'sqlite' or 'postgres' | `string` | `"sqlite"` | no |
| <a name="input_k3s_deploy_traefik"></a> [k3s\_deploy\_traefik](#input\_k3s\_deploy\_traefik) | Configures whether to deploy traefik ingress or not | `bool` | `true` | no |
| <a name="input_k3s_disable_agent"></a> [k3s\_disable\_agent](#input\_k3s\_disable\_agent) | Whether to run the k3s agent on the same host as the k3s server | `bool` | `false` | no |
| <a name="input_k3s_tls_san"></a> [k3s\_tls\_san](#input\_k3s\_tls\_san) | Sets k3s tls-san flag to this value instead of the default load balancer | `string` | `null` | no |
| <a name="input_letsencrypt_email"></a> [letsencrypt\_email](#input\_letsencrypt\_email) | LetsEncrypt email address to use | `string` | `"[email protected]"` | no |
Expand Down
6 changes: 2 additions & 4 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ data "cloudinit_config" "k3s_server" {
k3s_datastore_endpoint = local.k3s_datastore_endpoint,
k3s_datastore_cafile = local.k3s_datastore_cafile,
k3s_disable_agent = local.k3s_disable_agent,
k3s_tls_san = local.k3s_tls_san,
k3s_deploy_traefik = local.k3s_deploy_traefik
k3s_tls_san = local.k3s_tls_san
})
}

Expand Down Expand Up @@ -127,8 +126,7 @@ data "cloudinit_config" "k3s_agent" {
k3s_datastore_endpoint = local.k3s_datastore_endpoint,
k3s_datastore_cafile = local.k3s_datastore_cafile,
k3s_disable_agent = local.k3s_disable_agent,
k3s_tls_san = local.k3s_tls_san,
k3s_deploy_traefik = local.k3s_deploy_traefik
k3s_tls_san = local.k3s_tls_san
})
}
}
2 changes: 1 addition & 1 deletion files/k3s-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ curl -o ${k3s_datastore_cafile} https://s3.amazonaws.com/rds-downloads/rds-combi
%{ endif }
%{ endif }

until (curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v${install_k3s_version}' INSTALL_K3S_EXEC='%{ if is_k3s_server }${k3s_tls_san} ${k3s_disable_agent} ${k3s_deploy_traefik} %{ endif}${k3s_exec}' K3S_TOKEN='${k3s_cluster_secret}' %{ if is_k3s_server }%{ if k3s_datastore_endpoint != "sqlite" }K3S_DATASTORE_CAFILE='${k3s_datastore_cafile}'%{ endif } %{ if k3s_datastore_endpoint != "sqlite" }K3S_DATASTORE_ENDPOINT='${k3s_datastore_endpoint}'%{ endif } %{ endif }%{ if !is_k3s_server } K3S_URL='https://${k3s_url}:6443'%{ endif } sh -); do
until (curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v${install_k3s_version}' INSTALL_K3S_EXEC='%{ if is_k3s_server }${k3s_tls_san} ${k3s_disable_agent} %{ endif}${k3s_exec}' K3S_TOKEN='${k3s_cluster_secret}' %{ if is_k3s_server }%{ if k3s_datastore_endpoint != "sqlite" }K3S_DATASTORE_CAFILE='${k3s_datastore_cafile}'%{ endif } %{ if k3s_datastore_endpoint != "sqlite" }K3S_DATASTORE_ENDPOINT='${k3s_datastore_endpoint}'%{ endif } %{ endif }%{ if !is_k3s_server } K3S_URL='https://${k3s_url}:6443'%{ endif } sh -); do
echo 'k3s did not install correctly'
sleep 2
done
Expand Down
3 changes: 0 additions & 3 deletions files/rancher-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,3 @@ spec:
EOF
%{ endif }
%{ endif }

curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.22.9+k3s1' INSTALL_K3S_EXEC='--tls-san rancher-mgmt-int-regular-e219418f57fe582a.elb.us-east-1.amazonaws.com --no-deploy local-storage --disable traefik --disable servicelb' K3S_TOKEN='Tickled25Breaded10siberia' K3S_DATASTORE_CAFILE='/srv/rds-combined-ca-bundle.pem' K3S_DATASTORE_ENDPOINT='postgres://k3s:claimed30Whitman@rancher-mgmt-20211028044607251000000003.cluster-cijvgx1emidk.us-east-1.rds.amazonaws.com/k3s' sh -
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.22.9+k3s1' INSTALL_K3S_EXEC='' K3S_TOKEN='Tickled25Breaded10siberia' K3S_URL='https://rancher-mgmt-int-regular-e219418f57fe582a.elb.us-east-1.amazonaws.com:6443' sh -
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ locals {
k3s_datastore_endpoint = var.k3s_datastore_endpoint == "sqlite" ? null : "postgres://${local.db_user}:${local.db_pass}@${aws_rds_cluster.k3s.0.endpoint}/${local.db_name}"
k3s_disable_agent = var.k3s_disable_agent ? "--disable-agent" : ""
k3s_tls_san = var.k3s_tls_san != null ? var.k3s_tls_san : "--tls-san ${aws_lb.server-lb.dns_name}"
k3s_deploy_traefik = var.k3s_deploy_traefik ? "" : "--no-deploy traefik"
server_k3s_exec = var.server_k3s_exec != null ? var.server_k3s_exec : ""
agent_k3s_exec = var.agent_k3s_exec != null ? var.agent_k3s_exec : ""
certmanager_version = var.certmanager_version
Expand Down
8 changes: 1 addition & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@ variable "k3s_tls_san" {
description = "Sets k3s tls-san flag to this value instead of the default load balancer"
}

variable "k3s_deploy_traefik" {
default = true
type = bool
description = "Configures whether to deploy traefik ingress or not"
}

variable "rancher2_token_key" {
default = null
type = string
Expand All @@ -278,7 +272,7 @@ variable "agent_k3s_exec" {
}

variable "server_k3s_exec" {
default = "--disable traefik --disable servicelb"
default = "--disable traefik --disable servicelb --no-deploy local-storage"
type = string
description = "exec args to pass to k3s server"
}
Expand Down

0 comments on commit 8cf2f92

Please sign in to comment.