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

affinity #203

Draft
wants to merge 114 commits into
base: 1.5.0
Choose a base branch
from
Draft

affinity #203

wants to merge 114 commits into from

Conversation

rasika-chivate
Copy link
Collaborator

No description provided.

@@ -0,0 +1,170 @@
# Leveraging Affinity in Percona Everest

!!! warning
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it should just be an info or note instead of a warning

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@recharte Let's say it is Important.


|**Attributes** |**Description** |**Note** |
|----------------|-----------------|--------------|
|**Components**|<ul><li>Config Server</li><li>DB Node</li><li>Router</br></br></li><li>DB Node</br><br></li><li>DB Node</li><li>Proxy</li></ul>|Applicable for **MongoDB sharded cluster**.<br/></br></br></br></br>Applicable for **MongoDB non sharded cluster**.</br></br>Applicable for **MySQL** and **PostgreSQL** databases.|
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't feel strongly opinionated about this but I think we could make the table simpler to understand if we go with something like:

  • DB node
  • Proxy/Router/PGBouncer - Applicable for MySQL, MongoDB sharded clusters and PostgreSQL databases.
  • Config Server - Applicable for MongoDB sharded clusters.

docs/use/affinity.md Show resolved Hide resolved
docs/use/affinity.md Show resolved Hide resolved
Comment on lines 81 to 91
```sh
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/region
operator: In
values:
- "us-west2"
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we show a screenshot configuring this instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didnt have the build so instead added this...

docs/use/affinity.md Outdated Show resolved Hide resolved
Comment on lines 123 to 140
Let's consider a use case in which you want to ensure that no HAProxy pods should be scheduled to run on the same Kubernetes node.


affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: NotIn
values:
- haproxy
topologyKey: "kubernetes.io/hostname"

??? info "What happens under the hood"
- The pod will not be scheduled on nodes that contain pods labeled with `app=haproxy`.

- If no nodes match, the pod will not be scheduled until a suitable node becomes available.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we use the default rule that we set as an example?
Simply setting topologyKey: "kubernetes.io/hostname" ensures that the scheduler will try to spread the different DB pods across different k8s nodes, ensuring better fault tolerance in case of node failure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also think it's important to have the default rule explained somewhere so we could do both here 🙂

Copy link
Collaborator Author

@rasika-chivate rasika-chivate Jan 21, 2025

Choose a reason for hiding this comment

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

We can explain it here itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definitely. It will be more useful.

docs/use/affinity.md Outdated Show resolved Hide resolved
docs/affinity.md Outdated Show resolved Hide resolved
Co-authored-by: Diogo Recharte <[email protected]>
@rasika-chivate rasika-chivate temporarily deployed to affinity - Everest Release Branch PR #203 January 21, 2025 16:57 — with Render Destroyed
@rasika-chivate rasika-chivate temporarily deployed to affinity - Everest Release Branch PR #203 January 21, 2025 16:58 — with Render Destroyed
Co-authored-by: Diogo Recharte <[email protected]>
@rasika-chivate rasika-chivate temporarily deployed to affinity - Everest Release Branch PR #203 January 21, 2025 16:58 — with Render Destroyed
Co-authored-by: Diogo Recharte <[email protected]>
@rasika-chivate rasika-chivate temporarily deployed to affinity - Everest Release Branch PR #203 January 21, 2025 16:58 — with Render Destroyed
Co-authored-by: Diogo Recharte <[email protected]>
Co-authored-by: Diogo Recharte <[email protected]>
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