Skip to content

Conversation

nemacysts
Copy link
Member

This should help Karpenter spread things out.

This should help Karpenter spread things out.
raw_object: Dict[str, Any]


class TopologySpreadContraint(TypedDict):
Copy link
Member

Choose a reason for hiding this comment

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

Why we need to create a local class since it exists in k8s lib?
I am asking because TSC will be changed in next(ish) release.
e.g. nodeAffinityPolicy, nodeTaintsPolicy, matchLabelKeys, minDomains

Copy link
Member Author

Choose a reason for hiding this comment

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

this is for the typing task_proc task_config data: we get data as dicts and then later translate them to k8s objects

@nemacysts
Copy link
Member Author

I tested this with a local tron using with something like

                topology_spread_constraints=[
                    {
                        "max_skew": 1,
                        "topology_key": "topology.kubernetes.io/zone",
                        "when_unsatisfiable": "ScheduleAnyway",
                        "label_selector": {
                            "app.kubernetes.io/managed-by": "tron",
                        },
                    },
                ],

and pods were correctly spun up with

  topologySpreadConstraints:
  - labelSelector:
      matchLabels:
        app.kubernetes.io/managed-by: tron
    maxSkew: 1
    topologyKey: topology.kubernetes.io/zone
    whenUnsatisfiable: ScheduleAnyway

in their pod specs (and I saw pods launch across multiple AZs)

@nemacysts nemacysts marked this pull request as ready for review October 21, 2024 21:45
Co-authored-by: Jen Patague <[email protected]>
@nemacysts nemacysts requested a review from jfongatyelp October 25, 2024 14:02
@nemacysts nemacysts merged commit 65c7f95 into master Oct 28, 2024
2 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.

3 participants