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 tolerations to StatefulSet #28

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
4 changes: 4 additions & 0 deletions stable/yugabyte/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ spec:
{{- if $root.Values.nodeSelector }}
nodeSelector:
{{ toYaml $root.Values.nodeSelector | indent 8 }}
{{- end }}
{{- if $root.Values.tolerations }}
tolerations:
{{ toYaml $root.Values.tolerations | indent 8 }}
Copy link
Author

Choose a reason for hiding this comment

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

This has to be unindented to make the | indent 8 work, apparently. Unsure if there's a better way to do it.

This is actually also kind of an issue for nodeSelector, but I think it would only show up if there are more than one label in the selector. If there's only one, the selector is visually overindented but still valid YAML:

    spec:
      nodeSelector:
        # should be here...
              # but is actually here
              foo: bar

Copy link
Contributor

@bhavin192 bhavin192 Oct 5, 2020

Choose a reason for hiding this comment

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

You are right, good catch 😄 . AFAIK better would be to have something like this,

      {{- if $root.Values.tolerations }}
      tolerations:
      {{- toYaml $root.Values.tolerations | nindent 8 }}
      {{- end }}

The hyphen before toYaml will remove one line (along with our indentation). The nindent will add a new line and then indent our object by 8.

Also, as you mentioned the nodeSelector needs to be fixed.

{{- end }}
affinity:
# Set the anti-affinity selector scope to YB masters.
Expand Down