Skip to content
Draft
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
11 changes: 11 additions & 0 deletions api/v1/runtimecomponent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ type RuntimeComponentService struct {
// Configure service session affinity.
// +operator-sdk:csv:customresourcedefinitions:order=19,type=spec
SessionAffinity *RuntimeComponentServiceSessionAffinity `json:"sessionAffinity,omitempty"`

// Disables topology aware annotations from being added to the Service. Defaults to false.
// +operator-sdk:csv:customresourcedefinitions:order=20,type=spec,displayName="Disable Topology",xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
DisableTopology *bool `json:"disableTopology,omitempty"`
}

// Configure service session affinity
Expand Down Expand Up @@ -765,6 +769,13 @@ func (cr *RuntimeComponent) GetManageTLS() *bool {
return cr.Spec.ManageTLS
}

func (cr *RuntimeComponent) GetDisableTopology() *bool {
if cr.Spec.Service != nil {
return cr.Spec.Service.DisableTopology
}
return nil
}

// GetDeployment returns deployment settings
func (cr *RuntimeComponent) GetDeployment() common.BaseComponentDeployment {
if cr.Spec.Deployment == nil {
Expand Down
5 changes: 5 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.

4 changes: 4 additions & 0 deletions bundle/manifests/rc.app.stacks_runtimecomponents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5168,6 +5168,10 @@ spec:
certificate and CA to be mounted in the pod. The following keys
are valid in the secret: ca.crt, tls.crt, and tls.key.'
type: string
disableTopology:
description: Disables topology aware annotations from being added
to the Service. Defaults to false.
type: boolean
nodePort:
description: Node proxies this port into your service.
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ metadata:
categories: Application Runtime
certified: "true"
containerImage: icr.io/appcafe/runtime-component-operator:daily
createdAt: "2025-12-08T16:01:38Z"
createdAt: "2026-01-20T21:22:29Z"
description: Deploys any runtime component with dynamic and auto-tuning configuration
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "true"
Expand Down Expand Up @@ -339,6 +339,12 @@ spec:
- description: Configure service session affinity.
displayName: Session Affinity
path: service.sessionAffinity
- description: Disables topology aware annotations from being added to the Service.
Defaults to false.
displayName: Disable Topology
path: service.disableTopology
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Setting to maintain session affinity. Must be ClientIP or None.
Defaults to None.
displayName: Session Affinity Type
Expand Down
1 change: 1 addition & 0 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,5 @@ type BaseComponent interface {
GetDisableServiceLinks() *bool
GetTolerations() []corev1.Toleration
GetDNS() BaseComponentDNS
GetDisableTopology() *bool
}
4 changes: 4 additions & 0 deletions config/crd/bases/rc.app.stacks_runtimecomponents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5164,6 +5164,10 @@ spec:
certificate and CA to be mounted in the pod. The following keys
are valid in the secret: ca.crt, tls.crt, and tls.key.'
type: string
disableTopology:
description: Disables topology aware annotations from being added
to the Service. Defaults to false.
type: boolean
nodePort:
description: Node proxies this port into your service.
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ spec:
- description: Configure service session affinity.
displayName: Session Affinity
path: service.sessionAffinity
- description: Disables topology aware annotations from being added to the Service.
Defaults to false.
displayName: Disable Topology
path: service.disableTopology
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Setting to maintain session affinity. Must be ClientIP or None.
Defaults to None.
displayName: Session Affinity Type
Expand Down
4 changes: 4 additions & 0 deletions internal/deploy/kubectl/runtime-component-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5167,6 +5167,10 @@ spec:
certificate and CA to be mounted in the pod. The following keys
are valid in the secret: ca.crt, tls.crt, and tls.key.'
type: string
disableTopology:
description: Disables topology aware annotations from being added
to the Service. Defaults to false.
type: boolean
nodePort:
description: Node proxies this port into your service.
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5167,6 +5167,10 @@ spec:
certificate and CA to be mounted in the pod. The following keys
are valid in the secret: ca.crt, tls.crt, and tls.key.'
type: string
disableTopology:
description: Disables topology aware annotations from being added
to the Service. Defaults to false.
type: boolean
nodePort:
description: Node proxies this port into your service.
format: int32
Expand Down
17 changes: 10 additions & 7 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func ErrorIsNoMatchesForKind(err error, kind string, version string) bool {
func CustomizeService(svc *corev1.Service, ba common.BaseComponent) {
obj := ba.(metav1.Object)
svc.Labels = ba.GetLabels()
CustomizeServiceAnnotations(svc)
CustomizeServiceAnnotations(svc, ba.GetDisableTopology())
svc.Annotations = MergeMaps(svc.Annotations, ba.GetAnnotations())

if len(svc.Spec.Ports) == 0 {
Expand Down Expand Up @@ -280,12 +280,15 @@ func CustomizeService(svc *corev1.Service, ba common.BaseComponent) {
}
}

func CustomizeServiceAnnotations(svc *corev1.Service) {
// Enable topology aware hints/routing
serviceAnnotations := make(map[string]string)
serviceAnnotations["service.kubernetes.io/topology-aware-hints"] = "Auto" // Topology Aware Hints (< k8s version 1.27)
serviceAnnotations["service.kubernetes.io/topology-mode"] = "Auto" // Topology Aware Routing (>= k8s version 1.27)
svc.Annotations = MergeMaps(svc.Annotations, serviceAnnotations)
func CustomizeServiceAnnotations(svc *corev1.Service, disableTopology *bool) {
if disableTopology != nil && *disableTopology {
delete(svc.Annotations, "service.kubernetes.io/topology-aware-hints")
delete(svc.Annotations, "service.kubernetes.io/topology-mode")
} else {
serviceAnnotations := make(map[string]string)
serviceAnnotations["service.kubernetes.io/topology-mode"] = "Auto" // Topology Aware Routing (>= k8s version 1.27)
svc.Annotations = MergeMaps(svc.Annotations, serviceAnnotations)
}
}

func CustomizeProbes(container *corev1.Container, ba common.BaseComponent) {
Expand Down