Skip to content

Commit

Permalink
update wireguard installation
Browse files Browse the repository at this point in the history
  • Loading branch information
jawabuu committed May 10, 2021
1 parent 2a5476f commit db5bfc6
Show file tree
Hide file tree
Showing 63 changed files with 708 additions and 721 deletions.
44 changes: 22 additions & 22 deletions deploy/alicloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ module "ssh" {
module "provider" {
source = "../../provider/alicloud"

alicloud_access_key = var.alicloud_access_key
alicloud_secret_key = var.alicloud_secret_key
region = var.alicloud_region
region_zone = var.alicloud_region_zone
size = var.alicloud_size
image = var.alicloud_image
hosts = var.node_count
hostname_format = var.hostname_format
ssh_key_path = module.ssh.private_key #var.ssh_key_path Override to use predefined key
ssh_pubkey_path = module.ssh.public_key #var.ssh_pubkey_path Override to use predefined key
alicloud_access_key = var.alicloud_access_key
alicloud_secret_key = var.alicloud_secret_key
region = var.alicloud_region
region_zone = var.alicloud_region_zone
size = var.alicloud_size
image = var.alicloud_image
hosts = var.node_count
hostname_format = var.hostname_format
ssh_key_path = module.ssh.private_key #var.ssh_key_path Override to use predefined key
ssh_pubkey_path = module.ssh.public_key #var.ssh_pubkey_path Override to use predefined key
}

module "swap" {
Expand All @@ -30,7 +30,7 @@ module "swap" {

## Comment out if you do not have a domain ###
module "dns" {
source = "../../dns/digitalocean"
source = "../../dns/digitalocean"

node_count = var.node_count
token = var.digitalocean_token
Expand All @@ -55,15 +55,15 @@ module "wireguard" {
module "firewall" {
source = "../../security/ufw"

node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
}

module "k3s" {
Expand All @@ -73,7 +73,7 @@ module "k3s" {
connections = module.provider.public_ips
cluster_name = var.domain
vpn_interface = module.wireguard.vpn_interface #module.provider.private_network_interface
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
hostname_format = var.hostname_format
ssh_key_path = module.ssh.private_key
k3s_version = var.k3s_version
Expand Down Expand Up @@ -104,7 +104,7 @@ output "public_key" {
}

output "ssh-master" {
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0],"localhost")}"
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0], "localhost")}"
}

output "instances" {
Expand Down
14 changes: 7 additions & 7 deletions deploy/alicloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ variable "create_zone" {
}

variable "cni" {
default = "cilium"
default = "cilium"
description = "Choice of CNI to install e.g. flannel, weave, cilium, calico"
}

variable "overlay_cidr" {
default = "10.42.0.0/16"
default = "10.42.0.0/16"
description = "Cluster cidr"
}

variable "ha_cluster" {
default = false
default = false
description = "Create highly available cluster. Currently experimental and requires node_count >= 3"
}

Expand Down Expand Up @@ -81,7 +81,7 @@ variable "longhorn_replicas" {
variable "install_app" {
description = "Additional apps to Install"
type = map
default = {
default = {
kubernetes_dashboard = true
kube_prometheus = false
k8dash = false
Expand All @@ -97,12 +97,12 @@ variable "additional_rules" {
}

variable "auth_user" {
default = "kloud-3s"
default = "kloud-3s"
description = "Traefik basic auth username"
}

variable "auth_password" {
default = ""
default = ""
description = "Traefik basic auth password"
}

Expand All @@ -121,7 +121,7 @@ variable "alicloud_region" {
}

variable "alicloud_region_zone" {
type = string
type = string
default = "eu-central-1a"
}

Expand Down
24 changes: 12 additions & 12 deletions deploy/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module "swap" {

## Comment out if you do not have a domain ###
module "dns" {
source = "../../dns/digitalocean"
source = "../../dns/digitalocean"

node_count = var.node_count
token = var.digitalocean_token
Expand All @@ -55,15 +55,15 @@ module "wireguard" {
module "firewall" {
source = "../../security/ufw"

node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
}

module "k3s" {
Expand All @@ -73,7 +73,7 @@ module "k3s" {
connections = module.provider.public_ips
cluster_name = var.domain
vpn_interface = module.wireguard.vpn_interface #module.provider.private_network_interface
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
hostname_format = var.hostname_format
ssh_key_path = module.ssh.private_key
k3s_version = var.k3s_version
Expand Down Expand Up @@ -104,7 +104,7 @@ output "public_key" {
}

output "ssh-master" {
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0],"localhost")}"
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0], "localhost")}"
}

output "instances" {
Expand Down
14 changes: 7 additions & 7 deletions deploy/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ variable "create_zone" {
}

variable "cni" {
default = "cilium"
default = "cilium"
description = "Choice of CNI to install e.g. flannel, weave, cilium, calico"
}

variable "overlay_cidr" {
default = "10.42.0.0/16"
default = "10.42.0.0/16"
description = "Cluster cidr"
}

variable "ha_cluster" {
default = false
default = false
description = "Create highly available cluster. Currently experimental and requires node_count >= 3"
}

Expand Down Expand Up @@ -81,7 +81,7 @@ variable "longhorn_replicas" {
variable "install_app" {
description = "Additional apps to Install"
type = map
default = {
default = {
kubernetes_dashboard = true
kube_prometheus = false
k8dash = false
Expand All @@ -97,19 +97,19 @@ variable "additional_rules" {
}

variable "auth_user" {
default = "kloud-3s"
default = "kloud-3s"
description = "Traefik basic auth username"
}

variable "auth_password" {
default = ""
default = ""
description = "Traefik basic auth password"
}

/* aws */

variable "aws_region_zone" {
type = string
type = string
default = "eu-west-1c"
}

Expand Down
24 changes: 12 additions & 12 deletions deploy/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module "swap" {

## Comment out if you do not have a domain ###
module "dns" {
source = "../../dns/digitalocean"
source = "../../dns/digitalocean"

node_count = var.node_count
token = var.digitalocean_token
Expand All @@ -56,15 +56,15 @@ module "wireguard" {
module "firewall" {
source = "../../security/ufw"

node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
additional_rules = var.additional_rules
}

module "k3s" {
Expand All @@ -74,7 +74,7 @@ module "k3s" {
connections = module.provider.public_ips
cluster_name = var.domain
vpn_interface = module.wireguard.vpn_interface #module.provider.private_network_interface
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
hostname_format = var.hostname_format
ssh_key_path = module.ssh.private_key
k3s_version = var.k3s_version
Expand Down Expand Up @@ -105,7 +105,7 @@ output "public_key" {
}

output "ssh-master" {
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0],"localhost")}"
value = "ssh -i ${abspath(module.ssh.private_key)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${try(module.provider.public_ips[0], "localhost")}"
}

output "instances" {
Expand Down
22 changes: 11 additions & 11 deletions deploy/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ variable "create_zone" {
}

variable "cni" {
default = "cilium"
default = "cilium"
description = "Choice of CNI to install e.g. flannel, weave, cilium, calico"
}

variable "overlay_cidr" {
default = "10.42.0.0/16"
default = "10.42.0.0/16"
description = "Cluster cidr"
}

variable "ha_cluster" {
default = false
default = false
description = "Create highly available cluster. Currently experimental and requires node_count >= 3"
}

Expand Down Expand Up @@ -81,7 +81,7 @@ variable "longhorn_replicas" {
variable "install_app" {
description = "Additional apps to Install"
type = map
default = {
default = {
kubernetes_dashboard = true
kube_prometheus = false
k8dash = false
Expand All @@ -97,39 +97,39 @@ variable "additional_rules" {
}

variable "auth_user" {
default = "kloud-3s"
default = "kloud-3s"
description = "Traefik basic auth username"
}

variable "auth_password" {
default = ""
default = ""
description = "Traefik basic auth password"
}

/* azure */

variable "client_id" {
type = string
type = string
default = ""
}

variable "client_secret" {
type = string
type = string
default = ""
}

variable "tenant_id" {
type = string
type = string
default = ""
}

variable "subscription_id" {
type = string
type = string
default = ""
}

variable "azure_region" {
type = string
type = string
default = "West Europe"
}

Expand Down
Loading

0 comments on commit db5bfc6

Please sign in to comment.