Skip to content

Commit

Permalink
Update k8s.tf and network.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapha-Borges committed Jan 13, 2024
1 parent f3c6c11 commit 9fa8ac5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 42 deletions.
10 changes: 9 additions & 1 deletion cluster/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ resource "oci_containerengine_node_pool" "k8s_node_pool" {
name = "k8s-node-pool"
node_config_details {
placement_configs {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[var.availability_domain].name
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
subnet_id = var.vcn_private_subnet_id
}
placement_configs {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[1].name
subnet_id = var.vcn_private_subnet_id
}
placement_configs {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[2].name
subnet_id = var.vcn_private_subnet_id
}
size = var.node_size
Expand Down
3 changes: 0 additions & 3 deletions cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ variable "ocpus_per_node" {
variable "image_id" {
}

variable "availability_domain" {
}

variable "ssh_public_key" {
}

Expand Down
64 changes: 32 additions & 32 deletions network/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "oci_core_security_list" "private_subnet_sl" {

ingress_security_rules {
stateless = false
source = "10.0.0.0/16"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
protocol = "all"
}
Expand All @@ -34,43 +34,43 @@ resource "oci_core_security_list" "public_subnet_sl" {

ingress_security_rules {
stateless = false
source = "10.0.0.0/16"
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
protocol = "all"
}

ingress_security_rules {
stateless = false
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
protocol = "6"
tcp_options {
min = 6443
max = 6443
}
}
# ingress_security_rules {
# stateless = false
# source = "0.0.0.0/0"
# source_type = "CIDR_BLOCK"
# protocol = "6"
# tcp_options {
# min = 6443
# max = 6443
# }
# }

ingress_security_rules {
stateless = false
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
protocol = "6"
tcp_options {
min = 80
max = 80
}
}
# ingress_security_rules {
# stateless = false
# source = "0.0.0.0/0"
# source_type = "CIDR_BLOCK"
# protocol = "6"
# tcp_options {
# min = 80
# max = 80
# }
# }

ingress_security_rules {
stateless = false
source = "0.0.0.0/0"
source_type = "CIDR_BLOCK"
protocol = "6"
tcp_options {
min = 443
max = 443
}
}
# ingress_security_rules {
# stateless = false
# source = "0.0.0.0/0"
# source_type = "CIDR_BLOCK"
# protocol = "6"
# tcp_options {
# min = 443
# max = 443
# }
# }
}

resource "oci_core_subnet" "vcn_private_subnet" {
Expand Down
1 change: 0 additions & 1 deletion terrafile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module "cluster" {
memory_in_gbs_per_node = var.memory_in_gbs_per_node
ocpus_per_node = var.ocpus_per_node
image_id = var.image_id
availability_domain = var.availability_domain
ssh_public_key = var.ssh_public_key
public_subnet_id = module.network.public_subnet_id
vcn_id = module.vcn.vcn_id
Expand Down
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ variable "region" {
default = "us-ashburn-1"
}

variable "availability_domain" {
type = number
default = 0
}

# ---------->VM's----------

variable "shape" {
Expand Down

0 comments on commit 9fa8ac5

Please sign in to comment.