Skip to content

Instantly share code, notes, and snippets.

@dixneuf19
Created December 22, 2020 21:13
Show Gist options
  • Save dixneuf19/3ad440c6d701a065482e74aa2bd7c0d0 to your computer and use it in GitHub Desktop.
Save dixneuf19/3ad440c6d701a065482e74aa2bd7c0d0 to your computer and use it in GitHub Desktop.
sentry-helm-pod-affinity.yaml
# sentry.values.yaml
# for node selection, if I don't specify any tolerations, I'll end up on main node which is fine
filestore:
filesystem:
persistence:
storageClass: ebs-sc # choosing the right storage class
persistentWorkers: true # using disk for workers, solving the issue
# Web is the main pod, I'll let it move freely
web:
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 300m
memory: 300Mi
nodeSelector:
kube/nodetype: main
# Cron shares the same disk
cron:
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
nodeSelector:
kube/nodetype: main
affinity:
podAffinity: # with pod Affinity, I help him stay close of web
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: role
operator: In
values:
- web
- key: app
operator: In
values:
- sentry
topologyKey: "kubernetes.io/hostname"
# workers share the same disk
worker:
resources:
limits:
cpu: 300m
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
nodeSelector:
kube/nodetype: main
affinity:
podAffinity: # with pod Affinity, I help him stay close of web
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: role
operator: In
values:
- web
- key: app
operator: In
values:
- sentry
topologyKey: "kubernetes.io/hostname"
# postgresql, redis and metrics have their own disk so we don't care where they runs
postgresql:
global:
storageClass: ebs-sc # choosing the right storage class
nodeSelector:
kube/nodetype: main
redis:
global:
storageClass: ebs-sc
nodeSelector:
kube/nodetype: main
metrics:
nodeSelector:
kube/nodetype: main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment