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

chore: update polardb example with SchedulePolicy API exampels #1123

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
58 changes: 56 additions & 2 deletions examples/polardbx/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,25 @@ spec:
componentSpecs:
- name: gms
componentDefRef: gms
serviceAccountName: kb-polardbx-cluster
# this ia an simple example of schedulingPolicy
# pods from the same component `gms` cannot be scheduled to the node
schedulingPolicy:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
apps.kubeblocks.io/component-name: gms
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
apps.kubeblocks.io/component-name: gms
topologyKey: kubernetes.io/hostname
replicas: 1
resources:
limits:
Expand All @@ -37,7 +55,7 @@ spec:
storage: 20Gi
- name: dn
componentDefRef: dn
replicas: 3
replicas: 1
resources:
limits:
cpu: '0.5'
Expand All @@ -55,6 +73,23 @@ spec:
storage: 20Gi
- name: cn
componentDefRef: cn
# this ia an simple example of schedulingPolicy
# pods cannot be scheduled to the node with any POD from the same cluster `polardbx-cluster`
schedulingPolicy:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
topologyKey: kubernetes.io/hostname
replicas: 1
resources:
limits:
Expand All @@ -65,6 +100,25 @@ spec:
memory: 1Gi
- name: cdc
componentDefRef: cdc
# this ia an simple example of schedulingPolicy
# pods are preferred be scheduled to the node with PODs from component `dn`
schedulingPolicy:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
apps.kubeblocks.io/component-name: dn
topologyKey: kubernetes.io/hostname
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: polardbx-cluster
apps.kubeblocks.io/component-name: dn
topologyKey: kubernetes.io/hostname
replicas: 1
resources:
limits:
Expand Down
Loading