Skip to content

Commit fc02bef

Browse files
bdchathamclaude
andcommitted
refactor: reshape NetworkingStatus to track HTTPRoute hostnames
Replace the stale LoadBalancer-oriented NetworkingStatus with a route-centric model. The status now reports the HTTPRoute hostnames and protocols the controller manages, giving operators visibility into what endpoints are live via kubectl. Removes ExternalServiceName and LoadBalancerIngress (write-only fields from the pre-Gateway architecture). Adds RouteStatus with Hostname and Protocol fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent faaf0cf commit fc02bef

6 files changed

Lines changed: 69 additions & 147 deletions

File tree

api/v1alpha1/seinodedeployment_types.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package v1alpha1
22

33
import (
4-
corev1 "k8s.io/api/core/v1"
54
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
65
)
76

@@ -272,14 +271,19 @@ type GroupNodeStatus struct {
272271

273272
// NetworkingStatus reports the observed state of networking resources.
274273
type NetworkingStatus struct {
275-
// ExternalServiceName is the name of the managed external Service.
274+
// Routes lists the HTTPRoute hostnames managed by this deployment.
276275
// +optional
277-
ExternalServiceName string `json:"externalServiceName,omitempty"`
276+
Routes []RouteStatus `json:"routes,omitempty"`
277+
}
278+
279+
// RouteStatus is the observed state of a single HTTPRoute hostname.
280+
type RouteStatus struct {
281+
// Hostname is the public-facing DNS name for this route.
282+
Hostname string `json:"hostname"`
278283

279-
// LoadBalancerIngress contains the hostname/IP assigned by the cloud
280-
// provider once the LoadBalancer is provisioned.
284+
// Protocol identifies the route type (e.g. "rpc", "evm", "grpc", "rest", "evm-ws").
281285
// +optional
282-
LoadBalancerIngress []corev1.LoadBalancerIngress `json:"loadBalancerIngress,omitempty"`
286+
Protocol string `json:"protocol,omitempty"`
283287
}
284288

285289
// DeploymentStatus tracks metadata for an in-progress deployment.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 19 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/sei.io_seinodedeployments.yaml

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -894,74 +894,23 @@ spec:
894894
description: NetworkingStatus reports the observed state of networking
895895
resources.
896896
properties:
897-
externalServiceName:
898-
description: ExternalServiceName is the name of the managed external
899-
Service.
900-
type: string
901-
loadBalancerIngress:
902-
description: |-
903-
LoadBalancerIngress contains the hostname/IP assigned by the cloud
904-
provider once the LoadBalancer is provisioned.
897+
routes:
898+
description: Routes lists the HTTPRoute hostnames managed by this
899+
deployment.
905900
items:
906-
description: |-
907-
LoadBalancerIngress represents the status of a load-balancer ingress point:
908-
traffic intended for the service should be sent to an ingress point.
901+
description: RouteStatus is the observed state of a single HTTPRoute
902+
hostname.
909903
properties:
910904
hostname:
911-
description: |-
912-
Hostname is set for load-balancer ingress points that are DNS based
913-
(typically AWS load-balancers)
905+
description: Hostname is the public-facing DNS name for
906+
this route.
914907
type: string
915-
ip:
916-
description: |-
917-
IP is set for load-balancer ingress points that are IP based
918-
(typically GCE or OpenStack load-balancers)
908+
protocol:
909+
description: Protocol identifies the route type (e.g. "rpc",
910+
"evm", "grpc", "rest", "evm-ws").
919911
type: string
920-
ipMode:
921-
description: |-
922-
IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified.
923-
Setting this to "VIP" indicates that traffic is delivered to the node with
924-
the destination set to the load-balancer's IP and port.
925-
Setting this to "Proxy" indicates that traffic is delivered to the node or pod with
926-
the destination set to the node's IP and node port or the pod's IP and port.
927-
Service implementations may use this information to adjust traffic routing.
928-
type: string
929-
ports:
930-
description: |-
931-
Ports is a list of records of service ports
932-
If used, every port defined in the service should have an entry in it
933-
items:
934-
description: PortStatus represents the error condition
935-
of a service port
936-
properties:
937-
error:
938-
description: |-
939-
Error is to record the problem with the service port
940-
The format of the error shall comply with the following rules:
941-
- built-in error values shall be specified in this file and those shall use
942-
CamelCase names
943-
- cloud provider specific error values must have names that comply with the
944-
format foo.example.com/CamelCase.
945-
maxLength: 316
946-
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
947-
type: string
948-
port:
949-
description: Port is the port number of the service
950-
port of which status is recorded here
951-
format: int32
952-
type: integer
953-
protocol:
954-
description: |-
955-
Protocol is the protocol of the service port of which status is recorded here
956-
The supported values are: "TCP", "UDP", "SCTP"
957-
type: string
958-
required:
959-
- error
960-
- port
961-
- protocol
962-
type: object
963-
type: array
964-
x-kubernetes-list-type: atomic
912+
required:
913+
- hostname
965914
type: object
966915
type: array
967916
type: object

internal/controller/nodedeployment/networking.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ var seiProtocolRoutes = []struct {
3434

3535
type effectiveRoute struct {
3636
Name string
37+
Protocol string
3738
Hostnames []string
3839
Port int32
39-
WSPort int32 // non-zero when WebSocket requires a separate backend port
40+
WSPort int32
4041
}
4142

4243
// hasExternalService returns true when the deployment has a LoadBalancer
@@ -258,6 +259,7 @@ func resolveEffectiveRoutes(group *seiv1alpha1.SeiNodeDeployment, domain, public
258259
}
259260
er := effectiveRoute{
260261
Name: subdomain,
262+
Protocol: proto.Prefix,
261263
Hostnames: hostnames,
262264
Port: proto.Port,
263265
}

internal/controller/nodedeployment/status.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (r *SeiNodeDeploymentReconciler) updateStatus(ctx context.Context, group *s
4747
group.Status.Phase = computeGroupPhase(group, readyReplicas, group.Spec.Replicas, nodes)
4848

4949
svc, svcErr := r.fetchExternalService(ctx, group)
50-
group.Status.NetworkingStatus = buildNetworkingStatus(group, svc)
50+
group.Status.NetworkingStatus = r.buildNetworkingStatus(group)
5151

5252
setNodesReadyCondition(group, readyReplicas, group.Spec.Replicas, nodes)
5353
setExternalServiceCondition(group, svc, svcErr)
@@ -107,16 +107,21 @@ func (r *SeiNodeDeploymentReconciler) fetchExternalService(ctx context.Context,
107107
return svc, nil
108108
}
109109

110-
func buildNetworkingStatus(group *seiv1alpha1.SeiNodeDeployment, svc *corev1.Service) *seiv1alpha1.NetworkingStatus {
111-
if group.Spec.Networking == nil || group.Spec.Networking.Service == nil {
110+
func (r *SeiNodeDeploymentReconciler) buildNetworkingStatus(group *seiv1alpha1.SeiNodeDeployment) *seiv1alpha1.NetworkingStatus {
111+
routes := resolveEffectiveRoutes(group, r.GatewayDomain, r.GatewayPublicDomain)
112+
if len(routes) == 0 {
112113
return nil
113114
}
114-
svcName := externalServiceName(group)
115-
status := &seiv1alpha1.NetworkingStatus{ExternalServiceName: svcName}
116-
if svc != nil && len(svc.Status.LoadBalancer.Ingress) > 0 {
117-
status.LoadBalancerIngress = svc.Status.LoadBalancer.Ingress
115+
var rs []seiv1alpha1.RouteStatus
116+
for _, er := range routes {
117+
for _, h := range er.Hostnames {
118+
rs = append(rs, seiv1alpha1.RouteStatus{
119+
Hostname: h,
120+
Protocol: er.Protocol,
121+
})
122+
}
118123
}
119-
return status
124+
return &seiv1alpha1.NetworkingStatus{Routes: rs}
120125
}
121126

122127
func setNodesReadyCondition(group *seiv1alpha1.SeiNodeDeployment, ready, desired int32, nodes []seiv1alpha1.SeiNode) {

manifests/sei.io_seinodedeployments.yaml

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -894,74 +894,23 @@ spec:
894894
description: NetworkingStatus reports the observed state of networking
895895
resources.
896896
properties:
897-
externalServiceName:
898-
description: ExternalServiceName is the name of the managed external
899-
Service.
900-
type: string
901-
loadBalancerIngress:
902-
description: |-
903-
LoadBalancerIngress contains the hostname/IP assigned by the cloud
904-
provider once the LoadBalancer is provisioned.
897+
routes:
898+
description: Routes lists the HTTPRoute hostnames managed by this
899+
deployment.
905900
items:
906-
description: |-
907-
LoadBalancerIngress represents the status of a load-balancer ingress point:
908-
traffic intended for the service should be sent to an ingress point.
901+
description: RouteStatus is the observed state of a single HTTPRoute
902+
hostname.
909903
properties:
910904
hostname:
911-
description: |-
912-
Hostname is set for load-balancer ingress points that are DNS based
913-
(typically AWS load-balancers)
905+
description: Hostname is the public-facing DNS name for
906+
this route.
914907
type: string
915-
ip:
916-
description: |-
917-
IP is set for load-balancer ingress points that are IP based
918-
(typically GCE or OpenStack load-balancers)
908+
protocol:
909+
description: Protocol identifies the route type (e.g. "rpc",
910+
"evm", "grpc", "rest", "evm-ws").
919911
type: string
920-
ipMode:
921-
description: |-
922-
IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified.
923-
Setting this to "VIP" indicates that traffic is delivered to the node with
924-
the destination set to the load-balancer's IP and port.
925-
Setting this to "Proxy" indicates that traffic is delivered to the node or pod with
926-
the destination set to the node's IP and node port or the pod's IP and port.
927-
Service implementations may use this information to adjust traffic routing.
928-
type: string
929-
ports:
930-
description: |-
931-
Ports is a list of records of service ports
932-
If used, every port defined in the service should have an entry in it
933-
items:
934-
description: PortStatus represents the error condition
935-
of a service port
936-
properties:
937-
error:
938-
description: |-
939-
Error is to record the problem with the service port
940-
The format of the error shall comply with the following rules:
941-
- built-in error values shall be specified in this file and those shall use
942-
CamelCase names
943-
- cloud provider specific error values must have names that comply with the
944-
format foo.example.com/CamelCase.
945-
maxLength: 316
946-
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
947-
type: string
948-
port:
949-
description: Port is the port number of the service
950-
port of which status is recorded here
951-
format: int32
952-
type: integer
953-
protocol:
954-
description: |-
955-
Protocol is the protocol of the service port of which status is recorded here
956-
The supported values are: "TCP", "UDP", "SCTP"
957-
type: string
958-
required:
959-
- error
960-
- port
961-
- protocol
962-
type: object
963-
type: array
964-
x-kubernetes-list-type: atomic
912+
required:
913+
- hostname
965914
type: object
966915
type: array
967916
type: object

0 commit comments

Comments
 (0)