Skip to content

Commit

Permalink
Merge pull request #19 from nimbolus/add-install-k3s-url-var
Browse files Browse the repository at this point in the history
add k3s_install_url variable
  • Loading branch information
lu1as authored May 4, 2022
2 parents f30007c + 25bb43b commit f800460
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions k3s-hcloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module "k3s" {
k3s_join_existing = var.k3s_join_existing
cluster_token = var.cluster_token
k3s_version = var.k3s_version
k3s_channel = var.k3s_channel
k3s_install_url = var.k3s_install_url
k3s_ip = var.k3s_ip != null ? var.k3s_ip : local.internal_ip_command
k3s_url = var.k3s_url
k3s_external_ip = var.k3s_external_ip != null ? var.k3s_external_ip : local.external_ip_command
Expand Down
1 change: 1 addition & 0 deletions k3s-openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module "k3s" {
cluster_token = var.cluster_token
k3s_version = var.k3s_version
k3s_channel = var.k3s_channel
k3s_install_url = var.k3s_install_url
k3s_ip = openstack_networking_port_v2.mgmt.all_fixed_ips[0]
k3s_url = var.k3s_url
k3s_external_ip = var.k3s_external_ip != null ? var.k3s_external_ip : local.node_external_ip
Expand Down
2 changes: 1 addition & 1 deletion k3s/cloud-init/k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runcmd:
- export INSTALL_K3S_EXEC="$INSTALL_K3S_EXEC --node-external-ip=${external_ip}"
%{endif~}
- bash -c "for i in {1..6}; do (ping -c 10 -q github.com) && break || (echo 'failed to verify network, will try again soon'); done"
- curl -sfL https://get.k3s.io | sh -
- curl -sfL ${k3s_install_url} | sh -
# install cni plugins
- wget --no-verbose -O /tmp/cni-plugins.tgz https://github.com/containernetworking/plugins/releases/download/${cni_plugins_version}/cni-plugins-linux-amd64-${cni_plugins_version}.tgz
- mkdir -p /opt/cni/bin
Expand Down
1 change: 1 addition & 0 deletions k3s/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ output "user_data" {
persistent_volume_dev = var.persistent_volume_dev
persistent_volume_label = var.persistent_volume_label
is_server = contains(var.k3s_args, "server")
k3s_install_url = var.k3s_install_url
k3s_config = base64encode(<<-EOT
K3S_TOKEN=${var.cluster_token}
K3S_URL=${var.k3s_url}
Expand Down
5 changes: 5 additions & 0 deletions k3s/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ variable "k3s_channel" {
description = "channel to use for fetching k3s download URL, could be stable, latest or testing (overridden by k3s_version)"
}

variable "k3s_install_url" {
default = "https://get.k3s.io"
description = "download url for installation script"
}

variable "k3s_ip" {
type = string
default = null
Expand Down

0 comments on commit f800460

Please sign in to comment.