37 lines
1.0 KiB
HCL
37 lines
1.0 KiB
HCL
resource "ncloud_lb" "jh-ncloud-test-lb" {
|
|
name = "kube-api-server-lb"
|
|
network_type = "PRIVATE"
|
|
type = "APPLICATION"
|
|
subnet_no_list = [ ncloud_subnet.loadbalancer_subnet.subnet_no ]
|
|
}
|
|
|
|
resource "ncloud_lb_target_group" "jh-ncloud-test-lb-group" {
|
|
vpc_no = ncloud_vpc.jh-test-ncloud-vpc.vpc_no
|
|
protocol = "HTTPS"
|
|
target_type = "VSVR"
|
|
port = 6443
|
|
|
|
health_check {
|
|
protocol = "HTTPS"
|
|
http_method = "GET"
|
|
port = 6443
|
|
url_path = "/livez?verbose"
|
|
cycle = 30
|
|
up_threshold = 3
|
|
down_threshold = 3
|
|
}
|
|
algorithm_type = "RR"
|
|
}
|
|
|
|
resource "ncloud_lb_target_group_attachment" "jh-ncloud-test-lb-attach" {
|
|
target_group_no = ncloud_lb_target_group.jh-ncloud-test-lb-group.target_group_no
|
|
target_no_list = [ ncloud_server.jh-test-ncloud-master.instance_no ]
|
|
}
|
|
|
|
resource "ncloud_lb_listener" "jh-ncloud-test-lb-listener" {
|
|
load_balancer_no = ncloud_lb.jh-ncloud-test-lb.load_balancer_no
|
|
protocol = "HTTPS"
|
|
port = 6443
|
|
target_group_no = ncloud_lb_target_group.jh-ncloud-test-lb-group.target_group_no
|
|
ssl_certificate_no = 20941
|
|
} |