-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Validation of OpenTelemetry plugin's "config.resource_attributes" field is too strict #10654
Comments
@seh I used exactly the same Kong ingress controller and Kong version (KIC 2.9.2, Kong 3.2.2) and same manifest
And I could successfully create the plugin. Would you please confirm again the versions of KIC and Kong, and also the manifest? |
As stated earlier, I'm using Kong proxy version 3.2.2 and ingress controller version 2.9.2. Here's another manifest: KongPlugin manifestapiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: opentelemetry-to-collector
namespace: default
plugin: opentelemetry
config:
endpoint: http://opentelemetry-collector.some-ns.svc.cluster.local:4318/v1/traces
resource_attributes:
k8s.namespace.name: default Attempting to apply that manifest yields the following failure reported by kubectl:
Asking for the server to validate in via |
@randmonkey, do you have a ValidatingWebhookConfiguration in place to validate creation requests for KongPlugin objects? |
Hi. I have the exact same problem on Kong 3.2.1 and (after just upgrading) also on Kong 3.3.0 without using Kong Ingress Controller. Even the example from the docs already failing for me
Error: |
Hi @seh I just found a way to set it with decK Plugin Config in decK
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is still not fixed. |
@seh The issue is sort of conditionally fixed. That is, when you send a JSON request it works (after this PR #11091), but when you send a form data request it doesn't work because the variable name in the form data contains the |
Thank you for the detail, but this still strikes me as unnecessarily pedantic: a distinction without a difference. To us users, this is still broken, with no apparent way for us to "fix it" by doing something different. If the Kubernetes validating admission Webhook is sending HTTP form data and it should not, then that fix belongs in the Webhook. Do you think that we should migrate this issue—or file a related one—over to Kong/kubernetes-ingress-controller? It would help to hear what you think would work better instead. |
I think Webhook sends a JSON request, can @randmonkey confirm?
I don't think it's necessary, because this issue is only triggered if you enable the KIC's admission webhook feature, and it won't happen if you disable the admission Webhook. It's essentially a Kong gateway issue. If you're using a version of Kong gateway after the PR I mentioned above, then the problem is actually fixed. |
@ms2008 @seh ALL requests sent from KIC are filled with JSON body, because they are sent by Kong/go-kong: |
@ms2008 We are also experiencing this with the |
As a temporary fix, we could disable the admission controller with:
|
@dlouzan Yes, that fix has been included in 3.4, the exact commit is here 866a15c and you can see that the changelog has been updated as well!
That's right, this only affects the webhook, so temporarily disabling the webhook is a valid workaround. |
@samugi Sure, we will comment back here when we update our systems (probably next week). |
@samugi But I'm realizing, we won't probably be able to test it properly, as I think the helm chart has not yet updated the default kong version to 3.4, isn't it? We tend to wait until that is updated and not keep a custom version for the values. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Unfortunately, I am no longer equipped to test the fix, as I am no longer using Kong. |
At the time of our latest system update, the helm chart did not still incorporate a version that included this fix. We can give feedback later this month. |
This issue is marked as stale because it has been open for 14 days with no activity. |
Dear contributor, We are automatically closing this issue because it has not seen any activity for three weeks. Your contribution is greatly appreciated! Please have a look Sincerely, |
With the most recent helm chart which uses kong 3.4+, this seems to be working properly now 👍 |
Is there an existing issue for this?
Kong version (
$ kong version
)3.2.2
Current Behavior
Following the documentation for the OpenTelemetry plugin, writing a KongPlugin manifest to be translated by the Kong ingress controller (version 2.9.2), I attempted to set a few attributes in the "config.resource_attributes" field, which is of type "map," per the schema. If any of the attribute names include a period—such as "service.name," or "k8s.namespace.name" per the OpenTelemetry semantic conventions—then the ingress controller's validating Webhook rejects the manifest as follows:
This comes from a manifest like the following:
I tried a few variations, placing the "k8s.namespace.name" mapping key name within double quotation marks, and inserting a backslash before the periods, but neither changed the outcome.
If I remove the periods and use, say, "k8snamespacename" as the resource attribute name, Kong's validation procedure accepts the manifest, and the ingress controller programs the proxies accordingly.
Expected Behavior
Kong's validation procedure should admit just about any string here for the attribute name, as the OpenTelemetry specification is still vague on the syntactic constraints for such names.
Steps To Reproduce
Anything else?
I first mentioned this problem in the "kong" channel of the "Kubernetes" Slack workspace.
This plugin entered Kong's code base in #8826 by @mayocream.
The text was updated successfully, but these errors were encountered: