{"id":403615,"date":"2024-06-29T17:13:37","date_gmt":"2024-06-29T17:13:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=403615"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T17:13:37","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=403615","title":{"rendered":"<span>\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 Helm-\u0447\u0430\u0440\u0442 v2.0<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/aa4\/8c0\/0de\/aa48c00dec0f5195bd3b87801d31f59e.jpg\" width=\"1280\" height=\"762\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa4\/8c0\/0de\/aa48c00dec0f5195bd3b87801d31f59e.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0448\u043b\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 2 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043b\u0438\u0437\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/657359\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430<\/a>, \u0438 \u043c\u044b \u0440\u0430\u0434\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0447\u0430\u0440\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>2.0. <\/strong>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e, \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439<\/h2>\n<h4>\u041c\u0430\u043f\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439  <\/h4>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 <code>Job<\/code>, <code>CronJob<\/code>, <code>serviceMonitors<\/code> \u0438  <code>HelmHooks<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043f\u0438\u0441\u043a\u0438, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u043f, \u0433\u0434\u0435 \u0438\u043c\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c \u0432 \u043c\u0430\u043f\u0435 &#8212; \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043c\u0430\u043f\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>--set<\/code> \u0438 \u0442.\u0434.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 values: <\/p>\n<pre><code class=\"yaml\">cronJobs:   mailing:     schedule: \"00 05 * * *\"     containers:     - command: send-mail       volumeMounts:       - mountPath: \/app\/issues-mailing.conf         name: config         subPath: issues-mailing.conf     volumes:     - name: config       type: secret       originalName: app-config     restartPolicy: OnFailure<\/code><\/pre>\n<p>\u0438 \u0444\u043b\u0430\u0433 <code>--set cronJobs.mailing.schedule=\"*\/5 * * * *\"<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/cronjob.yml apiVersion: batch\/v1beta1 kind: CronJob metadata:   name: mailing   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm   annotations:     spec:   schedule: \"*\/5 * * * *\"   jobTemplate:     spec:       template:         metadata:           labels:           annotations:         spec:           affinity:             nodeAffinity:               {}             podAffinity:               preferredDuringSchedulingIgnoredDuringExecution:               - podAffinityTerm:                   labelSelector:                     matchLabels:                       app.kubernetes.io\/name: test                       app.kubernetes.io\/instance: test                   namespaces:                   - \"test\"                   topologyKey: kubernetes.io\/hostname                 weight: 1             podAntiAffinity:               preferredDuringSchedulingIgnoredDuringExecution:               - podAffinityTerm:                   labelSelector:                     matchLabels:                       app.kubernetes.io\/name: test                       app.kubernetes.io\/instance: test                   namespaces:                   - \"test\"                   topologyKey: kubernetes.io\/hostname                 weight: 1           imagePullSecrets:           - name: registry.org           - name: registry.org-rw           containers:           - name: mailing             image: registry.org\/my-app:latest             imagePullPolicy: IfNotPresent             command: [\"send-mail\"]                                     volumeMounts:             - mountPath: \/app\/issues-mailing.conf               name: config               subPath: issues-mailing.conf           volumes:                     - name: config             secret:               secretName: app-config            restartPolicy: OnFailure<\/code><\/pre>\n<h4>HorizontalPodAutoscaler<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f HPA. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 values: <\/p>\n<pre><code class=\"yaml\">hpas:   default-for-app:     scaleTargetRef:       name: app     targetCPU: 60     targetMemory: 70   advanced-for-app2:     apiVersion: autoscaling\/v2     labels:       foo: bar     annotations:       bar.io\/bar: foo     minReplicas: 1     maxReplicas: 5     scaleTargetRef:       apiVersion: apps\/v1       kind: Deployment       name: app2     metrics:     - type: Pods       pods:         metric:           name: packets-per-second         target:           type: AverageValue           averageValue: 2k     - type: Object       object:         metric:           name: requests-per-second         describedObject:           apiVersion: networking.k8s.io\/v1           kind: Ingress           name: main-route         target:           type: Value           value: 10k     - type: External       external:         metric:           name: queue_messages_ready           selector:             matchLabels:               queue: \"worker_tasks\"         target:           type: AverageValue           averageValue: 25<\/code><\/pre>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/hpa.yaml kind: HorizontalPodAutoscaler apiVersion: autoscaling\/v2 metadata:   name: advanced-for-app2   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     foo: bar   annotations:     bar.io\/bar: foo spec:   scaleTargetRef:     apiVersion: apps\/v1     kind: Deployment     name: app2   minReplicas: 1   maxReplicas: 5   metrics:     - pods:         metric:           name: packets-per-second         target:           averageValue: 2k           type: AverageValue       type: Pods     - object:         describedObject:           apiVersion: networking.k8s.io\/v1           kind: Ingress           name: main-route         metric:           name: requests-per-second         target:           type: Value           value: 10k       type: Object     - external:         metric:           name: queue_messages_ready           selector:             matchLabels:               queue: worker_tasks         target:           averageValue: 25           type: AverageValue       type: External --- # Source: universal-chart\/templates\/hpa.yaml kind: HorizontalPodAutoscaler apiVersion: autoscaling\/v2beta1 metadata:   name: default-for-app   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm   annotations: spec:   scaleTargetRef:     apiVersion: apps\/v1     kind: Deployment     name: app   minReplicas: 2   maxReplicas: 3   metrics:     - type: Resource       resource:         name: cpu         targetAverageUtilization: 60     - type: Resource       resource:         name: memory         targetAverageUtilization: 70<\/code><\/pre>\n<h4>PodDisruptionBudget<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0432\u043e\u0442\u0443 \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0434\u043e\u0432, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c PDB. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 values: <\/p>\n<pre><code class=\"yaml\">pdbs:   nginx:     labels:       app: nginx     minAvailable: 1     extraSelectorLabels:       app: nginx   app2:     labels:       bar: foo     maxUnavailable: 1     extraSelectorLabels:       bar: foo<\/code><\/pre>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/pdb.yaml kind: PodDisruptionBudget apiVersion: policy\/v1beta1 metadata:   name: app2   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     bar: foo spec:   maxUnavailable: 1   selector:     matchLabels:       app.kubernetes.io\/name: test       app.kubernetes.io\/instance: test       bar: foo --- # Source: universal-chart\/templates\/pdb.yaml kind: PodDisruptionBudget apiVersion: policy\/v1beta1 metadata:   name: nginx   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     app: nginx spec:   minAvailable: 1   selector:     matchLabels:       app.kubernetes.io\/name: test       app.kubernetes.io\/instance: test       app: nginx<\/code><\/pre>\n<p>\u0417\u0430 HPA \u0438 PDB \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c <a href=\"https:\/\/habr.com\/ru\/users\/evg_krsk\/\">@evg_krsk<\/a>.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043c\u044b\u0441\u043b\u0438 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u043d\u0430 <a href=\"https:\/\/github.com\/nixys\/nxs-universal-chart\"><strong>GitHub<\/strong><\/a>. \u0410 \u0442\u0430\u043a-\u0436\u0435 \u0436\u0434\u0451\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435, \u0433\u0434\u0435 \u043c\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e DevOps (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) &#8212; <a href=\"https:\/\/t.me\/devops_fm\"><strong>DevOps FM<\/strong><\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/668782\/\"> https:\/\/habr.com\/ru\/articles\/668782\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0448\u043b\u043e \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 2 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043b\u0438\u0437\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/nixys\/blog\/657359\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430<\/a>, \u0438 \u043c\u044b \u0440\u0430\u0434\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0447\u0430\u0440\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>2.0. <\/strong>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e, \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439<\/h2>\n<h4>\u041c\u0430\u043f\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439  <\/h4>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 <code>Job<\/code>, <code>CronJob<\/code>, <code>serviceMonitors<\/code> \u0438  <code>HelmHooks<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043f\u0438\u0441\u043a\u0438, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u043f, \u0433\u0434\u0435 \u0438\u043c\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c \u0432 \u043c\u0430\u043f\u0435 &#8212; \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043c\u0430\u043f\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>--set<\/code> \u0438 \u0442.\u0434.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 values: <\/p>\n<pre><code class=\"yaml\">cronJobs:   mailing:     schedule: \"00 05 * * *\"     containers:     - command: send-mail       volumeMounts:       - mountPath: \/app\/issues-mailing.conf         name: config         subPath: issues-mailing.conf     volumes:     - name: config       type: secret       originalName: app-config     restartPolicy: OnFailure<\/code><\/pre>\n<p>\u0438 \u0444\u043b\u0430\u0433 <code>--set cronJobs.mailing.schedule=\"*\/5 * * * *\"<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/cronjob.yml apiVersion: batch\/v1beta1 kind: CronJob metadata:   name: mailing   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm   annotations:     spec:   schedule: \"*\/5 * * * *\"   jobTemplate:     spec:       template:         metadata:           labels:           annotations:         spec:           affinity:             nodeAffinity:               {}             podAffinity:               preferredDuringSchedulingIgnoredDuringExecution:               - podAffinityTerm:                   labelSelector:                     matchLabels:                       app.kubernetes.io\/name: test                       app.kubernetes.io\/instance: test                   namespaces:                   - \"test\"                   topologyKey: kubernetes.io\/hostname                 weight: 1             podAntiAffinity:               preferredDuringSchedulingIgnoredDuringExecution:               - podAffinityTerm:                   labelSelector:                     matchLabels:                       app.kubernetes.io\/name: test                       app.kubernetes.io\/instance: test                   namespaces:                   - \"test\"                   topologyKey: kubernetes.io\/hostname                 weight: 1           imagePullSecrets:           - name: registry.org           - name: registry.org-rw           containers:           - name: mailing             image: registry.org\/my-app:latest             imagePullPolicy: IfNotPresent             command: [\"send-mail\"]                                     volumeMounts:             - mountPath: \/app\/issues-mailing.conf               name: config               subPath: issues-mailing.conf           volumes:                     - name: config             secret:               secretName: app-config            restartPolicy: OnFailure<\/code><\/pre>\n<h4>HorizontalPodAutoscaler<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f HPA. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 values: <\/p>\n<pre><code class=\"yaml\">hpas:   default-for-app:     scaleTargetRef:       name: app     targetCPU: 60     targetMemory: 70   advanced-for-app2:     apiVersion: autoscaling\/v2     labels:       foo: bar     annotations:       bar.io\/bar: foo     minReplicas: 1     maxReplicas: 5     scaleTargetRef:       apiVersion: apps\/v1       kind: Deployment       name: app2     metrics:     - type: Pods       pods:         metric:           name: packets-per-second         target:           type: AverageValue           averageValue: 2k     - type: Object       object:         metric:           name: requests-per-second         describedObject:           apiVersion: networking.k8s.io\/v1           kind: Ingress           name: main-route         target:           type: Value           value: 10k     - type: External       external:         metric:           name: queue_messages_ready           selector:             matchLabels:               queue: \"worker_tasks\"         target:           type: AverageValue           averageValue: 25<\/code><\/pre>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/hpa.yaml kind: HorizontalPodAutoscaler apiVersion: autoscaling\/v2 metadata:   name: advanced-for-app2   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     foo: bar   annotations:     bar.io\/bar: foo spec:   scaleTargetRef:     apiVersion: apps\/v1     kind: Deployment     name: app2   minReplicas: 1   maxReplicas: 5   metrics:     - pods:         metric:           name: packets-per-second         target:           averageValue: 2k           type: AverageValue       type: Pods     - object:         describedObject:           apiVersion: networking.k8s.io\/v1           kind: Ingress           name: main-route         metric:           name: requests-per-second         target:           type: Value           value: 10k       type: Object     - external:         metric:           name: queue_messages_ready           selector:             matchLabels:               queue: worker_tasks         target:           averageValue: 25           type: AverageValue       type: External --- # Source: universal-chart\/templates\/hpa.yaml kind: HorizontalPodAutoscaler apiVersion: autoscaling\/v2beta1 metadata:   name: default-for-app   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm   annotations: spec:   scaleTargetRef:     apiVersion: apps\/v1     kind: Deployment     name: app   minReplicas: 2   maxReplicas: 3   metrics:     - type: Resource       resource:         name: cpu         targetAverageUtilization: 60     - type: Resource       resource:         name: memory         targetAverageUtilization: 70<\/code><\/pre>\n<h4>PodDisruptionBudget<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0432\u043e\u0442\u0443 \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0434\u043e\u0432, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c PDB. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 values: <\/p>\n<pre><code class=\"yaml\">pdbs:   nginx:     labels:       app: nginx     minAvailable: 1     extraSelectorLabels:       app: nginx   app2:     labels:       bar: foo     maxUnavailable: 1     extraSelectorLabels:       bar: foo<\/code><\/pre>\n<p>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<pre><code class=\"yaml\">--- # Source: universal-chart\/templates\/pdb.yaml kind: PodDisruptionBudget apiVersion: policy\/v1beta1 metadata:   name: app2   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     bar: foo spec:   maxUnavailable: 1   selector:     matchLabels:       app.kubernetes.io\/name: test       app.kubernetes.io\/instance: test       bar: foo --- # Source: universal-chart\/templates\/pdb.yaml kind: PodDisruptionBudget apiVersion: policy\/v1beta1 metadata:   name: nginx   namespace: \"test\"   labels:     app.kubernetes.io\/name: test     app.kubernetes.io\/instance: test     helm.sh\/chart: universal-chart-2.0.0     app.kubernetes.io\/managed-by: Helm     app: nginx spec:   minAvailable: 1   selector:     matchLabels:       app.kubernetes.io\/name: test       app.kubernetes.io\/instance: test       app: nginx<\/code><\/pre>\n<p>\u0417\u0430 HPA \u0438 PDB \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c <a href=\"https:\/\/habr.com\/ru\/users\/evg_krsk\/\">@evg_krsk<\/a>.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043c\u044b\u0441\u043b\u0438 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u043d\u0430 <a href=\"https:\/\/github.com\/nixys\/nxs-universal-chart\"><strong>GitHub<\/strong><\/a>. \u0410 \u0442\u0430\u043a-\u0436\u0435 \u0436\u0434\u0451\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435, \u0433\u0434\u0435 \u043c\u044b \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e DevOps (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) &#8212; <a href=\"https:\/\/t.me\/devops_fm\"><strong>DevOps FM<\/strong><\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/668782\/\"> https:\/\/habr.com\/ru\/articles\/668782\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-403615","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=403615"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403615\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=403615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=403615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=403615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}