.helm/values.yaml - это основной values base-chart: defaultImagePullPolicy: IfNotPresent…
- User
.helm/values.yaml - это основной values base-chart: defaultImagePullPolicy: IfNotPresent generic: serviceAccountName: "{{ .Release.Name }}" extraImagePullSecrets: - name: dockey deploymentsGeneral: terminationGracePeriodSeconds: 120 envFrom: - secretRef: name: sec-widget-config
serviceAccount: "{{ .Release.Name }}": labels: {}
services: app: type: ClusterIP ports: http: port: 80 targetPort: http protocol: TCP
ingresses: http: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/proxy-body-size: "128m" nginx.ingress.kubernetes.io/use-regex: "true"
serviceMonitors: http: endpoints: http: path: /metrics interval: 15s
deployments: app: strategy: type: RollingUpdate rollingUpdate: maxSurge: 5 maxUnavailable: 5 containers: app: securityContext: capabilities: add: - SYS_PTRACE ports: http: containerPort: 8080 protocol: TCP resources: limits: cpu: 500m memory: 500Mi requests: cpu: 500m memory: 500Mi volumeMounts: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf - name: nginx-config mountPath: /etc/nginx/mime.types subPath: mime-types volumes: - type: configMap name: nginx-config items: - key: nginx.conf path: nginx.conf - key: mime-types path: mime-types
configMaps: nginx-config: data: nginx.conf: | pid /var/run/nginx.pid; worker_processes auto;
code - Assistant
Чтобы добавить антиафинити для равномерного распределения подов по нодам, в файле шаблона deployment.yml в секцию spec.template.spec нужно добавить соответствующие поля.
Ниже приведен пример, как это можно сделать:
codespec: template: spec: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: app operator: In values: - {{ include "helpers.app.name" $ }} topologyKey: "kubernetes.io/hostname"В приведенном примере создается антиафинити селектор, который гарантирует, что поды с тем же значением метки "app" не будут запускаться на одной и той же ноде. Топологический ключ "kubernetes.io/hostname" используется для разделения подов по различным нодам.
Не забудьте применить изменения, запустив обновление Helm чарта.