Comments (8)
Can you post the log of the ingress controller pod, and is there any error that occurred?
from easegress.
Hi, easegress ingress controller implements the standard of k8s ingress controller. So, the globalFilter
is not support yet.
But i have just checked the code and find it seems simple to add this feature.
func newHTTPServerSpecBuilder(template *httpserver.Spec) *httpServerSpecBuilder {
return &httpServerSpecBuilder{
Kind: httpserver.Kind,
Name: "http-server-ingress-controller",
Spec: httpserver.Spec{
Port: template.Port,
KeepAlive: template.KeepAlive,
HTTPS: template.HTTPS,
KeepAliveTimeout: template.KeepAliveTimeout,
MaxConnections: template.MaxConnections,
},
}
}
the problem is when create builder for httpserver in ingress controller, template.GlobalFilter
is not copied. And since GlobalFilter
is a business controller, httpserver in ingress controller namespace can get it.
What do you think @xxx7xxxx? I can't see why we not support this feature?
from easegress.
Can you post the log of the ingress controller pod, and is there any error that occurred?
The logs do not show any exceptions, but the traffic is not passing through the global filter.
2024-03-13T09:38:46.998Z DEBUG httpserver/mux.go:395 http-server-ingress-controller: the matched backend(Pipeline) for [POST /WF_BEIJING] is "pipeline-ingress-easegress-hello-service-60001"
[2024-03-13T09:38:46.998Z] [10.42.0.1:63350 10.42.0.1 POST /WF_BEIJING HTTP/1.1 200] [8.92ms rx:640B tx:186B] [status code: 200 | pipeline(pipeline-ingress-easegress-hello-service-60001): proxy(6.868ms) | proxy#proxy#main#duration: 8.383ms]
from easegress.
Sure, we could support it by adding the copy line, and a profound solution would be adding a general HTTPServerSpeBuilder
for all of them. @tjqc0512 Do you want to address this issue?
➜ easegress rg newHTTPServerSpecBuilder
pkg/object/gatewaycontroller/translator.go
289:func newHTTPServerSpecBuilder(name string) *httpServerSpecBuilder {
590: sb := newHTTPServerSpecBuilder(fmt.Sprintf("http-server-%s-%s", g.Name, l.Name))
pkg/object/meshcontroller/worker/egress.go
101:func newHTTPServerSpecBuilder(httpServerName string, spec *httpserver.Spec) *httpServerSpecBuilder {
526: builder := newHTTPServerSpecBuilder(egs.egressServerName, httpServerSpec)
pkg/object/function/worker/ingress.go
99:func newHTTPServerSpecBuilder(controllerName string) *httpServerSpecBuilder {
194: builder := newHTTPServerSpecBuilder(ings.superSpec.Name())
212: builder := newHTTPServerSpecBuilder(ings.superSpec.Name())
pkg/object/ingresscontroller/translator.go
174:func newHTTPServerSpecBuilder(template *httpserver.Spec) *httpServerSpecBuilder {
482: b := newHTTPServerSpecBuilder(st.httpSvrCfg)
from easegress.
Hi, easegress ingress controller implements the standard of k8s ingress controller. So, the is not support yet.
globalFilter
But i have just checked the code and find it seems simple to add this feature.
func newHTTPServerSpecBuilder(template *httpserver.Spec) *httpServerSpecBuilder { return &httpServerSpecBuilder{ Kind: httpserver.Kind, Name: "http-server-ingress-controller", Spec: httpserver.Spec{ Port: template.Port, KeepAlive: template.KeepAlive, HTTPS: template.HTTPS, KeepAliveTimeout: template.KeepAliveTimeout, MaxConnections: template.MaxConnections, }, } }the problem is when create builder for httpserver in ingress controller, is not copied. And since is a business controller, httpserver in ingress controller namespace can get it.
template.GlobalFilter``GlobalFilter
What do you think @xxx7xxxx? I can't see why we not support this feature?
Sure, I appreciate your guidance. I'll try modifying this feature and rebuild the easegress-server for testing. Additionally, I have a question regarding how to print logs or output logs to a file for a custom-developed filter. Currently, I'm using the github.com/megaease/easegress/pkg/logger library for logging, but it's not outputting logs as expected, for example, logger.Warnf("RsaAuthFilter: 'X-Custom-WF-Name' header is not a string"). I've also tried solutions I found through searching, but none have been successful.
from easegress.
but it's not outputting logs as expected
What's the detail? Does it print all logs except for the log you added? It can't be.
from easegress.
but it's not outputting logs as expected
What's the detail? Does it print all logs except for the log you added? It can't be.
I am unable to print and output logs for all operations within my custom filter. I don't know how to implement printing and outputting logs for debugging purposes.
from easegress.
I don't know the reason. If other filters can print logs, yours can not be the exception. Do you register your filter in source code and make it sure that it has run? Or Just panic in your code to assert that your code has been executed.
from easegress.
Related Issues (20)
- [Question]: how does the sidecar (mesh worker role) intercept outbound traffic HOT 7
- An option for enabling periodic health checks of the servers in Proxy plugin HOT 2
- Strict yaml schema validation via openAPIV3Schema HOT 1
- [Question]: Is there command `egctl convert ` ? HOT 2
- [Question]: egctl apply error HOT 2
- [Question]: New filter run panic HOT 8
- [Question]: Websocket handshake fail HOT 12
- Filter logger optimize HOT 5
- [Bug]: easegress-server --signal-upgrade=true panic HOT 2
- [Question]:Is buildOutputResponse missing ? HOT 4
- Filter will be created even it is not referenced in flow HOT 3
- Adding url decoding function to extend template functionality in easegress builder filters HOT 5
- [Question]: Why does pipeline not map properly to the backend server? HOT 3
- [Question]: Pipeline HandleWithBeforeAfter not work well HOT 23
- [Question]: Is there something wrong with the example in this IngressController doc? HOT 1
- [Question]: Why does my IngressController experiment not work? HOT 17
- [Question]: When using Easegress images version V2.6.1 and above, the IngressController does not function properly. HOT 5
- [Question]: Websocket log expected error HOT 3
- Report the use of components with vulnerabilities in easegress HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easegress.