GPU Sharing с HAMi
Как включить дробное разделение GPU в tenant-кластерах Kubernetes с помощью HAMi.
Если вам нужно развернуть собственное контейнеризованное приложение в Cozystack, лучше всего размещать его в управляемом Kubernetes-кластере.
Cozystack разворачивает Kubernetes-as-a-Service и управляет им как самостоятельным приложением внутри изолированной среды каждого тенант. В Cozystack такие кластеры называются тенант-кластерами Kubernetes, а базовый кластер Cozystack — management-кластером или root-кластером. Тенант-кластеры полностью отделены от management-кластера и предназначены для приложений конкретного tenant или приложений, разработанных заказчиком.
Внутри тенант-кластера пользователи могут использовать сервисы LoadBalancer и быстро заказывать persistent volumes по мере необходимости. Control plane работает в контейнерах, а worker nodes разворачиваются как виртуальные машины; всем этим управляет приложение.
Kubernetes version in tenant clusters is independent of Kubernetes in the management cluster. Users can select the supported patch versions from 1.31 to 1.35.
Kubernetes стал отраслевым стандартом: он предоставляет единый и понятный API, а для конфигурации в основном использует YAML. Благодаря этому команды проще понимают Kubernetes и работают с ним, а управление инфраструктурой становится более предсказуемым.
Kubernetes использует устойчивые архитектурные паттерны и обеспечивает непрерывное восстановление системы в любых сценариях за счёт механизма reconciliation. Кроме того, он позволяет прозрачно масштабироваться на множество серверов и снимает проблемы, характерные для сложных и устаревших API традиционных платформ виртуализации. Управляемый сервис убирает необходимость разрабатывать собственные решения или изменять исходный код, экономя время и усилия.
Управляемый сервис Kubernetes в Cozystack дает удобный способ эффективно управлять серверными рабочими нагрузками.
Когда тенант-кластер Kubernetes готов, получите kubeconfig для работы с ним.
Это можно сделать через UI или запросом kubectl:
Откройте дашборд Cozystack, переключитесь в свой тенант, найдите и откройте страницу приложения. Скопируйте один из config-файлов из раздела Secrets.
Выполните следующую команду, используя kubeconfig management-кластера:
kubectl get secret -n tenant-<name> kubernetes-<clusterName>-admin-kubeconfig -o go-template='{{ printf "%s\n" (index .data "admin.conf" | base64decode) }}' > admin.conf
Доступно несколько вариантов kubeconfig:
admin.conf — стандартный kubeconfig для доступа к новому кластеру.
С его помощью можно создавать дополнительных пользователей Kubernetes.admin.svc — тот же token, что и в admin.conf, но адрес API server указывает на внутреннее имя service.
Используйте его для приложений, которые работают внутри кластера и которым нужен доступ к API.super-admin.conf — похож на admin.conf, но с расширенными административными правами.
Предназначен для диагностики неисправностей и задач обслуживания кластера.super-admin.svc — то же, что super-admin.conf, но с указанием на внутренний адрес API server.Тенант-кластер Kubernetes в Cozystack по сути является Kubernetes-in-Kubernetes. При его развертывании используются следующие компоненты:
Kamaji Control Plane:
Kamaji — open-source проект, который упрощает развертывание
Kubernetes control planes в виде pod внутри root-кластера.
Каждый control plane pod включает базовые компоненты вроде kube-apiserver, controller-manager и scheduler,
что помогает эффективно использовать multi-tenancy и ресурсы.
Etcd Cluster: A dedicated etcd cluster is deployed using the cozystack
etcd-operator (etcd-operator.cozystack.io/v1alpha2).
It provides reliable and scalable key-value storage for the Kubernetes control plane.
Worker Nodes: виртуальные машины создаются через KubeVirt и используются как worker nodes.
Эти ноды настроены на присоединение к тенант-кластеру Kubernetes, что позволяет разворачивать workload и управлять ими.
Диски worker нод автоматически определяют размер блока базового тома и подстраиваются под него
(blockSize.matchVolume), чтобы обеспечить совместимость с backend-системами хранения данных, которые используют
секторы не по 512 байт, например LINSTOR DRBD с 4Kn-дисками.
Cluster API: Cozystack использует Kubernetes Cluster API для подготовки компонентов кластера.
Такая архитектура обеспечивает изолированные, масштабируемые и эффективные тенант-среды Kubernetes.
Справочные материалы по компонентам, которые используются в этом сервисе:
ephemeralStorage renamed to diskSize (v1.4): The nodeGroups[name].ephemeralStorage field has been renamed to nodeGroups[name].diskSize. Existing clusters are migrated transparently by platform migration 41 during the pre-upgrade hook — no manual action is required. Newly written values should use diskSize. Existing VMs are rolling-updated via CAPI when the new values are applied. With the Talos worker rollover in this release the field now sizes the single system disk (Talos OS image streamed from factory.talos.dev, kubelet state, containerd image cache, local-path PVCs) — the pre-Talos disk-kubelet PVC layout was removed. State on that single disk persists across same-VM reboots (virt-launcher restart, guest reboot, node failure); VM replacement by CAPI (e.g. nodeGroup field change, MachineHealthCheck remediation) provisions a fresh disk.
Air-gapped tenant workers (Phase 1 Talos rollover): tenant worker bootstrap moves from Ubuntu containerDisk + kubeadm to a Talos OS disk image fetched over HTTP by CDI and a .../installer/... installer reference. Both sources are now overridable — set talos.imageFactoryURL (default https://factory.talos.dev) to a self-hosted Image Factory, a caching mirror, or an internal HTTP file server, and talos.installerRepository (default factory.talos.dev/installer) to a mirrored registry. The Helm-rendered *-patch-containerd Secret that previously plumbed the platform-wide registries.mirrors config to tenant workers (via the kubeadm template’s containerd certs.d mount) has no consumer in the Talos machineconfig and was removed in this release; in-guest container-image pulls (pods pulling from registries inside the tenant cluster) still honour no per-tenant registries.mirrors override until Phase 2 restores it via machine.registries.mirrors knobs. So a strict-egress tenant can now mirror the Talos OS image and installer, but rate-limited in-guest registry pulls remain a Phase 2 follow-up — file an issue if you depend on this and it is not yet landed.
Worker MachineHealthCheck remediation is now enabled by default (Phase 1 Talos rollover): the worker MHC maxUnhealthy moved from a hard-coded 0 (remediation effectively off) to a configurable nodeHealthCheck.maxUnhealthy defaulting to "50%". CAPI now auto-remediates (deletes and replaces) unhealthy worker Machines while at least 50% of a group stays healthy. "50%" deliberately leaves headroom for transient unhealthy nodes during the kubeadm→Talos rollover and slow first boots from factory.talos.dev; set nodeHealthCheck.maxUnhealthy: "0%" to keep the previous remediation-off behaviour until your fleet is stable on Talos workers.
GitOps-managed tenant Kubernetes CRs must bump spec.version in Git (Phase 1 Talos rollover): platform migration 46 patches live kuberneteses.apps.cozystack.io objects from v1.30 to v1.31 (v1.30 left the Talos↔Kubernetes support matrix). When the tenant Kubernetes CR is reconciled from Git (Flux/Argo), the next source reconcile re-applies version: v1.30 over migration 46’s patch, which then trips the chart’s _versions.tpl guard and the HelmRelease fails. Update spec.version to v1.31 (or newer) in your Git source before/with the platform upgrade. Tenants managed via the API or dashboard need no action — migration 46 handles them.
Remote-accessible LINSTOR StorageClasses are auto-propagated to tenants (v1.5): infra-cluster LINSTOR StorageClasses whose linstor.csi.linbit.com/allowRemoteVolumeAccess is not "false" are created inside each tenant under the same name (provisioned by csi.kubevirt.io). Upgrade caveat: delete any manually created tenant StorageClass whose name collides with a propagated infra class (e.g. a hand-made replicated) before upgrading, or the propagated class cannot be created and the tenant CSI release will not converge. Infra classes that must stay node-local need allowRemoteVolumeAccess: "false" set explicitly — an absent annotation is treated as remote-accessible. Propagation is evaluated at HelmRelease render time, so classes added or removed on the infra cluster after a tenant exists propagate only on that tenant’s next reconcile.
Поле верхнего уровня
storageClassпомечено в схеме чарта как неизменяемое (immutable) — описание контракта и того, какие потребители его применяют, см. вdocs/storage-immutability.md. Поле уровня группы нодnodeGroups[name].storageClassнамеренно не помечено неизменяемым: оно необязательное и не имеет значения по умолчанию, поэтому строгое правилоself == oldSelfзаблокировало бы любую будущую попытку задать его для уже существующей группы нод.
| Name | Description | Type | Value |
|---|---|---|---|
storageClass | Default StorageClass inside the tenant cluster. Remote-accessible LINSTOR classes are auto-propagated to the tenant under the same name. | string | replicated |
| Name | Description | Type | Value |
|---|---|---|---|
nodeGroups | Worker nodes configuration map. When left empty, a default node group md0 is emitted with minReplicas: 0 and roles: [ingress-nginx] — the MachineDeployment renders but provisions no workers until an unschedulable Pod triggers the cluster-autoscaler (or an operator scales the group manually). Enabling addons.ingressNginx.enabled: true on a CR with default nodeGroups: {} therefore requires either supplying a nodeGroup with roles: [ingress-nginx] and minReplicas >= 1, or waiting for the autoscaler to bring up the default md0 in response to the ingress-nginx controller Pods becoming Pending. Provide your own groups to take full control — they are not merged with the default, so you may name and omit groups freely. | map[string]object | {} |
nodeGroups[name].minReplicas | Minimum number of replicas. | int | 0 |
nodeGroups[name].maxReplicas | Maximum number of replicas. | int | 10 |
nodeGroups[name].instanceType | Virtual machine instance type. | string | u1.medium |
nodeGroups[name].diskSize | System disk size for the worker VM. Carries the Talos OS image (factory.talos.dev raw artifact streamed in by CDI), kubelet state, containerd image cache, and any local-path PVCs. Pre-Talos installs used a separate disk-kubelet PVC for kubelet/containerd state; on Talos this is consolidated onto the single system disk imaged from the factory artifact. | quantity | 20Gi |
nodeGroups[name].storageClass | StorageClass for worker node persistent disks. When empty, falls back to the application-level storageClass. Worker VMs live-migrate, so their disks need ReadWriteMany — the RWX access mode is supplied by the chosen StorageClass’s CDI StorageProfile, not set on the DataVolume here — and linstor-csi rejects RWX volumes that are not on a DRBD-backed StorageClass, so the fallback targets the replicated/DRBD application storageClass rather than a possibly non-DRBD cluster default. NOTE: deliberately not marked immutable — the field is optional and undefaulted, so a strict self == oldSelf rule would block any future attempt to set it on an existing node group. | string | "" |
nodeGroups[name].roles | List of node roles. | []string | [] |
nodeGroups[name].resources | Explicit CPU and memory for each worker node, as an alternative to instanceType sizing. Optional: when omitted, the node is sized by instanceType. When both cpu and memory are set, they take precedence and instanceType is ignored for that node group (the instancetype is omitted from the VM, since KubeVirt cannot override an instancetype’s CPU/memory). Set both cpu and memory together or neither; setting only one is rejected at render time. | object | {} |
nodeGroups[name].resources.cpu | CPU available. | quantity | "" |
nodeGroups[name].resources.memory | Memory (RAM) available. | quantity | "" |
nodeGroups[name].gpus | List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM). | []object | [] |
nodeGroups[name].gpus[i].name | Name of GPU, such as “nvidia.com/AD102GL_L40S”. | string | "" |
nodeGroups[name].kubelet | Kubelet resource reservations for this node group. | object | {} |
nodeGroups[name].kubelet.systemReservedMemory | Memory reserved for host OS. Auto-computed from instanceType if empty. | string | "" |
nodeGroups[name].kubelet.kubeReservedMemory | Memory reserved for kubelet and container runtime. Auto-computed from instanceType if empty. | string | "" |
nodeGroups[name].kubelet.systemReservedCpu | CPU reserved for host OS. Auto-computed from instanceType if empty. | string | "" |
nodeGroups[name].kubelet.kubeReservedCpu | CPU reserved for kubelet and container runtime. Auto-computed from instanceType if empty. | string | "" |
nodeGroups[name].kubelet.evictionHardMemory | Hard eviction threshold for memory (absolute like 200Mi or percentage like 7%). | string | 7% |
nodeGroups[name].kubelet.evictionSoftMemory | Soft eviction threshold for memory (absolute like 1Gi or percentage like 10%). | string | 10% |
nodeGroups[name].maxUnhealthy | Per-group override for nodeHealthCheck.maxUnhealthy. When unset, the cluster-wide nodeHealthCheck.maxUnhealthy applies. Accepts a bare integer (“0”, “1”, …) or an integer percentage (“0%”, “50%”). | string | "" |
nodeGroups[name].nodeStartupTimeout | Per-group override for nodeHealthCheck.nodeStartupTimeout. When unset, the cluster-wide nodeHealthCheck.nodeStartupTimeout applies. | string | "" |
version | Kubernetes major.minor version to deploy | string | v1.35 |
host | External hostname for Kubernetes cluster. Defaults to <cluster-name>.<tenant-host> if empty. | string | "" |
| Name | Description | Type | Value |
|---|---|---|---|
addons | Конфигурация расширений кластера. | object | {} |
addons.certManager | Расширение cert-manager. | object | {} |
addons.certManager.enabled | Включить cert-manager. | bool | false |
addons.certManager.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.cilium | Cilium CNI плагин. | object | {} |
addons.cilium.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.gatewayAPI | Расширение Gateway API. | object | {} |
addons.gatewayAPI.enabled | Включить Gateway API. | bool | false |
addons.ingressNginx | Расширение Controller Ingress-NGINX. | object | {} |
addons.ingressNginx.enabled | Включить controller (требует ноды с label ingress-nginx). | bool | false |
addons.ingressNginx.exposeMethod | Метод публикации controller. Допустимые значения: Proxied, LoadBalancer. | string | Proxied |
addons.ingressNginx.hosts | Домены, которые направляются в этот тенант-кластер, когда exposeMethod равен Proxied. | []string | [] |
addons.ingressNginx.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.gpuOperator | NVIDIA GPU Operator. | object | {} |
addons.gpuOperator.enabled | Включить GPU Operator. | bool | false |
addons.gpuOperator.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.hami | HAMi GPU virtualization middleware. | object | {} |
addons.hami.enabled | Включить HAMi (требует GPU Operator). | bool | false |
addons.hami.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.fluxcd | FluxCD GitOps operator. | object | {} |
addons.fluxcd.enabled | Включить FluxCD. | bool | false |
addons.fluxcd.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.monitoringAgents | агенты системы мониторинга. | object | {} |
addons.monitoringAgents.enabled | Включить агенты системы мониторинга . | bool | false |
addons.monitoringAgents.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.verticalPodAutoscaler | Vertical Pod Autoscaler. | object | {} |
addons.verticalPodAutoscaler.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.velero | Расширение Velero для backup/restore. | object | {} |
addons.velero.enabled | Включить Velero. | bool | false |
addons.velero.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.coredns | Расширение CoreDNS. | object | {} |
addons.coredns.valuesOverride | Пользовательские переопределения значений Helm. | object | {} |
addons.ouroboros | Исправление Hairpin-NAT для ingress-nginx с PROXY-protocol. | object | {} |
addons.ouroboros.enabled | Включить ouroboros. Требует addons.ingressNginx.enabled, иначе chart-render завершится ошибкой. Полезно только когда PROXY-protocol подключен в тенант ingress-nginx через valuesOverride. | bool | false |
addons.ouroboros.valuesOverride | Пользовательские переопределения значений Helm. Operator-key имеет приоритет над defaults Cozystack. | object | {} |
| Name | Description | Type | Value |
|---|---|---|---|
controlPlane | Kubernetes control-plane configuration. | object | {} |
controlPlane.replicas | Number of control-plane replicas. | int | 2 |
controlPlane.apiServer | API Server configuration. | object | {} |
controlPlane.apiServer.resources | CPU and memory resources for API Server. | object | {} |
controlPlane.apiServer.resources.cpu | CPU available. | quantity | "" |
controlPlane.apiServer.resources.memory | Memory (RAM) available. | quantity | "" |
controlPlane.apiServer.resourcesPreset | Preset if resources omitted. | string | c1.medium |
controlPlane.apiServer.extraArgs | Extra command-line flags appended to the tenant kube-apiserver, passed through to KamajiControlPlane spec.apiServer.extraArgs. For OIDC use spec.oidc.mode — this passthrough is the escape hatch for other apiserver flags (--requestheader-uid-headers=X-Remote-Uid, feature gates, etc). Do NOT add legacy --oidc-* flags here when spec.oidc.mode is not None; the chart injects --authentication-config and the apiserver refuses to boot with both. Empty by default (no change to current behavior). | []string | [] |
controlPlane.apiServer.extraVolumes | Extra volumes added to the control-plane Deployment, passed through to KamajiControlPlane spec.deployment.extraVolumes. Use to mount a ConfigMap or Secret holding an AuthenticationConfiguration file referenced by extraArgs. Each item is a core/v1 Volume, but because the control-plane pod runs on the management cluster only configMap and secret sources are allowed (host-reaching sources like hostPath/csi and token-projection via projected are rejected); each volume must have a unique, non-empty name and exactly one source. The names talos-ca and talos-tls-cert are reserved by the chart. Empty by default. | []object | [] |
controlPlane.apiServer.extraVolumeMounts | Extra volume mounts added to the tenant kube-apiserver container, passed through to KamajiControlPlane spec.apiServer.extraVolumeMounts. Each name must reference a volume declared in extraVolumes; the chart-managed talos secret volumes cannot be mounted. Each item is a core/v1 VolumeMount. Empty by default. | []object | [] |
controlPlane.controllerManager | Controller Manager configuration. | object | {} |
controlPlane.controllerManager.resources | CPU and memory resources for Controller Manager. | object | {} |
controlPlane.controllerManager.resources.cpu | CPU available. | quantity | "" |
controlPlane.controllerManager.resources.memory | Memory (RAM) available. | quantity | "" |
controlPlane.controllerManager.resourcesPreset | Preset if resources omitted. | string | t1.micro |
controlPlane.scheduler | Scheduler configuration. | object | {} |
controlPlane.scheduler.resources | CPU and memory resources for Scheduler. | object | {} |
controlPlane.scheduler.resources.cpu | CPU available. | quantity | "" |
controlPlane.scheduler.resources.memory | Memory (RAM) available. | quantity | "" |
controlPlane.scheduler.resourcesPreset | Preset if resources omitted. | string | t1.micro |
controlPlane.konnectivity | Konnectivity configuration. | object | {} |
controlPlane.konnectivity.server | Konnectivity Server configuration. | object | {} |
controlPlane.konnectivity.server.resources | CPU and memory resources for Konnectivity. | object | {} |
controlPlane.konnectivity.server.resources.cpu | CPU available. | quantity | "" |
controlPlane.konnectivity.server.resources.memory | Memory (RAM) available. | quantity | "" |
controlPlane.konnectivity.server.resourcesPreset | Preset if resources omitted. | string | t1.micro |
images | Optional image overrides for air-gapped or rate-limited registries. | object | {} |
images.waitForKubeconfig | Image used by the wait-for-kubeconfig init container. Empty falls back to images/busybox.tag. | string | "" |
images.kubectl | Image used by the bootstrap-token tenant Job (kubectl). Empty falls back to images/kubectl.tag. | string | "" |
images.talosCsrSigner | Image used by the talos-csr-signer sidecar in the Kamaji control plane. Empty falls back to images/talos-csr-signer.tag. | string | "" |
| Name | Description | Type | Value |
|---|---|---|---|
talos | Talos worker image configuration. | object | {} |
talos.version | Talos release used for worker OS image and installer. Must satisfy the chart’s Talos<->Kubernetes support matrix against the chosen version. | string | v1.13.6 |
talos.schematicID | Talos image-factory schematic ID. Defaults to the cozystack-tested vanilla schematic. Operators using custom schematics (system extensions, kernel args) override here. | string | ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515 |
talos.imageFactoryURL | Base URL of the Talos Image Factory that serves the worker OS disk image (the openstack-amd64.raw.xz raw artifact streamed in by CDI over HTTP). Defaults to the public factory. Point at a self-hosted Image Factory, a caching mirror, or an internal HTTP file server for air-gapped, rate-limited, or flaky-egress environments. No trailing slash. | string | https://factory.talos.dev |
talos.installerRepository | OCI repository prefix for the Talos installer image used by the in-guest talos-reconcile upgrade Job. Resolved as <installerRepository>/<schematicID>:<version>. Defaults to the public factory’s installer path. Override for air-gapped or mirrored registries. No trailing slash. | string | factory.talos.dev/installer |
| Name | Description | Type | Value |
|---|---|---|---|
nodeHealthCheck | MachineHealthCheck tuning for worker node groups. | object | {} |
nodeHealthCheck.maxUnhealthy | Maximum number of unhealthy nodes tolerated per node group before remediation is paused. The MHC admission webhook accepts either a bare integer (“0”, “1”, …) or a percentage (“0%”, “50%”); bare numeric strings are rejected, so the safer default is to express the value as a percentage. Default “50%” leaves headroom for transient unhealthy nodes during the kubeadm-to-Talos rollover and slow first boots from factory.talos.dev. Drop to “0%” once the fleet is stable on Talos workers. | string | 50% |
nodeHealthCheck.nodeStartupTimeout | Maximum time a Machine is allowed to spend reaching the Ready condition before it is remediated. Raise for slow first boots (Talos image fetch from factory.talos.dev or a busy storage class on the kubevirt-csi PVC populator). | string | 10m |
| Name | Description | Type | Value |
|---|---|---|---|
oidc | OIDC authentication and per-user RBAC for the tenant kube-apiserver. See docs/oidc-tenant.md for the operator guide. | object | {} |
oidc.mode | Identity mode. None: no OIDC, only the static admin kubeconfig works. System: trust the platform cozy realm via a per-cluster public client with audience binding; zero-config default. CustomConfig: trust a tenant-supplied issuer directly (BYO); cozy is not in the path. | string | None |
oidc.customConfig | Tenant-supplied AuthenticationConfiguration; consumed only when mode: CustomConfig. | object | {} |
oidc.customConfig.config | Inline AuthenticationConfiguration YAML (apiserver.config.k8s.io/v1beta1). The chart writes the value verbatim into a Secret mounted at /etc/kubernetes/authentication-config/config.yaml on the kube-apiserver. Mutually exclusive with secretRef.name. | string | "" |
oidc.customConfig.secretRef | Reference to an existing Secret in the tenant namespace carrying the AuthenticationConfiguration. | object | {} |
oidc.customConfig.secretRef.name | Name of an existing Secret in the tenant (release) namespace whose config.yaml key holds an apiserver.config.k8s.io/v1beta1 AuthenticationConfiguration. Mutually exclusive with customConfig.config. | string | "" |
oidc.users | Users granted access to the tenant cluster; each entry produces one ClusterRoleBinding inside the tenant cluster. Works for both System and CustomConfig modes. | []object | [] |
oidc.users[i].email | Email address matched against the email claim from the issuer. Used verbatim as the User: subject in the ClusterRoleBinding inside the tenant cluster. The email claim is a built-in OIDC scope requested explicitly by the chart-generated kubectl oidc-login kubeconfig; every conformant OIDC provider (cozy realm included) emits it. | string | "" |
oidc.users[i].role | Role to bind: admin maps to ClusterRole/cluster-admin, view maps to ClusterRole/view. | string | {} |
resources задает явную конфигурацию CPU и memory для каждой реплики.
Если значение пустое, применяется preset из resourcesPreset.
resources:
cpu: 4000m
memory: 4Gi
resourcesPreset задает именованную конфигурацию CPU и memory для каждой реплики.
Эта настройка игнорируется, если задано соответствующее значение resources.
| Preset name | CPU | memory |
|---|---|---|
nano | 250m | 128Mi |
micro | 500m | 256Mi |
small | 1 | 512Mi |
medium | 1 | 1Gi |
large | 2 | 2Gi |
xlarge | 4 | 4Gi |
2xlarge | 8 | 8Gi |
В Cozystack доступны следующие ресурсы для типов инстансов:
| Имя | vCPUs | Память |
|---|---|---|
cx1.2xlarge | 8 | 16Gi |
cx1.2xlarge1gi | 8 | 16Gi |
cx1.4xlarge | 16 | 32Gi |
cx1.4xlarge1gi | 16 | 32Gi |
cx1.8xlarge | 32 | 64Gi |
cx1.8xlarge1gi | 32 | 64Gi |
cx1.large | 2 | 4Gi |
cx1.large1gi | 2 | 4Gi |
cx1.medium | 1 | 2Gi |
cx1.medium1gi | 1 | 2Gi |
cx1.xlarge | 4 | 8Gi |
cx1.xlarge1gi | 4 | 8Gi |
d1.2xlarge | 8 | 32Gi |
d1.2xmedium | 2 | 4Gi |
d1.4xlarge | 16 | 64Gi |
d1.8xlarge | 32 | 128Gi |
d1.large | 2 | 8Gi |
d1.medium | 1 | 4Gi |
d1.micro | 1 | 1Gi |
d1.nano | 1 | 512Mi |
d1.small | 1 | 2Gi |
d1.xlarge | 4 | 16Gi |
gn1.2xlarge | 8 | 32Gi |
gn1.4xlarge | 16 | 64Gi |
gn1.8xlarge | 32 | 128Gi |
gn1.xlarge | 4 | 16Gi |
m1.2xlarge | 8 | 64Gi |
m1.2xlarge1gi | 8 | 64Gi |
m1.4xlarge | 16 | 128Gi |
m1.4xlarge1gi | 16 | 128Gi |
m1.8xlarge | 32 | 256Gi |
m1.8xlarge1gi | 32 | 256Gi |
m1.large | 2 | 16Gi |
m1.large1gi | 2 | 16Gi |
m1.xlarge | 4 | 32Gi |
m1.xlarge1gi | 4 | 32Gi |
n1.2xlarge | 16 | 32Gi |
n1.4xlarge | 32 | 64Gi |
n1.8xlarge | 64 | 128Gi |
n1.large | 4 | 8Gi |
n1.medium | 4 | 4Gi |
n1.xlarge | 8 | 16Gi |
o1.2xlarge | 8 | 32Gi |
o1.4xlarge | 16 | 64Gi |
o1.8xlarge | 32 | 128Gi |
o1.large | 2 | 8Gi |
o1.medium | 1 | 4Gi |
o1.micro | 1 | 1Gi |
o1.nano | 1 | 512Mi |
o1.small | 1 | 2Gi |
o1.xlarge | 4 | 16Gi |
rt1.2xlarge | 8 | 32Gi |
rt1.4xlarge | 16 | 64Gi |
rt1.8xlarge | 32 | 128Gi |
rt1.large | 2 | 8Gi |
rt1.medium | 1 | 4Gi |
rt1.micro | 1 | 1Gi |
rt1.small | 1 | 2Gi |
rt1.xlarge | 4 | 16Gi |
u1.2xlarge | 8 | 32Gi |
u1.2xmedium | 2 | 4Gi |
u1.4xlarge | 16 | 64Gi |
u1.8xlarge | 32 | 128Gi |
u1.large | 2 | 8Gi |
u1.medium | 1 | 4Gi |
u1.micro | 1 | 1Gi |
u1.nano | 1 | 512Mi |
u1.small | 1 | 2Gi |
u1.xlarge | 4 | 16Gi |
Каждая группа нод поддерживает объект kubelet, который задает, сколько памяти и CPU kubelet резервирует для host OS и Kubernetes/system компонентов, работающих на worker ноде.
Если systemReservedMemory или kubeReservedMemory оставлены пустыми, они вычисляются автоматически по следующей формуле:
resources.memory задан явно, используется это значение.instanceType и используется его значение memory.guest.По умолчанию systemReservedMemory и kubeReservedMemory получают одинаковое автоматически вычисленное значение.
CPU резервирование (systemReservedCpu, kubeReservedCpu) работают по той же схеме: 5% от effective CPU с ограничением диапазоном [50m, 500m]. Оба значения вычисляются автоматически, если оставлены пустыми.
| Параметр | По умолчанию | Описание |
|---|---|---|
systemReservedMemory | auto-computed | Память, зарезервированная для host OS |
kubeReservedMemory | auto-computed | Память, зарезервированная для kubelet и container runtime |
systemReservedCpu | auto-computed | CPU, зарезервированный для host OS |
kubeReservedCpu | auto-computed | CPU, зарезервированный для kubelet и container runtime |
evictionHardMemory | 7% | Жёсткий порог вытеснения по памяти |
evictionSoftMemory | 10% | Мягкий порог вытеснения по памяти |
evictionSoftGracePeriod | 1m30s (hardcoded) | Время, в течение которого мягкий порог вытеснения по памяти должен быть нарушен перед запуском вытеснения |
evictionMinimumReclaim | 256Mi (hardcoded) | Минимальный объем памяти, освобождаемый за одно действие вытеснения |
Порог вытеснения можно задавать в процентах (например, 7%) или абсолютных значениях (например, 200Mi). Оба порога должны использовать один тип единиц. Жёсткий порог вытеснения должен быть строго меньше мягкого порога.
Параметры evictionSoftGracePeriod и evictionMinimumReclaim сейчас жёстко заданы в шаблоне и не могут быть переопределены через values.
Когда настроены резервации ресурсов kubelet, аннотации capacity.cluster-autoscaler.kubernetes.io/memory и capacity.cluster-autoscaler.kubernetes.io/cpu на MachineDeployments показывают распределяемые значения вместо полных ресурсов ноды. Доступная для подов память вычисляется как общий объём памяти за вычетом system-reserved, kube-reserved и eviction-hard. Доступное для подов CPU вычисляется как общее количество за вычетом system-reserved и kube-reserved. Так аннотации соответствуют значениям, которые cluster autoscaler использует в расчетах масштабирования.
При обновлении с версии без этой возможности autoscaler после обновления аннотации может увидеть уменьшенную капасити для каждой ноды, что способно запустить дополнительные операции scale-up. Обычно никаких действий не требуется — новые значения отражают фактическую память, доступную для scheduling workload.
Note: Если не задан ни
resources.memory, ниinstanceType, порог вытеснения (по умолчанию 7% hard / 10% soft) все равно применяются kubelet во время выполнения, но capacity аннотации не рендерится. Без этой аннотации cluster-autoscaler не учитывает эти резервации и может запланировать на ноду слишком много подов, что приведёт к срабатыванию вытеснения.
nodeGroups:
md0:
instanceType: "u1.large"
kubelet:
systemReservedMemory: "256Mi"
kubeReservedMemory: "256Mi"
evictionHardMemory: "500Mi"
evictionSoftMemory: "1Gi"
Серия U имеет сбалансированный профиль и предоставляет ресурсы для приложений общего назначения.
U — сокращение от “Universal”, то есть серия рассчитана на универсальные рабочие нагрузки.
VM этих типов инстансов делят физические CPU-ядра с другими VM по принципу разделения процессорного времени.
Особенности этой серии:
Серия O основана на серии U; единственное отличие — избыточное выделение памяти.
O — сокращение от “Overcommitted”.
Особенности этой серии:
Серия CX предоставляет выделенные вычислительные ресурсы для приложений с высокой нагрузкой на CPU.
CX — сокращение от “Compute Exclusive”.
Выделенные ресурсы предоставляются вычислительным потокам виртуальной машины. Чтобы это обеспечить, запрашиваются дополнительные ядра (в зависимости от количества дисков и NIC), которые разгружают IO потоки с ядрами, выделенных под рабочие нагрузки. Кроме того, в этой серии топологии NUMA используемых ядер передается в VM.
Особенности этой серии:
Серия M предоставляет ресурсы для приложений с высокой нагрузкой на память.
M — сокращение от “Memory”.
Особенности этой серии:
Серия RT предоставляет ресурсы для приложений реального времени, например Oslat.
RT — сокращение от “realtime”.
Эта серия типов инстансов требует нод, способных запускать приложения реального времени.
Особенности этой серии:
Как включить дробное разделение GPU в tenant-кластерах Kubernetes с помощью HAMi.
Как перенести реплики tenant-кластеров etcd, которые используются tenant-кластерами Kubernetes.