YCDOCIO-4042: updated Terraform manifest [review]#2
YCDOCIO-4042: updated Terraform manifest [review]#2alena-linki wants to merge 2 commits intomainfrom
Conversation
k8s-load-balancer.tf
Outdated
| description = "The rule allows the pod-pod and service-service interaction" | ||
| protocol = "ANY" | ||
| v4_cidr_blocks = [local.zone_a_v4_cidr_blocks] | ||
| v4_cidr_blocks = ["0.0.0.0/0"] |
There was a problem hiding this comment.
Кажется, эта правка некорректна. Взаимодействие тут идет между подами и узлами внутри сети, нет смысла открывать вообще все IP-адреса.
То же относится и к ICMP.
Загляни вот сюда, пожалуйста. На этой странице представлены наиболее актуальные правила для групп безопасности. Задача сейчас в работе, но кажется, что основные правила уже устаканились.
Коллеги проводят эпичный труд по актуализации правил в задаче 4019. Возможно, тебе стоит заглянуть и в саму задачу, не только в сборку.
There was a problem hiding this comment.
Здесь несколько мыслей, которыми хотела бы поделиться:
-
Я внесла правки в плавила группы безопасности, потому что с продовым вариантом нет доступа к приложению, когда разворачиваем внешний балансировщик нагрузки. Как только поправила правила, как сделано в PR, сразу доступ появился. Про это, кстати, есть примечание в доке.
-
Точно ли можно ориентироваться на сборку из тикета 4019? Там все еще выясняют, как должно работать. Стремно ориентироваться на работу, не оконченную по технической части.
-
В доке Данилы нашла опечатку. Передай ему, пожалуйста (не хочу лезть в тот тикет).
There was a problem hiding this comment.
Попробовала развернуть новую инфраструктуру с правилами из сборки Данилы. Использовала CIDR подсети кластера там, где сказано у Данилы. С такими правилами не получается даже создать Deployment, не то что получить доступ к приложению.
Ошибка при создании Deployment: Unable to connect to the server: dial tcp 89.169.158.229:443: i/o timeout.
Как только заменила CIDR подсети на 000, ошибка исчезла. Вот конфиг:
resource "yandex_vpc_security_group" "k8s-main-sg" {
description = "Security group ensure the basic performance of the cluster. Apply it to the cluster and node groups."
name = local.main_security_group_name
network_id = yandex_vpc_network.k8s-network.id
ingress {
description = "The rule allows availability checks from the load balancer's range of addresses. It is required for the operation of a fault-tolerant cluster and load balancer services."
protocol = "TCP"
predefined_target = "loadbalancer_healthchecks"
from_port = 0
to_port = 65535
}
ingress {
description = "The rule allows the master-node and node-node interaction within the security group"
protocol = "ANY"
predefined_target = "self_security_group"
from_port = 0
to_port = 65535
}
ingress {
description = "The rule allows receipt of debugging ICMP packets from internal subnets"
protocol = "ICMP"
v4_cidr_blocks = ["0.0.0.0/0"] # Здесь должен быть CIDR подсети
}
ingress {
description = "The rule allows the pod-pod and service-service interaction. Specify the subnets of your cluster and services."
protocol = "ANY"
v4_cidr_blocks = ["0.0.0.0/0"] # Здесь должен быть CIDR подсети
from_port = 0
to_port = 65535
}
egress {
description = "The rule allows all outgoing traffic. Nodes can connect to Yandex Container Registry, Object Storage, Docker Hub, and more."
protocol = "ANY"
predefined_target = "self_security_group"
from_port = 0
to_port = 65535
}
}
resource "yandex_vpc_security_group" "k8s-public-services" {
description = "Security group allows connections to services from the internet. Apply the rules only for node groups."
name = local.public_services_sg_name
network_id = yandex_vpc_network.k8s-network.id
ingress {
description = "The rule allows the pod-pod and service-service interaction. Specify the subnets of your cluster and services."
protocol = "ANY"
v4_cidr_blocks = ["0.0.0.0/0"] # Здесь должен быть CIDR подсети
from_port = 0
to_port = 65535
}
ingress {
description = "The rule allows incoming traffic from the internet to the NodePort port range. Add ports or change existing ones to the required ports."
protocol = "TCP"
v4_cidr_blocks = ["0.0.0.0/0"] # Здесь должен быть CIDR подсети
from_port = 30000
to_port = 32767
}
egress {
description = "The rule allows all outgoing traffic. Nodes can connect to Yandex Container Registry, Object Storage, Docker Hub, and more."
protocol = "ANY"
v4_cidr_blocks = ["0.0.0.0/0"]
from_port = 0
to_port = 65535
}
}There was a problem hiding this comment.
в итоге вместе разобрались и починили
https://st.yandex-team.ru/YCDOCIO-4042