-
Notifications
You must be signed in to change notification settings - Fork 450
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
Add ingress options #1128
Add ingress options #1128
Conversation
d2d45d4
to
b8a6bbc
Compare
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 are missing tests for this PR - controller, e2e.
003e709
to
2bf168b
Compare
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
2bf168b
to
409d6e4
Compare
linting failed |
409d6e4
to
9f50e48
Compare
y, iam working on it. Think i messed up some things while reordering my commits 🤦 |
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.
Some comments:
- the webhook is missing tests
- there is a missing constant for
none
with a defaulting webhook (if a webhook is needed to set it as default).
@@ -166,5 +167,12 @@ func (r *OpenTelemetryCollector) validateCRDSpec() error { | |||
|
|||
} | |||
|
|||
mode := strings.ToLower(string(r.Spec.Mode)) | |||
if r.Spec.Ingress.Type == IngressTypeNginx && (mode == "deployment" || mode == "daemonset" || mode == "statefulset") { |
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.
for mode it's better to use the defined mode constants
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.
The if statement does not seem correct. It can be easier to compare if the mode is sidecar as it is the only not supported config.
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.
you mean r.Spec.Ingress.Type == IngressTypeNginx && r.Spec.Mode != ModeSidecar
? Thats the check i made in the beginning. But as soon as another mode gets added, the condition is invalid.
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.
I mean r.Spec.Ingress.Type == IngressTypeNginx && r.Spec.Mode == ModeSidecar
then throw an error.
If a new mode is added we don't know if ingress will be supported or not
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.
my intention to test for the supported modis was to be a bit more restrictive. If a new mode is added, the documentation will have to be adapted anyway. But have there no strong opinion and changed it. :)
|
||
// Hostname by which the ingress proxy can be reached. | ||
// +optional | ||
Hostname string `json:"hostname,omitempty"` |
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.
Could you please explain this configuration? Why is it needed?
https://kubernetes.io/docs/concepts/services-networking/ingress/
PS: I don't have much experience with ingress so I might ask something stupid here.
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.
With the ingress entry we want to direct incoming traffic on port 80 or 443 to our service. Without a set hostname, this applies to all domains, which can not be intentional. For example if traffic with the same path but from another domain should be directed to another service.
It could look like this:
NAMESPACE NAME HOST/PORT PATH SERVICES PORT
test123 jaeger-skupper example.com /traces jaeger-skupper-collector https-collector
test456 jaeger-ingress another-example.com /traces jaeger-ingress-collector grpc-collector
dcc99bb
to
3854e23
Compare
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
54c8a0b
to
cdd3815
Compare
Signed-off-by: Benedikt Bongartz <[email protected]>
Signed-off-by: Benedikt Bongartz <[email protected]>
cdd3815
to
dd031a6
Compare
* add ingress name generation function Signed-off-by: Benedikt Bongartz <[email protected]> * extend otelcol crd with minimalistic ingress options Signed-off-by: Benedikt Bongartz <[email protected]> * support collector ingress reconciling Signed-off-by: Benedikt Bongartz <[email protected]> * register ingress reconciler Signed-off-by: Benedikt Bongartz <[email protected]> * grant permission to create, modify and delete ingress entries Signed-off-by: Benedikt Bongartz <[email protected]> * add ingress integration tests Signed-off-by: Benedikt Bongartz <[email protected]> * verify if collector mode is compatible with ingress settings Signed-off-by: Benedikt Bongartz <[email protected]> * create dedicated ingress type Signed-off-by: Benedikt Bongartz <[email protected]> * follow recommendations Signed-off-by: Benedikt Bongartz <[email protected]> * regenerate Signed-off-by: Benedikt Bongartz <[email protected]> Signed-off-by: Benedikt Bongartz <[email protected]>
Part of: #902
Example:
Configure kind: