Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add affinity config in fluentd deployment #436

Merged
merged 8 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions deploy/helm/sumologic/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,43 @@ spec:
{{- if .Values.deployment.tolerations }}
tolerations:
{{ toYaml .Values.deployment.tolerations | indent 8 }}
{{- end }}
{{- if or .Values.deployment.affinity .Values.deployment.podAntiAffinity }}
affinity:
{{- if .Values.deployment.affinity }}
{{ toYaml .Values.deployment.affinity | indent 8 }}
{{- end }}
{{- if eq .Values.deployment.podAntiAffinity "hard"}}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "sumologic.labels.app" . }}
Comment on lines +38 to +41
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section checks for the fleuntd app label.

- key: app
operator: In
values:
- prometheus-operator-prometheus
Comment on lines +42 to +45
Copy link
Contributor Author

@vsinghal13 vsinghal13 Feb 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section checks for the prometheus app label.

topologyKey: "kubernetes.io/hostname"
{{else if eq .Values.deployment.podAntiAffinity "soft"}}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "sumologic.labels.app" . }}
- key: app
operator: In
values:
- prometheus-operator-prometheus
topologyKey: "kubernetes.io/hostname"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The topologyKey is the label for a particular node.

{{- end }}
{{- end }}
volumes:
- name: pos-files
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ nameOverride: ""
deployment:
nodeSelector: {}
tolerations: {}
affinity: {}
podAntiAffinity: "soft"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also leave a comment here for the customers that the accepted values are "soft" and "hard", and what those mean?

replicaCount: 3
resources:
limits:
Expand Down
16 changes: 16 additions & 0 deletions deploy/kubernetes/fluentd-sumologic.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,22 @@ spec:

spec:
serviceAccountName: collection-sumologic
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- collection-sumologic
- key: app
operator: In
values:
- prometheus-operator-prometheus
topologyKey: "kubernetes.io/hostname"
volumes:
- name: pos-files
hostPath:
Expand Down