Работы по созданию сервиса, включают следующие этапы:
1. Установка пакетного менеджера k8s helm, пример описывается в статье: Шаг 5: Установка HELM
2. Создание файлов helm-чартов для hello-world
	Код:
	
$ helm create hello-world
Creating hello-world
 3. Настройка параметров сущностей helm для hello-world
3.1. Настройка файла Chart.yaml
	Код:
	
$ nano hello-world/Chart.yaml
 Здесь вы можете указать номер версии helm-чарта (chart version), номер версии приложения (version number of the application) и пр., в нашем случае оставим тут все по-умолчанию:
	Код:
	
apiVersion: v2
name: hello-world
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into ve>
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer.>
# a dependency of application charts to inject those utilities and functions in>
# pipeline. Library charts do not define any templates and therefore cannot be >
type: application
# This is the chart version. This version number should be incremented each tim>
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version nu>
# incremented each time you make changes to the application. Versions are not e>
# follow Semantic Versioning. They should reflect the version the application i>
# It is recommended to use it with quotes.
appVersion: "1.16.0"
 3.2. Настройка файла values.yaml
	Код:
	
$ nano hello-world/values.yaml
 В данном файле можно изменить основные настройки вашего приложения, заострю ваше внимание на следующих, которые зачастую требуется изменить:
* Количество реплик
* Используемый образ, его тэг, политика загрузки образа 
	Код:
	
image:
 repository: nginx #Здесь укажем наш образ, в данном случае - это nginx
 pullPolicy: Always #Изменим политику, чтобы всегда загружался свежий образ независимо от его присутствия (чтобы все свежие изменения в нем попадали при перезапуске/обновлении/удалении)
 # Overrides the image tag whose default is the chart appVersion.
 tag: "stable" #Укажем тэг stable, в таком случае будет использована стабильная версия.
 * Настройки сервиса
	Код:
	
service:
 type: ClusterIP #Доступ внутри, по IP кластера
 port: 80 #Порт, на котором работает сервис
 * Настройки ингреса
	Код:
	
ingress:
 enabled: true #Изменим на true, т.к. нам нужно, чтобы сервис был доступен извне
 className: ""
 annotations: {}
 # kubernetes.io/ingress.class: nginx
 # kubernetes.io/tls-acme: "true"
 hosts:
 - host: hello-world.local #Заполним FQDN имя сервиса
 paths:
 - path: /
 pathType: ImplementationSpecific
 tls: #Заполним параметры, т.к. нам нужно, чтобы сервис был доступен извне
 - secretName: hello-world-tls #Заполним имя секрета tls, предварительно необходимо загрузить сертификат и ключ для нашего сервиса
 hosts:
 - hello-world.local #Заполним FQDN имя сервиса
 * Настройка ресурсов
	Код:
	
resources: #Заполним параметры, на случай, если нам нужно ограничить наш сервис по ресурсам во избежание дальнейших проблем (например чрезмерное потребление памяти сервисом).
 # We usually recommend not to specify default resources and to leave this as a conscious
 # choice for the user. This also increases chances charts run on environments with little
 # resources, such as Minikube. If you do want to specify resources, uncomment the following
 lines, adjust them as necessary, and remove the curly braces after 'resources:'.
 limits:
 cpu: 100m
 memory: 128Mi
 requests:
 cpu: 100m
 memory: 128Mi
 * Задание параметров авто-скейлинга и CPU Utilization
	Код:
	
autoscaling:
 enabled: true #Изменим на true, допустим нам нужно, чтобы сервис мог скейлится 
 minReplicas: 1 #Минимальное оставим по-умолчанию
 maxReplicas: 2 #Укажем до 2х реплик (сервис сам будет скейлится при превышении лимита по ресурсам)
 3.3. Настройка файла deployment.yaml
	Код:
	
$ nano hello-world/templates/deployment.yaml
 Настройка liveness/readiness Probe (Проверка работоспособности и готовности сервиса). Настройка переменных (которые может использовать ваш сервис внутри контейнера при работе)
	Код:
	
 livenessProbe:
 httpGet:
 path: / #Напимер, “/healthz”, но т.к. у этого образа их нет, то не используем
 port: http
 readinessProbe:
 httpGet:
 path: / #Напимер, “/healthz”, но т.к. у этого образа их нет, то не используем
 port: http
 env: #Так можно задать переменные
 - name: TestENV #Имя переменной
 value: "HellowENV_Value" #Значение переменной
 3.4. Удаление лишнего. 
	Код:
	
$ nano hello-world/templates/deployment.yaml
 Отключение использования сервис-аккаунта (в простых сервисах в основном это не требуется). Файл deployment.yaml
	Код:
	
serviceAccount:
 # Specifies whether a service account should be created
 create: false #Изменим значение с true на false
 # Annotations to add to the service account
 annotations: {}
 # The name of the service account to use.
 # If not set and create is true, a name is generated using the fullname template
 name: "" 
 4. Установка сервиса hello-world с помощью helm в имеющийся k8s-кластер c указанием неймспейса. 
Команда для установки приведена ниже:
	Код:
	
$helm upgrade --install hello-world ./hello-world -f ./hello-world/values.yaml -n test
 Результат выполнения команды:
	Код:
	
Release "hello-world" does not exist. Installing it now.
W0816 18:38:41.841471   16928 warnings.go:70] autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+, unavailable in v1.25+; use autoscaling/v2 HorizontalPodAutoscaler
W0816 18:38:42.289723   16928 warnings.go:70] autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+, unavailable in v1.25+; use autoscaling/v2 HorizontalPodAutoscaler
NAME: hello-world
LAST DEPLOYED: Wed Aug 16 18:38:41 2023
NAMESPACE: test
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
 https://hello-world.local/
 5. Убедимся, что наш сервис запустился и работает. 
Команда для проверки работы с помощью "kubectl" и ее результат:
	Код:
	
 $ kubectl get pods -n elma-test | grep hello
hello-world-7cd468d69f-gpxvm             1/1     Running     0          7m43s
 А также визуально, открыв его в браузере увидим приветственную страницу Nginx
![[IMG]](https://lh6.googleusercontent.com/XqdHg39ZrFdT1oaYI9-PQ4QIPh0W93_T_KfIuH9pi-OvRows0QYNg1lGkDsysTZNh2W8JofcMNBugdMHLLCNlKcXmW-K32R6Pk-BdZtS6nD4k0qP8bvFSRXXVtIbxyTGsdFgbQpB_CQSGCoMfeg-paM)
6. Поздравляю! На этом создание собственного сервиса можно считать успешным.
Теперь за ненадобностью можно его удалить, команда для удаления с помощью "helm" и ее результат:
	Код:
	
$ helm uninstall hello-world -n test
W0816 19:05:47.588429   24204 warnings.go:70] autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+, unavailable in v1.25+; use autoscaling/v2 HorizontalPodAutoscaler
release "hello-world" uninstalled
 ЗЫ: Это просто пример, в котором приведен самый минимальный набор настроек.
Ваши пожелания, комментарии и дополнения приветствуются