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

Extend ability to set topologySpreadConstraints to all component workloads #589

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions deploy/crds/planetscale.com_etcdlockservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
zone:
type: string
type: object
Expand Down
2 changes: 2 additions & 0 deletions deploy/crds/planetscale.com_vitesscells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
external:
properties:
Expand Down
10 changes: 10 additions & 0 deletions deploy/crds/planetscale.com_vitessclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
external:
properties:
Expand Down Expand Up @@ -1562,6 +1564,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
external:
properties:
Expand Down Expand Up @@ -2718,6 +2722,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- name
Expand Down Expand Up @@ -2928,6 +2934,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
vtadmin:
properties:
Expand Down Expand Up @@ -3107,6 +3115,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
webResources:
properties:
claims:
Expand Down
2 changes: 2 additions & 0 deletions deploy/crds/planetscale.com_vitesskeyspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
zoneMap:
additionalProperties:
Expand Down
2 changes: 2 additions & 0 deletions deploy/crds/planetscale.com_vitessshards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
tolerations:
x-kubernetes-preserve-unknown-fields: true
topologySpreadConstraints:
x-kubernetes-preserve-unknown-fields: true
type: object
zoneMap:
additionalProperties:
Expand Down
56 changes: 56 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,20 @@ ServiceOverrides
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
Copy link
Member

Choose a reason for hiding this comment

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

The way we generate documentation changed in #625. We no longer use </br> as it can break in Markdown. Do you mind merging main onto your branch and re-generating the docs?

<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread etcd pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.ExternalDatastore">ExternalDatastore
Expand Down Expand Up @@ -4883,6 +4897,20 @@ ServiceOverrides
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtctld pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VitessDashboardStatus">VitessDashboardStatus
Expand Down Expand Up @@ -6999,6 +7027,20 @@ ServiceOverrides
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtorc pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VitessOrchestratorStatus">VitessOrchestratorStatus
Expand Down Expand Up @@ -8638,6 +8680,20 @@ ServiceOverrides
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtadmin pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VtadminStatus">VtadminStatus
Expand Down
56 changes: 56 additions & 0 deletions docs/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,20 @@ <h3 id="planetscale.com/v2.EtcdLockserverTemplate">EtcdLockserverTemplate
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread etcd pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.ExternalDatastore">ExternalDatastore
Expand Down Expand Up @@ -4885,6 +4899,20 @@ <h3 id="planetscale.com/v2.VitessDashboardSpec">VitessDashboardSpec
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtctld pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VitessDashboardStatus">VitessDashboardStatus
Expand Down Expand Up @@ -7001,6 +7029,20 @@ <h3 id="planetscale.com/v2.VitessOrchestratorSpec">VitessOrchestratorSpec
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtorc pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VitessOrchestratorStatus">VitessOrchestratorStatus
Expand Down Expand Up @@ -8640,6 +8682,20 @@ <h3 id="planetscale.com/v2.VtAdminSpec">VtAdminSpec
<p>Tolerations allow you to schedule pods onto nodes with matching taints.</p>
</td>
</tr>
<tr>
<td>
<code>topologySpreadConstraints</code></br>
<em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#topologyspreadconstraint-v1-core">
[]Kubernetes core/v1.TopologySpreadConstraint
</a>
</em>
</td>
<td>
<p>TopologySpreadConstraint can optionally be used to
specify how to spread vtadmin pods among the given topology</p>
</td>
</tr>
</tbody>
</table>
<h3 id="planetscale.com/v2.VtadminStatus">VtadminStatus
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/planetscale/v2/etcdlockserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ type EtcdLockserverTemplate struct {
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// TopologySpreadConstraint can optionally be used to
// specify how to spread etcd pods among the given topology
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
frouioui marked this conversation as resolved.
Show resolved Hide resolved
}

// EtcdLockserverStatus defines the observed state of an EtcdLockserver.
Expand Down
12 changes: 12 additions & 0 deletions pkg/apis/planetscale/v2/vitesscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ type VitessDashboardSpec struct {
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// TopologySpreadConstraint can optionally be used to
// specify how to spread vtctld pods among the given topology
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

// VtAdminSpec specifies deployment parameters for vtadmin.
Expand Down Expand Up @@ -547,6 +553,12 @@ type VtAdminSpec struct {
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// TopologySpreadConstraint can optionally be used to
// specify how to spread vtadmin pods among the given topology
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

// ServiceOverrides allows customization of an arbitrary Service object.
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/planetscale/v2/vitesskeyspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ type VitessOrchestratorSpec struct {
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// TopologySpreadConstraint can optionally be used to
// specify how to spread vtorc pods among the given topology
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

// VitessKeyspaceTurndownPolicy is the policy for turning down a keyspace.
Expand Down
28 changes: 28 additions & 0 deletions pkg/apis/planetscale/v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading