Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/v1alpha1/helm_cluster_addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const (
HelmClusterAddonLabelSourceName = "helm.deckhouse.io/cluster-addon"
)

// HelmClusterAddon represents a Helm addon that is installed across the whole cluster.
//
// HelmClusterAddon represents a single cluster-wide installation of a Helm chart, which may include custom resource definitions (CRDs) and requires cluster-admin permissions to deploy. Only one instance of a specific chart can be installed at any given time.

Comment on lines +35 to +36
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels={heritage=deckhouse,module=operator-helm}
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/helm_cluster_addon_chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
HelmClusterAddonChartLabelSourceName = "helm.deckhouse.io/cluster-addon-chart"
)

// HelmClusterAddonChart represents a Helm chart and its versions from specific repository.
// HelmClusterAddonChart represents a specific Helm chart discovered within a HelmClusterAddonRepository. These resources are automatically managed during repository synchronization and are immutable to user modifications.
//
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/helm_cluster_addon_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
HelmClusterAddonRepositoryLabelSourceName = "helm.deckhouse.io/cluster-addon-repository"
)

// HelmClusterAddonRepository represents a Helm or an OCI compliant repository with Helm charts.
// HelmClusterAddonRepository represents a Helm or OCI-compliant repository containing Helm charts that can be referenced by HelmClusterAddon resources.
//
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
Expand Down
2 changes: 1 addition & 1 deletion crds/doc-ru-helmclusteraddoncharts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddonChart описывает Helm-чарт и его версии из определённого репозитория.
description: HelmClusterAddonChart представляет собой Helm-чарт, обнаруженный в HelmClusterAddonRepository. Эти ресурсы создаются автоматически во время синхронизации репозитория и защищены от изменений.
properties:
status:
properties:
Expand Down
2 changes: 1 addition & 1 deletion crds/doc-ru-helmclusteraddonrepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddonRepository описывает Helm-репозиторий или OCI-репозиторий с Helm-чартами.
description: HelmClusterAddonRepository представляет собой Helm- или OCI-совместимый репозиторий, содержащий Helm-чарты, на которые могут ссылаться ресурсы HelmClusterAddon.
properties:
spec:
properties:
Expand Down
2 changes: 1 addition & 1 deletion crds/doc-ru-helmclusteraddons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddon описывает Helm-аддон, устанавливаемый на уровне кластера.
description: HelmClusterAddon представляет собой единичный экземпляр установки Helm-чарта в масштабе всего кластера, который может включать в себя определения пользовательских ресурсов (CRD) и требует прав cluster-admin для развертывания. В каждый момент времени может быть установлен только один экземпляр конкретного чарта.
properties:
spec:
properties:
Expand Down
5 changes: 3 additions & 2 deletions crds/helmclusteraddoncharts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddonChart represents a Helm chart and its versions
from specific repository.
description: HelmClusterAddonChart represents a specific Helm chart discovered
within a HelmClusterAddonRepository. These resources are automatically managed
during repository synchronization and are immutable to user modifications.
properties:
apiVersion:
description: |-
Expand Down
5 changes: 3 additions & 2 deletions crds/helmclusteraddonrepositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddonRepository represents a Helm or an OCI compliant
repository with Helm charts.
description: HelmClusterAddonRepository represents a Helm or OCI-compliant
repository containing Helm charts that can be referenced by HelmClusterAddon
resources.
properties:
apiVersion:
description: |-
Expand Down
2 changes: 0 additions & 2 deletions crds/helmclusteraddons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: HelmClusterAddon represents a Helm addon that is installed across
the whole cluster.
properties:
apiVersion:
description: |-
Expand Down
24 changes: 22 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ description: "Deckhouse Kubernetes Platform — the operator-helm module for dec
weight: 10
---

The `operator-helm` module provides declarative management of Helm chart deployments for cluster administrators and DevOps engineers. It deploys applications through custom resources, reducing the amount of manual configuration required.
The `operator-helm` module allows you to declaratively manage Helm chart deployments in the cluster. It is designed for cluster administrators and DevOps engineers and automates application installation using custom resources.

The module acts as a Kubernetes operator that reconciles the desired state described in HelmClusterAddon resources with the actual Helm releases in the cluster.
The module controller monitors the state of HelmClusterAddon resources and automatically reconciles Helm releases in the cluster with the specified parameters.

## Main Features

Expand All @@ -17,4 +17,24 @@ The module acts as a Kubernetes operator that reconciles the desired state descr
- TLS verification and authentication support for private Helm and OCI repositories.
- Management through CLI (`d8 k`) or the Deckhouse web interface.

{% alert level="info" %}
The module is under active development. Future plans include:

- adding new custom resources to allow non-admin users to install charts;
- migrating to chart deployment using [Nelm](https://github.com/werf/nelm).
{% endalert %}

## Custom Resources

The following custom resources are used to manage Helm charts in the module:

- **HelmClusterAddonRepository** — a Helm or OCI registry containing Helm charts for deployment in the cluster.
- **HelmClusterAddonChart** — a Helm chart discovered in the connected repository. These resources are automatically created and updated by the controller during repository synchronization and are protected from manual changes.
- **HelmClusterAddon** — a declarative description of a specific Helm chart release. The resource contains the target chart version, the namespace name for deployment, and custom values.

## Limitations

- Admin privileges (the `cluster-admin` role) are required to manage HelmClusterAddon and HelmClusterAddonRepository resources.
- A HelmClusterAddon resource referencing a specific HelmClusterAddonChart can only be created as a single instance in the cluster. This is because Helm charts can contain custom resource definitions (CRDs), and installing them multiple times at the cluster level is not allowed.

See [usage examples](example.html) for practical scenarios.
24 changes: 22 additions & 2 deletions docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ description: "Deckhouse Kubernetes Platform — модуль operator-helm дл
weight: 10
---

Модуль `operator-helm` предназначен для декларативного управления развёртыванием Helm-чартов. Ориентирован на администраторов кластеров и DevOps-инженеров, которым необходимо автоматизировать установку приложений через кастомные ресурсы.
Модуль `operator-helm` позволяет декларативно управлять развёртыванием Helm-чартов в кластере. Он ориентирован на администраторов кластеров и DevOps-инженеров и автоматизирует установку приложений с помощью кастомных ресурсов.

Модуль работает как оператор Kubernetes, приводя фактическое состояние Helm-релизов в соответствие с описанным в ресурсах HelmClusterAddon.
Контроллер модуля отслеживает состояние ресурсов HelmClusterAddon и автоматически приводит Helm-релизы в кластере в соответствие с заданными параметрами.

## Основные возможности

Expand All @@ -17,4 +17,24 @@ weight: 10
- Поддержка проверки TLS-сертификатов и аутентификации для приватных OCI и Helm репозиториев.
- Управление через CLI (`d8 k`) или веб-интерфейс Deckhouse.

{% alert level="info" %}
Модуль находится на стадии активного развития. В будущем планируется:

- добавить новые кастомные ресурсы для установки чартов пользователями без привилегий администратора;
- перейти на развёртывание чартов с помощью [Nelm](https://github.com/werf/nelm).
{% endalert %}

## Кастомные ресурсы

Для управления Helm-чартами в модуле используются следующие кастомные ресурсы:

- **HelmClusterAddonRepository** — репозиторий Helm или OCI, содержащий Helm-чарты для последующей установки в кластере.
- **HelmClusterAddonChart** — Helm-чарт, обнаруженный в подключённом репозитории. Эти ресурсы создаются и обновляются контроллером автоматически при синхронизации репозиториев и защищены от изменений.
- **HelmClusterAddon** — декларативное описание конкретного релиза Helm-чарта. Ресурс содержит целевую версию чарта, имя пространства имён для развёртывания и пользовательские значения параметров.

## Ограничения

- Для управления ресурсами HelmClusterAddon и HelmClusterAddonRepository требуются права администратора кластера (роль `cluster-admin`).
- Ресурс HelmClusterAddon, ссылающийся на заданный HelmClusterAddonChart, может быть создан в кластере только в единственном экземпляре. Это обусловлено тем, что Helm-чарты могут содержать определения кастомных ресурсов (CRD), повторная установка которых на уровне кластера недопустима.

Примеры использования приведены в разделе [примеры использования](example.html).
10 changes: 7 additions & 3 deletions tests/e2e/scripts/kind-d8-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ D8_REGISTRY_ADDRESS=registry.deckhouse.io
D8_REGISTRY_PATH=${D8_REGISTRY_ADDRESS}/deckhouse/ce
D8_LICENSE_KEY=

OS_NAME=${OS_NAME:-}

KIND_INSTALL_DIRECTORY=$PARENT_DIR/kind/bin
KIND_PATH=kind
KIND_VERSION=v0.27.0
Expand Down Expand Up @@ -164,7 +166,8 @@ os_detect() {
OS_NAME=mac

else
noop # Unknown OS
echo "Failed to detect operating system. Use --os linux or --os mac."
exit 1
fi
fi

Expand Down Expand Up @@ -215,13 +218,13 @@ memory_check() {
MEMORY_TOTAL_BYTES=$(sysctl -n hw.memsize 2>/dev/null)
fi

if [[ ("$MEMORY_TOTAL_BYTES" -gt "0") && ("$MEMORY_TOTAL_BYTES" -lt "$REQUIRE_MEMORY_MIN_BYTES") ]]; then
if [[ -n "$MEMORY_TOTAL_BYTES" && ("$MEMORY_TOTAL_BYTES" -gt "0") && ("$MEMORY_TOTAL_BYTES" -lt "$REQUIRE_MEMORY_MIN_BYTES") ]]; then
echo "Insufficient memory to install Deckhouse Kubernetes Platform."
echo "Deckhouse Kubernetes Platform requires at least 4 gigabytes of memory."
exit 1
fi

if [[ ("$MEMORY_TOTAL_BYTES" -eq "0") || (-z "$MEMORY_TOTAL_BYTES") ]]; then
if [[ -z "$MEMORY_TOTAL_BYTES" || ("$MEMORY_TOTAL_BYTES" -eq "0") ]]; then
echo "Can't get the total memory value."
echo "Note, that Deckhouse Kubernetes Platform requires at least 4 gigabytes of memory."
echo "Press enter to continue..."
Expand Down Expand Up @@ -428,6 +431,7 @@ spec:
EOF

if [[ -n "$D8_LICENSE_KEY" ]]; then
docker login -u license-token -p $D8_LICENSE_KEY
generate_ee_access_string "$D8_LICENSE_KEY"
cat <<EOF >>${KIND_CONFIG_DIR}/config.yml
---
Expand Down
Loading