Skip to content

Commit

Permalink
Add support for TopologySpreadConstraints in envoy ingress deployments (
Browse files Browse the repository at this point in the history
  • Loading branch information
amuraru committed Oct 18, 2021
1 parent bcfa366 commit 577d841
Show file tree
Hide file tree
Showing 5 changed files with 524 additions and 11 deletions.
21 changes: 15 additions & 6 deletions api/v1beta1/kafkacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,16 @@ type EnvoyConfig struct {
// +kubebuilder:validation:Minimum=1
Concurrency int32 `json:"concurrency,omitempty"`
// +kubebuilder:validation:Minimum=1
Replicas int32 `json:"replicas,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
// ServiceAccountName the name of service account
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// ImagePullSecrets image pull secrets
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// NodeSelector node selector for envoy pods
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Annotations defines the annotations placed on the envoy ingress controller deployment
Annotations map[string]string `json:"annotations,omitempty"`
LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
Expand Down Expand Up @@ -663,6 +667,11 @@ func (eConfig *EnvoyConfig) GetAffinity() *corev1.Affinity {
return eConfig.Affinity
}

//GetTopologySpreadConstaints returns the Affinity config for envoy
func (eConfig *EnvoyConfig) GetTopologySpreadConstaints() []corev1.TopologySpreadConstraint {
return eConfig.TopologySpreadConstraints
}

//GetNodeSelector returns the node selector for the given broker
func (bConfig *BrokerConfig) GetNodeSelector() map[string]string {
return bConfig.NodeSelector
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 577d841

Please sign in to comment.