-
Notifications
You must be signed in to change notification settings - Fork 0
feat(client): mysql kill-loop fix — resources, PriorityClass, PDB (v1.1.0) #66
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
1b82331
feat(client): mysql kill-loop fix — resources, PriorityClass, PDB (v1…
saadqbal 29da809
fix(client): address bugbot review on v1.1.0 PriorityClass + mysql cpu
saadqbal 61af0d1
fix(client): add required:[create] to PriorityClass conditional schema
saadqbal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,21 @@ | ||
| {{- if .Values.podDisruptionBudget.mysql.create }} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: mysql-client | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "tracebloc.labels" . | nindent 4 }} | ||
| app: mysql-client | ||
| spec: | ||
| # Single-replica deployment; minAvailable: 1 blocks *voluntary* disruptions | ||
| # (node drains, surge upgrades, cluster-autoscaler scale-downs) while the | ||
| # only mysql pod is, well, the only mysql pod. Involuntary kills (kernel | ||
| # OOM, node failure) still happen — PriorityClass + memory parity cover | ||
| # those. Set podDisruptionBudget.mysql.create=false on multi-replica | ||
| # setups managed externally. | ||
| minAvailable: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: mysql-client | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {{- if .Values.priorityClass.create }} | ||
| apiVersion: scheduling.k8s.io/v1 | ||
| kind: PriorityClass | ||
| metadata: | ||
| name: {{ .Values.priorityClass.name | quote }} | ||
| labels: | ||
| {{- include "tracebloc.labels" . | nindent 4 }} | ||
| annotations: | ||
| # PriorityClass is cluster-scoped, so we never let helm uninstall yank it — | ||
| # other releases may share it. Re-installs reuse the existing object. | ||
| helm.sh/resource-policy: keep | ||
| value: {{ .Values.priorityClass.value | int }} | ||
| globalDefault: false | ||
| description: >- | ||
| Tracebloc data-plane workloads (mysql-client). Sits above default user | ||
| workloads so the scheduler preempts noisy training jobs to keep mysql | ||
| running, but stays below system-cluster-critical (2,000,000,000) so it | ||
| cannot starve cluster-essential pods. | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| suite: PriorityClass and PodDisruptionBudget | ||
| templates: | ||
| - templates/priority-class.yaml | ||
| - templates/mysql-pdb.yaml | ||
| - templates/jobs-manager-pdb.yaml | ||
| set: | ||
| clientId: "test-id" | ||
| clientPassword: "test" | ||
| tests: | ||
| - it: should create the data-plane PriorityClass by default | ||
| template: templates/priority-class.yaml | ||
| asserts: | ||
| - isKind: | ||
| of: PriorityClass | ||
| - equal: | ||
| path: metadata.name | ||
| value: tracebloc-data-plane | ||
| - equal: | ||
| path: value | ||
| value: 1000000 | ||
| - equal: | ||
| path: metadata.annotations["helm.sh/resource-policy"] | ||
| value: keep | ||
| - equal: | ||
| path: globalDefault | ||
| value: false | ||
|
|
||
| - it: should respect a custom PriorityClass name and value | ||
| template: templates/priority-class.yaml | ||
| set: | ||
| priorityClass: | ||
| create: true | ||
| name: tb-prio | ||
| value: 500000 | ||
| asserts: | ||
| - equal: | ||
| path: metadata.name | ||
| value: tb-prio | ||
| - equal: | ||
| path: value | ||
| value: 500000 | ||
|
|
||
| - it: should not render PriorityClass when create is false | ||
| template: templates/priority-class.yaml | ||
| set: | ||
| priorityClass: | ||
| create: false | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 0 | ||
|
|
||
| - it: schema should reject create=true with an empty name | ||
| template: templates/priority-class.yaml | ||
| set: | ||
| priorityClass: | ||
| create: true | ||
| name: "" | ||
| asserts: | ||
| - failedTemplate: | ||
| errorPattern: "name: String length must be greater than or equal to 1" | ||
|
|
||
| - it: should create the mysql PDB by default | ||
| template: templates/mysql-pdb.yaml | ||
| asserts: | ||
| - isKind: | ||
| of: PodDisruptionBudget | ||
| - equal: | ||
| path: metadata.name | ||
| value: mysql-client | ||
| - equal: | ||
| path: spec.minAvailable | ||
| value: 1 | ||
| - equal: | ||
| path: spec.selector.matchLabels.app | ||
| value: mysql-client | ||
|
|
||
| - it: should not render mysql PDB when disabled | ||
| template: templates/mysql-pdb.yaml | ||
| set: | ||
| podDisruptionBudget: | ||
| mysql: | ||
| create: false | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 0 | ||
|
|
||
| - it: jobs-manager PDB should use minAvailable (not maxUnavailable) to actually protect a 1-replica deployment | ||
| templates: | ||
| - templates/jobs-manager-pdb.yaml | ||
| template: templates/jobs-manager-pdb.yaml | ||
| asserts: | ||
| - isKind: | ||
| of: PodDisruptionBudget | ||
| - equal: | ||
| path: spec.minAvailable | ||
| value: 1 | ||
| - notExists: | ||
| path: spec.maxUnavailable |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.