-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from aigisuk/develop
☁️ add cluster/database firewalls; pre-install cert-manager
- Loading branch information
Showing
12 changed files
with
142 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "digitalocean_database_firewall" "k3s" { | ||
|
||
cluster_id = digitalocean_database_cluster.k3s.id | ||
|
||
rule { | ||
type = "tag" | ||
value = local.server_droplet_tag | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
resource "digitalocean_firewall" "ccm_firewall" { | ||
name = "ccm-firewall" | ||
|
||
outbound_rule { | ||
protocol = "icmp" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
} | ||
|
||
resource "digitalocean_firewall" "k3s_firewall" { | ||
name = "k3s-firewall" | ||
|
||
tags = [local.server_droplet_tag, local.agent_droplet_tag] | ||
|
||
inbound_rule { | ||
# Allow ICMP communication on all ports to defined 'tags' via VPC Network | ||
protocol = "icmp" | ||
source_addresses = [var.vpc_network_range] | ||
} | ||
|
||
inbound_rule { | ||
# Allow TCP communication on all ports to defined 'tags' via VPC Network | ||
protocol = "tcp" | ||
port_range = "1-65535" | ||
source_addresses = [var.vpc_network_range] | ||
} | ||
|
||
inbound_rule { | ||
# Allow UDP communication on all ports to defined 'tags' via VPC Network | ||
protocol = "udp" | ||
port_range = "1-65535" | ||
source_addresses = [var.vpc_network_range] | ||
} | ||
|
||
inbound_rule { | ||
# Allow SSH access from all hosts | ||
protocol = "tcp" | ||
port_range = "22" | ||
source_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
|
||
outbound_rule { | ||
protocol = "udp" | ||
port_range = "1-65535" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
|
||
outbound_rule { | ||
protocol = "tcp" | ||
port_range = "1-65535" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
resource "digitalocean_vpc" "k3s_vpc" { | ||
name = "k3s-vpc-01" | ||
region = var.region | ||
name = "k3s-vpc-01" | ||
region = var.region | ||
ip_range = var.vpc_network_range | ||
} |