-
Notifications
You must be signed in to change notification settings - Fork 468
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 TLS support to auto-instrumentation #3338
Conversation
|
||
// CA defines the key of certificate in the configmap map, secret or absolute path to a certificate. | ||
// The absolute path can be used when certificate is already present on the workload filesystem e.g. | ||
// /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt |
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.
// /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt | |
// /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt | |
// +optional |
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.
@frzifus what does the +optional
do ? It does not seem to have any effect on the generated bundle or code.
We should get rid of it https://book.kubebuilder.io/reference/markers I will submit a follow up PR to remove +optional
|
||
// ConfigMapName defines configmap name with CA certificate. If it is not defined CA certificate will be | ||
// used from the secret defined in SecretName. | ||
ConfigMapName string `json:"configMapName,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.
I'm not sure about this name because it is something associated to the CA directly. Maybe configMapName
-> caConfigMap
.
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@@ -236,6 +236,14 @@ func (w InstrumentationWebhook) validate(r *Instrumentation) (admission.Warnings | |||
default: | |||
return warnings, fmt.Errorf("spec.sampler.type is not valid: %s", r.Spec.Sampler.Type) | |||
} | |||
|
|||
if r.Spec.Exporter.TLS != nil { |
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 also add a validation that if the scheme for the endpoint contains https
TLS must be defined.
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.
no, this can break already existing installations. Users could configure env vars in the env
section or directly on their deployments.
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 go the reverse and if TLS is set we should block when https is not set. If HTTPS is set, TLS doesn't need to be set.
} | ||
// the name cannot be longer than 63 characters | ||
secretVolumeName := naming.Truncate("otel-auto-secret-%s", 63, exporter.TLS.SecretName) | ||
secretMountPath := fmt.Sprintf("/otel-auto-instrumentation-secret-%s", exporter.TLS.SecretName) |
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.
should we care about the max for a mount path? I'm not 100% there is one (i couldn't find anything in the kube API docs) but given we truncate the names here, i feel like we should try to keep the mount path name minimal too.
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.
that does not seem to be an issue only the volume name
file: 01-assert.yaml | ||
catch: | ||
- podLogs: | ||
selector: app=my-java |
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.
should we run a curl against the collector to see that span traffic made it successfully to the collector?
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.
We don't do this for auto-instrumentation tests there is a booked ticket for it #552
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.
okay fine :P I can do this post my refactor.
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
* `secrets`: Add TLS support to auto-instrumentation [#3338](open-telemetry/opentelemetry-operator#3338) * `targetallocators`: Generate only TargetAllocator CR from Collector CR [#3402](open-telemetry/opentelemetry-operator#3402)
* `secrets`: Add TLS support to auto-instrumentation [#3338](open-telemetry/opentelemetry-operator#3338) * `targetallocators`: Generate only TargetAllocator CR from Collector CR [#3402](open-telemetry/opentelemetry-operator#3402)
* `secrets`: Add TLS support to auto-instrumentation [#3338](open-telemetry/opentelemetry-operator#3338) * `targetallocators`: Generate only TargetAllocator CR from Collector CR [#3402](open-telemetry/opentelemetry-operator#3402)
* `secrets`: Add TLS support to auto-instrumentation [#3338](open-telemetry/opentelemetry-operator#3338) * `targetallocators`: Generate only TargetAllocator CR from Collector CR [#3402](open-telemetry/opentelemetry-operator#3402)
* Release operator 0.114.1 Signed-off-by: Alex Raiu <raiu.andrei@protonmail.com> * Update operator clusterrole * `secrets`: Add TLS support to auto-instrumentation [#3338](open-telemetry/opentelemetry-operator#3338) * `targetallocators`: Generate only TargetAllocator CR from Collector CR [#3402](open-telemetry/opentelemetry-operator#3402) * Add `targetAllocatorFallbackStrategy` feature flag Feature flag available since `v0.114.0` (Add allocation_fallback_strategy option as fallback strategy for per-node strategy [#3482](open-telemetry/opentelemetry-operator#3482)) * Update operator-test with manager label Adding `control-plane: controller-manager` label to match [operator-restart e2e test](open-telemetry/opentelemetry-operator#3486) --------- Signed-off-by: Alex Raiu <raiu.andrei@protonmail.com>
Description:
Link to tracking Issue(s):
Todos:
Testing:
On OpenShifit
Another Example for Openshift Ca bundle and serving certs
Documentation: