Skip to content
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
18 changes: 13 additions & 5 deletions api/v1/externalservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ type ExternalServiceSpec struct {
// +optional
JsonClusterAccessLogs bool `json:"envoyJsonClusterAccessLogs,omitempty"`

// TopologySpreadSkews is a struct that allows overriding the topology spread skews for the service
// TopologySpreadSkews allows overriding the topology spread skews for the service
// +optional
TopologySpreadSkews struct {
Zone int `json:"zone,omitempty"`
Hostname int `json:"hostname,omitempty"`
} `json:"topologySpreadSkews,omitempty"`
TopologySpreadSkews TopologySpreadSkews `json:"topologySpreadSkews,omitempty"`

// ServiceTrafficDistribution allows configuration of the service traffic distribution mode
// if it's not set the field won't be set at all
Expand All @@ -114,6 +111,17 @@ type ExternalServicePort struct {
Port int32 `json:"port,omitempty"`
}

// TopologySpreadSkews allows per-service overrides of topology spread constraint max skew values.
type TopologySpreadSkews struct {
// Zone is the max skew for the zone topology key. If unset, falls back to the global env var or default.
// +optional
Zone int `json:"zone,omitempty"`

// Hostname is the max skew for the hostname topology key. If unset, falls back to the global env var or default.
// +optional
Hostname int `json:"hostname,omitempty"`
}

// ExternalServiceStatus defines the observed state of ExternalService
type ExternalServiceStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
Expand Down
15 changes: 15 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

19 changes: 19 additions & 0 deletions config/crd/bases/egress.monzo.com_externalservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,30 @@ spec:
serviceTopologyMode:
description: Provides a way to override the global default
type: string
serviceTrafficDistribution:
description: |-
ServiceTrafficDistribution allows configuration of the service traffic distribution mode
if it's not set the field won't be set at all
https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution
type: string
targetCPUUtilizationPercentage:
description: Target average CPU utilization (represented as a percentage
of requested CPU) over all the pods. Defaults to 50
format: int32
type: integer
topologySpreadSkews:
description: TopologySpreadSkews allows overriding the topology spread
skews for the service
properties:
hostname:
description: Hostname is the max skew for the hostname topology
key. If unset, falls back to the global env var or default.
type: integer
zone:
description: Zone is the max skew for the zone topology key. If
unset, falls back to the global env var or default.
type: integer
type: object
type: object
status:
description: ExternalServiceStatus defines the observed state of ExternalService
Expand Down