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

HPCC-30704 Prevent scale down evict #17976

Conversation

jakesmith
Copy link
Member

@jakesmith jakesmith commented Oct 31, 2023

It is generally not safe for HPCC pods to be evicted based on
scale down events because most are stateful (particularly those
that have been dynamically launched as jobs).
For now, prevent all pods from being deemed suitable for eviction
by k8s on scale-down.
We may later allow some that have replicas and aren't stateful
or 'cheap' to evict and move and handle graceful termination
to be safe, but it will then be better to use PodDisruptionBudget's

Signed-off-by: Jake Smith jake.smith@lexisnexisrisk.com

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@github-actions
Copy link

@jakesmith jakesmith mentioned this pull request Oct 31, 2023
39 tasks
@jakesmith jakesmith requested a review from ghalliday October 31, 2023 09:44
@jakesmith
Copy link
Member Author

NB: currently based off #17975

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

a couple of issues.

@@ -2527,3 +2527,16 @@ spec:
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
A template to generate component annotations, merges statid efault annotatiosn with global and component annotations
Copy link
Member

Choose a reason for hiding this comment

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

typos....

Copy link
Member Author

Choose a reason for hiding this comment

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

an impressive number of typos on 1 line!

@@ -53,6 +53,7 @@ spec:
helmVersion: 9.2.33-closedown0
annotations:
checksum/config: {{ $configSHA }}
{{- include "hpcc.generateAnnotations" $commonCtx | indent 8 }}
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't these all be nindent?

Copy link
Member Author

@jakesmith jakesmith Oct 31, 2023

Choose a reason for hiding this comment

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

the {{- will chomp (ahead of the include function generating) so they'll be no additional blank line if there's nothing generated. But the helper function will generate a newline ahead of each new entry because the range doesn't chomp ahead of each iteration ({{- range $key, $value := $annotations }})

Example tested output:

      annotations:
        checksum/config: ab97c3620b03bcfc61e519ab700cb20fb8646bcf714641147b5073e682f0f910
        one: 1
        two: 2
    spec:

@ghalliday
Copy link
Member

Also failed the helm regression tests.

@jakesmith
Copy link
Member Author

@ghalliday - pushed the changed to the other commit : #17975.

That will need merging first, this commit only introduces the safe-to-evict change on top of that PR.

It is generally not safe for HPCC pods to be evicted based on
scale down events because most are stateful (particularly those
that have been dynamically launched as jobs).
For now, prevent all pods from being deemed suitable for eviction
by k8s on scale-down.
We may later allow some that have replicas and aren't stateful
or 'cheap' to evict and move and handle graceful termination
to be safe, but it will then be better to use PodDisruptionBudget's

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
@jakesmith jakesmith force-pushed the HPCC-30704-prevent-scale-down-evict branch from 2f8b82f to 83b961f Compare November 2, 2023 17:14
@jakesmith jakesmith requested a review from ghalliday November 2, 2023 17:14
@ghalliday ghalliday merged commit d79d020 into hpcc-systems:candidate-9.2.x Nov 2, 2023
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants