mws_mk8s_cluster (Resource)
Заголовок раздела «mws_mk8s_cluster (Resource)»Кластер Managed Kubernetes — кластер Kubernetes на базе облачной инфраструктуры MWS Cloud Platform. Представляет собой совокупность Control Plane (управляющего слоя) и групп рабочих узлов
Примеры использования
Заголовок раздела «Примеры использования»resource "mws_vpc_network" "network" { network = var.network_name}
resource "mws_vpc_subnet" "subnet_a" { subnet = "${var.subnet_name}-a" network = mws_vpc_network.network.network cidr = var.subnet_cidr_a}
resource "mws_vpc_subnet" "subnet_b" { subnet = "${var.subnet_name}-b" network = mws_vpc_network.network.network cidr = var.subnet_cidr_b}
resource "mws_vpc_address" "address" { address = var.address_name network = mws_vpc_network.network.network subnet = mws_vpc_subnet.subnet_a.metadata.id}
resource "mws_mk8s_cluster" "example" { availability = { # standalone = { # zone = "ru-central1-a" # } zonal_ha = { // zonal high available zone = "ru-central1-b" } }
cluster_name = var.cluster_name
metadata = { description = "Zonal HA Kubernetes cluster" display_name = "HA Example Cluster" }
network = { pods_cidr = var.pods_cidr services_cidr = var.services_cidr primary_endpoint = { ref = mws_vpc_address.address.id } }
version_control = { release_channel = "stable" maintenance_window = { weekly = { days = ["MONDAY", "WEDNESDAY"] hour = 3 } } version = "v1.35.6-mws.4" // or actual }}
variable "network_name" { type = string default = "my-ha-network" description = "VPC network name"}
variable "subnet_name" { type = string default = "my-ha-subnet" description = "Base name for subnets"}
variable "subnet_cidr_a" { type = string default = "192.168.0.0/17" description = "CIDR for subnet A"}
variable "subnet_cidr_b" { type = string default = "192.168.128.0/17" description = "CIDR for subnet B"}
variable "address_name" { type = string default = "k8s-primary-ip" description = "Name for the primary endpoint address"}
variable "cluster_name" { type = string default = "ha-k8s-cluster" description = "Name of the Kubernetes cluster"}
variable "pods_cidr" { type = string default = "10.244.0.0/16" description = "Pods CIDR block"}
variable "services_cidr" { type = string default = "10.96.0.0/16" description = "Services CIDR block"}Required
Заголовок раздела «Required»availability(Attributes) (see below for nested schema)cluster_name(String) Имя Clusternetwork(Attributes) (see below for nested schema)version_control(Attributes) (see below for nested schema)
Optional
Заголовок раздела «Optional»kind(String)metadata(Attributes) Набор общих для всех пользовательских объектов атрибутов. Может быть расширен атрибутами, специфичными для контейнеров (see below for nested schema)plugins(Attributes) (see below for nested schema)project(String) Путь к проекту.security_posture(Attributes) Настройка KSP для кластера (see below for nested schema)timeouts(Attributes) (see below for nested schema)
Read-Only
Заголовок раздела «Read-Only»id(String) The ID of this resource.status(Attributes) Описывает статусную модель k8s cluster (see below for nested schema)
Nested Schema for availability
Заголовок раздела «Nested Schema for availability»Optional:
standalone(Attributes) Кластер с одним мастером (see below for nested schema)zonal_ha(Attributes) Зональный высокодоступный кластер с несколькими мастерами (see below for nested schema)
Nested Schema for availability.standalone
Заголовок раздела «Nested Schema for availability.standalone»Required:
zone(String) Имя зоны для размещения cluster
Nested Schema for availability.zonal_ha
Заголовок раздела «Nested Schema for availability.zonal_ha»Required:
zone(String) Имя зоны для размещения cluster
Nested Schema for network
Заголовок раздела «Nested Schema for network»Required:
pods_cidr(String) Необходим ip-range v4
IPv4 подсеть в CIDR нотации
primary_endpoint(Attributes) Ip-адрес внутри vpc (see below for nested schema)services_cidr(String) Необходим ip-range v4
IPv4 подсеть в CIDR нотации
Optional:
public_endpoint(Attributes) Внешний ip-адрес (see below for nested schema)
Nested Schema for network.primary_endpoint
Заголовок раздела «Nested Schema for network.primary_endpoint»Optional:
ref(String)spec(Attributes) Описание subnet пользователя, из которого будет выделен ip-адрес (see below for nested schema)
Nested Schema for network.primary_endpoint.spec
Заголовок раздела «Nested Schema for network.primary_endpoint.spec»Required:
subnet(String)
Optional:
ip_address(String) Желаемый IP адрес. Если не указан, то будет выделен из пула адресов подсети
IPv4-адрес
Nested Schema for network.public_endpoint
Заголовок раздела «Nested Schema for network.public_endpoint»Optional:
ref(String)spec(Attributes) Ожидаем пустой объект в случае автоматического выделения внешнего ip-адреса (see below for nested schema)
Nested Schema for network.public_endpoint.spec
Заголовок раздела «Nested Schema for network.public_endpoint.spec»Optional:
version(String) Версия IP протокола
Nested Schema for version_control
Заголовок раздела «Nested Schema for version_control»Required:
release_channel(String) Cluster обновляется всегда до default версии, поэтому необходимо выбрать релизный канал и настроить окно обслуживания
Optional:
maintenance_window(Attributes) Если окно обслуживания не заполнено, то время проведения работ не ограничено. Duration нельзя указывать, так как обновление мастер нод не прерывается (see below for nested schema)version(String) Минимальная версия Cluster. Автоматически обновляется до версии default в окно обслуживания. При указании версии выше default обновление запускается немедленно. Во время автоматического обновления это поле не изменяется, а актуальная версия указывается в статусе Cluster
Nested Schema for version_control.maintenance_window
Заголовок раздела «Nested Schema for version_control.maintenance_window»Required:
weekly(Attributes) (see below for nested schema)
Nested Schema for version_control.maintenance_window.weekly
Заголовок раздела «Nested Schema for version_control.maintenance_window.weekly»Required:
days(List of String) Дни недели, в которые будет запущено задание на тех. обслуживаниеhour(Number) Час, в который будет запущено задание на тех. обслуживание
Optional:
duration(String) Допустимая продолжительность процесса обновления. Если не указано, то не ограничено по времени. Принимается только формат в часах (h)
Период времени. Поддерживаются следующие форматы:
- ISO 8601: P(n)DT(n)H(n)M(n)S. Допустимые единицы измерения: дни (“D”), часы (“H”), минуты (“M”), секунды (“S”). Только секунды могут быть дробными
- Простой формат. Допустимые единицы измерения: “d”, “h”, “m”, “s”, “ms”, “us”, “ns”. Величины должны следовать по убыванию единиц измерения
- Число в секундах
Отрицательные значения обозначаются префиксом ”-”, в простом формате могут быть ограничены скобками. Регистр и пробелы игнорируются
Nested Schema for metadata
Заголовок раздела «Nested Schema for metadata»Optional:
description(String) Описание ресурсаdisplay_name(String) Отображаемое имя свойстваname(String, Deprecated) Обязательное уникальное, глобально или в пределах проекта, имя. Используется в качестве части составного идентификатора объекта
Read-Only:
create_time(String) Дата создания объекта
Дата в формате RFC3339. Пример: 2006-01-02T15:04:05Z07:00
delete_time(String) Время запроса на удаление ресурса
Дата в формате RFC3339. Пример: 2006-01-02T15:04:05Z07:00
id(String) ID свойстваpurge_time(String) Время удаления ресурса
Дата в формате RFC3339. Пример: 2006-01-02T15:04:05Z07:00
usages(Attributes List) Связи с другими ресурсами. В зависимости от типа связи операции над ресурсом могут быть ограничены (see below for nested schema)
Nested Schema for metadata.usages
Заголовок раздела «Nested Schema for metadata.usages»Read-Only:
name(String) Имя связи. Требуется для модификации коллекцииresource(String) Ссылка на ресурсusage_type(String) Тип связи. Помимо стандартных “own” и “use” могут быть добавлены специализированные типы для конкретных сервисов
Nested Schema for plugins
Заголовок раздела «Nested Schema for plugins»Optional:
cni(Attributes) Настройка CNI-плагина для кластера; для создания кластера без CNI передайте пустой объект (see below for nested schema)
Nested Schema for plugins.cni
Заголовок раздела «Nested Schema for plugins.cni»Optional:
calico(String) Настройка CNI-плагина Calicocilium(String) Настройка CNI-плагина Cilium
Nested Schema for security_posture
Заголовок раздела «Nested Schema for security_posture»Optional:
enabled(Boolean) Определяет, работает ли в кластере KSP. Если значение равно false, сканирование кластера выключено
Nested Schema for timeouts
Заголовок раздела «Nested Schema for timeouts»Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).
Nested Schema for status
Заголовок раздела «Nested Schema for status»Read-Only:
cluster_ca_certificate(String) Root сертификат кластераcluster_status(Attributes) (see below for nested schema)network(Attributes) (see below for nested schema)plugins(Attributes) (see below for nested schema)ready(Attributes) Информация о статусе реконсиляции (see below for nested schema)security_posture(Attributes) Статус KSP для кластера (see below for nested schema)version_control(Attributes) (see below for nested schema)
Nested Schema for status.cluster_status
Заголовок раздела «Nested Schema for status.cluster_status»Read-Only:
message(String)state(String) Текущий статус cluster
Nested Schema for status.network
Заголовок раздела «Nested Schema for status.network»Read-Only:
primary_address(String) IPv4-адресprimary_endpoint(Attributes) Внутренний ip-адрес (see below for nested schema)public_address(String) IPv4-адресpublic_endpoint(Attributes) Внешний ip-адрес (see below for nested schema)subnet(Attributes) (see below for nested schema)vpc_network(Attributes) (see below for nested schema)
Nested Schema for status.network.primary_endpoint
Заголовок раздела «Nested Schema for status.network.primary_endpoint»Read-Only:
ref(String)
Nested Schema for status.network.public_endpoint
Заголовок раздела «Nested Schema for status.network.public_endpoint»Read-Only:
ref(String)
Nested Schema for status.network.subnet
Заголовок раздела «Nested Schema for status.network.subnet»Read-Only:
ref(String)
Nested Schema for status.network.vpc_network
Заголовок раздела «Nested Schema for status.network.vpc_network»Read-Only:
ref(String)
Nested Schema for status.plugins
Заголовок раздела «Nested Schema for status.plugins»Read-Only:
cni(Attributes) (see below for nested schema)
Nested Schema for status.plugins.cni
Заголовок раздела «Nested Schema for status.plugins.cni»Read-Only:
calico(String) Настройка CNI-плагина Calicocilium(String) Настройка CNI-плагина Cilium
Nested Schema for status.ready
Заголовок раздела «Nested Schema for status.ready»Read-Only:
message(String) Описание статусаstate(String) Состояние ресурса
Nested Schema for status.security_posture
Заголовок раздела «Nested Schema for status.security_posture»Read-Only:
enabled(Boolean) Показывает, работает ли в кластере KSP
Nested Schema for status.version_control
Заголовок раздела «Nested Schema for status.version_control»Read-Only:
maintenance_window(Attributes) (see below for nested schema)release_channel(String) Cluster обновляется всегда до default версии, поэтому необходимо выбрать релизный канал и настроить окно обслуживанияversion(String) Текущая версия Cluster
Nested Schema for status.version_control.maintenance_window
Заголовок раздела «Nested Schema for status.version_control.maintenance_window»Required:
weekly(Attributes) (see below for nested schema)
Nested Schema for status.version_control.maintenance_window.weekly
Заголовок раздела «Nested Schema for status.version_control.maintenance_window.weekly»Required:
days(List of String) Дни недели, в которые будет запущено задание на тех. обслуживаниеhour(Number) Час, в который будет запущено задание на тех. обслуживание
Optional:
duration(String) Допустимая продолжительность процесса обновления. Если не указано, то не ограничено по времени. Принимается только формат в часах (h)
Период времени. Поддерживаются следующие форматы:
- ISO 8601: P(n)DT(n)H(n)M(n)S. Допустимые единицы измерения: дни (“D”), часы (“H”), минуты (“M”), секунды (“S”). Только секунды могут быть дробными
- Простой формат. Допустимые единицы измерения: “d”, “h”, “m”, “s”, “ms”, “us”, “ns”. Величины должны следовать по убыванию единиц измерения
- Число в секундах
Отрицательные значения обозначаются префиксом ”-”, в простом формате могут быть ограничены скобками. Регистр и пробелы игнорируются