Skip to content

Commit

Permalink
Split the affinities for each workload
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishi committed Nov 9, 2022
1 parent 81deed0 commit 643ce37
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 47 deletions.
6 changes: 3 additions & 3 deletions K8s/helm/templates/cart-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ spec:
requests:
cpu: 100m
memory: 50Mi
{{- with .Values.affinity }}
{{- with .Values.cart.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.cart.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.cart.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/catalogue-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.catalogue.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.catalogue.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.catalogue.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/dispatch-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.dispatch.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.dispatch.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.dispatch.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/mongodb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ spec:
cpu: 100m
memory: 100Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.mongodb.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.mongodb.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.mongodb.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/mysql-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ spec:
cpu: 100m
memory: 700Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.mysql.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.mysql.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.mysql.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/payment-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.payment.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.payment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.payment.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/rabbitmq-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ spec:
cpu: 100m
memory: 256Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.rabbitmq.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.rabbitmq.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.rabbitmq.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/ratings-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ spec:
failureThreshold: 30
successThreshold: 1
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.ratings.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.ratings.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.ratings.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/redis-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.redis.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.redis.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.redis.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions K8s/helm/templates/shipping-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ spec:
failureThreshold: 30
successThreshold: 1
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.shipping.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.shipping.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.shipping.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/user-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.user.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.user.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.user.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 3 additions & 3 deletions K8s/helm/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ spec:
cpu: 100m
memory: 50Mi
restartPolicy: Always
{{- with .Values.affinity }}
{{- with .Values.web.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- with .Values.web.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.web.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
72 changes: 61 additions & 11 deletions K8s/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ image:
version: latest
pullPolicy: IfNotPresent

# Alternative payment gateway URL
# Default is https://www.paypal.com
payment:
gateway: null
#gateway: https://www.worldpay.com

# EUM configuration
# Provide your key and set the endpoint
eum:
Expand All @@ -28,14 +22,70 @@ nodeport: false
# "special" Openshift. Set to true when deploying to any openshift flavour
openshift: false

# Storage class to use with redis statefulset.
ocCreateRoute: false

payment:
# Alternative payment gateway URL
# Default is https://www.paypal.com
gateway: null
#gateway: https://www.worldpay.com
affinity: {}
nodeSelector: {}
tolerations: []

redis:
# Storage class to use with redis statefulset.
storageClassName: standard
affinity: {}
nodeSelector: {}
tolerations: []

ocCreateRoute: false
cart:
affinity: {}
nodeSelector: {}
tolerations: []

catalogue:
affinity: {}
nodeSelector: {}
tolerations: []

dispatch:
affinity: {}
nodeSelector: {}
tolerations: []

mongodb:
affinity: {}
nodeSelector: {}
tolerations: []

mysql:
affinity: {}
nodeSelector: {}
tolerations: []

rabbitmq:
affinity: {}
nodeSelector: {}
tolerations: []

ratings:
affinity: {}
nodeSelector: {}
tolerations: []

affinity: {}
shipping:
affinity: {}
nodeSelector: {}
tolerations: []

nodeSelector: {}
user:
affinity: {}
nodeSelector: {}
tolerations: []

tolerations: []
web:
affinity: {}
nodeSelector: {}
tolerations: []

0 comments on commit 643ce37

Please sign in to comment.