Skip to content
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 featuregate for k8s 1.28 native sidecar container #2801

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frzifus
Copy link
Member

@frzifus frzifus commented Mar 29, 2024

Description:

Link to tracking Issue(s):

Testing:

Documentation:

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
if featuregate.EnableNativeSidecarContainers.IsEnabled() {
policy := corev1.ContainerRestartPolicyAlways
container.RestartPolicy = &policy
// TODO(frzifus): Add StartupProbe
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we pre-define a startup probe that checks the ${service.telemetry.metrics.address}/metrics endpoint, expose it in the CRD or do something else?

wdyt @open-telemetry/operator-approvers ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to treat it any differently than we do readiness probes and liveness probes? We can even default to the readiness probe if not set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, but reusing the readiness probe sounds good to me 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we provide another probe type in our API?

// Liveness config for the OpenTelemetry Collector except the probe handler which is auto generated from the health extension of the collector.
// It is only effective when healthcheckextension is configured in the OpenTelemetry Collector pipeline.
// +optional
LivenessProbe *Probe `json:"livenessProbe,omitempty"`

Since that one does not contain a ProbeHandler:

Like here:
https://github.com/kubernetes/api/blob/5147c1a32f6a0b9b155bb84e59f933e0ff8a3792/core/v1/types.go#L2462-L2464

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a good reason... is there much of a difference between these things? Maybe in v1beta1 we should just use the upstream definition?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the upstream definition would extend ours by the ProbeHandler.

@frzifus frzifus marked this pull request as ready for review April 2, 2024 10:24
@frzifus frzifus requested a review from a team as a code owner April 2, 2024 10:24
@frzifus frzifus added the help wanted Extra attention is needed label Apr 2, 2024
Copy link
Contributor

@jaronoff97 jaronoff97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense... is there a way to write an e2e for this?

@swiatekm-sumo
Copy link
Contributor

I think this makes sense... is there a way to write an e2e for this?

Sure, you'd need to add a new test suite and run it with the gate enabled. Then checking if the sidecar is an initContainer should be straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use k8s 1.28 native sidecar for OTEL collector sidecar mode
3 participants