Skip to content

Commit

Permalink
helm: fix affinity rules and resources
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Sep 15, 2020
1 parent 8c465b2 commit 9b62a64
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
36 changes: 19 additions & 17 deletions helm/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- web
topologyKey: "kubernetes.io/hostname"
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- web
topologyKey: "kubernetes.io/hostname"
initContainers:
- name: passbook-database-migrations
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -109,7 +111,7 @@ spec:
resources:
requests:
cpu: 100m
memory: 200M
memory: 300M
limits:
cpu: 300m
memory: 350M
memory: 500M
36 changes: 19 additions & 17 deletions helm/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- worker
topologyKey: "kubernetes.io/hostname"
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- worker
topologyKey: "kubernetes.io/hostname"
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -68,7 +70,7 @@ spec:
resources:
requests:
cpu: 150m
memory: 300M
memory: 400M
limits:
cpu: 300m
memory: 500M
memory: 600M

0 comments on commit 9b62a64

Please sign in to comment.