-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implment BackendRefs in EnvoyProxy #3080
Conversation
b693668
to
27fadb3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3080 +/- ##
==========================================
+ Coverage 66.51% 66.59% +0.08%
==========================================
Files 161 158 -3
Lines 22673 21996 -677
==========================================
- Hits 15080 14648 -432
+ Misses 6720 6503 -217
+ Partials 873 845 -28 ☔ View full report in Codecov by Sentry. |
7085d61
to
cc9a69c
Compare
api/v1alpha1/accesslogging_types.go
Outdated
@@ -96,11 +96,14 @@ type FileEnvoyProxyAccessLog struct { | |||
|
|||
// OpenTelemetryEnvoyProxyAccessLog defines the OpenTelemetry access log sink. | |||
// | |||
// +kubebuilder:validation:XValidation:message="BackendRef only support Service Kind.",rule="!has(self.backendRef) || !has(self.backendRef.kind) || self.backendRef.kind == 'Service'" | |||
// +kubebuilder:validation:XValidation:message="host or backendRef needs to be set",rule="has(self.host) || has(self.backendRef)" | |||
// +kubebuilder:validation:XValidation:message="backendRef only support Service Kind.",rule="!has(self.backendRef) || self.backendRef.kind == 'Service'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, the previous version was more rigorous, but fails on 1.28.0
.
Good news, there's dafault value on kind
.
blocked on #3091 |
2b0c4e9
to
577f8aa
Compare
Signed-off-by: zirain <zirain2009@gmail.com>
577f8aa
to
a4dc637
Compare
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
/retest |
@@ -407,3 +408,10 @@ type KubernetesPatchSpec struct { | |||
// Object contains the raw configuration for merged object | |||
Value apiextensionsv1.JSON `json:"value"` | |||
} | |||
|
|||
// BackendRef defines how an ObjectReference that is specific to BackendRef. | |||
type BackendRef struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
if sink.OpenTelemetry.Host != nil { | ||
host, port = *sink.OpenTelemetry.Host, uint32(sink.OpenTelemetry.Port) | ||
} | ||
if len(sink.OpenTelemetry.BackendRefs) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a TODO here to support multiple backendRefs in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EG support multi sinks, I don't think that future exists.
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" | ||
) | ||
|
||
func BackendHostAndPort(backendRef gwapiv1.BackendObjectReference, defaultNamespace string) (string, uint32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we find a way to reuse
gateway/internal/gatewayapi/route.go
Line 1068 in c943042
func (t *Translator) processDestination(backendRefContext BackendRefContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's address this first and then fix it with follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a working implementation using endpoints for the backendRef on the #3062 draft that I'd put together while waiting on APIs to be settled so I could test things out end to end while I had time to focus on it.
might be able to pull pieces of that and use them here, particularly the common bits in the controller that are required to watch the services and endpoints for backendRefs on EnvoyProxies
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/retest |
* implment BackendRef in EnvoyProxy Signed-off-by: zirain <zirain2009@gmail.com>
* implment BackendRef in EnvoyProxy Signed-off-by: zirain <zirain2009@gmail.com>
xref: #3041