-
Notifications
You must be signed in to change notification settings - Fork 482
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
Reconcile v1beta1 collector CRD #2703
Conversation
dca4839
to
eecca66
Compare
upgrade upgradeFunc | ||
// deprecated use upgradeV1beta1. | ||
upgrade upgradeFunc | ||
upgradeV1beta1 upgradeFuncV1beta1 |
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 didn't want to rewrite old upgrade procedures hence I am adding this API and just adopting tests to work (they need a valid collector spec because v1beta1 is a minimal doing validation)
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 wonder if we should also include some deprecations around these collector version upgrades. like do we need to keep around something that upgrades collector from 0.30.0 to 0.31.0?
d175ceb
to
a8a3798
Compare
3636c19
to
e92d64b
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.
This looks like a good time to upgrade kubebuilder and other similar dependencies. WDYT?
Could you please be more specific about why it is related to this PR? |
There's some differences in output, so it would be easier if we switch before officially publishing v1beta1 CRDs. But you're right, that doesn't need to happen in this PR. |
b207213
to
cc3ab94
Compare
@@ -39,7 +39,8 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) | |||
endif | |||
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) | |||
|
|||
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=200" | |||
# kubectl apply does not work on large CRDs. | |||
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=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.
I don't think we want to publish CRDs with no descriptions on fields?
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.
Unfortunately the kubectl apply
on the CRD will not work (https://github.com/open-telemetry/opentelemetry-operator?tab=readme-ov-file#getting-started).
It will break installations, maybe helm, gitops and e2e tests?
I can take a look at enabling descriptions in a follow-up PR. There we will better see what the implications are. Please book a follow-up ticket if you think we should have descriptions.
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 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 don't see any problems. We should track the issue with descriptions and v1beta1 webhook though.
thanks for the approval. I have created follow issues and linked them to the PR description. @jaronoff97 I think this PR deserves your review as well and please merge it once 0.96.0 operator is released so we have some time to test it in the main. |
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.
mostly questions to confirm my understanding of what's happening here. This looks pretty good overall though.
.chloggen/v1beta1-webhook.yaml
Outdated
subtext: | | ||
Users are expected to migrate to `otelcol.v1beta1.opentelemetry.io`. | ||
The support for `otelcol.v1alpha1.opentelemetry.io` will be removed in the future. | ||
Follow https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#upgrade-existing-objects-to-a-new-stored-version for version migration. |
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 wonder if we should include our own documentation for how to do this. Specifically calling out the deprecated fields and the things to migrate. Especially when it comes to migrating the TA to the new TA crd as well.
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 think what we have might be good enough for now. However we should definitely talk about until when v1alpha1 will be served.
@@ -39,7 +39,8 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) | |||
endif | |||
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) | |||
|
|||
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=200" | |||
# kubectl apply does not work on large CRDs. | |||
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=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.
kind: OpenTelemetryCollector | ||
name: opentelemetrycollectors.opentelemetry.io | ||
resources: | ||
- kind: ConfigMaps |
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.
Is this autogenerated? Aren't we missing some resources like HPA, PDB, ingress, etc?
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.
yes it is, the annotation is on the collector type. This is the same as for v1alpha1 and it's just a hint for users to understand which objects are managed.
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 see. should we update it with the rest of the resources so its accurate going forward? Maybe a good separate 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.
type: OwnNamespace | ||
- supported: true | ||
- supported: false |
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.
what do these flags do?
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.
IIRC It's for the OLM to allow watching of single or multiple namespaces. This was required for introducing the new version.
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.
hm in practice this makes me nervous, doesn't this imply that the operator can no longer watch any namespaces? can you link me the doc?
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 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 have noted this in the release notes
@@ -2,15 +2,16 @@ | |||
apiVersion: apiextensions.k8s.io/v1 | |||
kind: CustomResourceDefinition | |||
metadata: | |||
name: opampbridges.opentelemetry.io | |||
name: opentelemetrycollectors.opentelemetry.io |
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.
why does it think its changing the opampbridge CRD 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.
I changed this manually. The file was not used anyways.
if err != nil { | ||
u.Log.Error(err, "failed to upgrade managed otelcol instances", "name", otelcol.Name, "namespace", otelcol.Namespace) | ||
return otelcol, err | ||
if available.upgrade != 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.
i wonder if we should be recording some metrics about these upgrades:
- how often they succeed / fail
- reason for failure
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 think this is out of the scope of this PR. We should probably book a separate ticket for this if necessary.
upgrade upgradeFunc | ||
// deprecated use upgradeV1beta1. | ||
upgrade upgradeFunc | ||
upgradeV1beta1 upgradeFuncV1beta1 |
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 wonder if we should also include some deprecations around these collector version upgrades. like do we need to keep around something that upgrades collector from 0.30.0 to 0.31.0?
b4a473c
to
523f7ce
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.
two questions. One other thing i thought of which would be a good followup to book would be disabling the reconciliation of v1alpha1 resources behind a featuregate
type: OwnNamespace | ||
- supported: true | ||
- supported: false |
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.
hm in practice this makes me nervous, doesn't this imply that the operator can no longer watch any namespaces? can you link me the doc?
This PR removes |
9bda806
to
1c69e22
Compare
@pavolloffay let's wait to merge this until after #2756 is done |
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
1c69e22
to
857ea86
Compare
…lemetry#2703)" (open-telemetry#2800)" This reverts commit 57024fc.
…lemetry#2703)" (open-telemetry#2800)" This reverts commit 57024fc.
#2813) * Revert "Revert" Add reconciliation for Collector v1beta1 CRD (#2703)" (#2800)" This reverts commit 57024fc. * Fix image Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Clarify hostport Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix issue after israel Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix Signed-off-by: Pavol Loffay <p.loffay@gmail.com> --------- Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
…2703)" (open-telemetry#2800) This reverts commit 9710eed
…lemetry#2703)"… (open-telemetry#2813) * Revert "Revert" Add reconciliation for Collector v1beta1 CRD (open-telemetry#2703)" (open-telemetry#2800)" This reverts commit 57024fc. * Fix image Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Clarify hostport Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix issue after israel Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix Signed-off-by: Pavol Loffay <p.loffay@gmail.com> --------- Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
…lemetry#2703)"… (open-telemetry#2813) * Revert "Revert" Add reconciliation for Collector v1beta1 CRD (open-telemetry#2703)" (open-telemetry#2800)" This reverts commit 57024fc. * Fix image Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Clarify hostport Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix issue after israel Signed-off-by: Pavol Loffay <p.loffay@gmail.com> * Fix Signed-off-by: Pavol Loffay <p.loffay@gmail.com> --------- Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Description:
Do not merge this. the PR will be split into smaller PRs.
Link to tracking Issue:
Resolves: #2620
This can be merged after #2708
Follow ups:
Testing:
Documentation: