Skip to content

Commit

Permalink
Add fields for HealthCheck
Browse files Browse the repository at this point in the history
*HealthCheck Ip is added in EndpointSpec
*Latency is added in GatewayStatus

Fixes: #821
Signed-off-by: Aswin Surayanarayanan <[email protected]>
  • Loading branch information
aswinsuryan authored and tpantelis committed Nov 10, 2020
1 parent bb804b0 commit 365f238
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
19 changes: 17 additions & 2 deletions pkg/apis/submariner.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1

import (
"fmt"
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -43,8 +44,10 @@ type Endpoint struct {
}

type EndpointSpec struct {
ClusterID string `json:"cluster_id"`
CableName string `json:"cable_name"`
ClusterID string `json:"cluster_id"`
CableName string `json:"cable_name"`
// +optional
HealthCheckIP string `json:"healthCheckIP,omitempty"`
Hostname string `json:"hostname"`
Subnets []string `json:"subnets"`
PrivateIP string `json:"private_ip"`
Expand Down Expand Up @@ -81,6 +84,16 @@ type GatewayStatus struct {
Connections []Connection `json:"connections"`
}

// LatencySpec describes the round trip time information in nanoseconds for a packet
// between the gateway pods of two clusters.
type LatencySpec struct {
LastRTT time.Duration `json:"lastRTT"`
MinRTT time.Duration `json:"minRTT"`
AverageRTT time.Duration `json:"averageRTT"`
MaxRTT time.Duration `json:"maxRTT"`
StdDevRTT time.Duration `json:"stddevRTT"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type GatewayList struct {
Expand All @@ -100,6 +113,8 @@ type Connection struct {
Status ConnectionStatus `json:"status"`
StatusMessage string `json:"statusMessage"`
Endpoint EndpointSpec `json:"endpoint"`
// +optional
Latency *LatencySpec `json:"latency,omitempty"`
}

type ConnectionStatus string
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/submariner.io/v1/zz_generated.deepcopy.go

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

0 comments on commit 365f238

Please sign in to comment.