apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.82k stars 6.52k forks source link

[Bug] [SWCK Helm Chart] release full name doesn't respect the one in `values.yaml` file (or `--set` option) #10696

Closed kezhenxu94 closed 1 year ago

kezhenxu94 commented 1 year ago

Search before asking

Apache SkyWalking Component

Helm Chart (apache/skywalking-kubernetes)

What happened

We provide the nameOverride and fullnameOverride for users to customize the service/Pod names

https://github.com/apache/skywalking-kubernetes/blob/670d7053aab8dfbed9e325f9f3345dc6696e6352/chart/operator/values.yaml#L55-L56

but we also add a very long suffix (like -controller-manager-metrics-service) to the fullnameOverride in some resources

https://github.com/apache/skywalking-kubernetes/blob/670d7053aab8dfbed9e325f9f3345dc6696e6352/chart/operator/templates/service.yaml#L22

This can easily make the final name exceed the maximum allowed length (usually 64) in Kubernetes and cause the deployment fail.

We should trim the final name to 64 after we add those suffices, or remove those suffices wherever possible, for example, I don't think we need suffix -mutating-webhook-configuration in the MutatingWebhookConfiguration here

https://github.com/apache/skywalking-kubernetes/blob/670d7053aab8dfbed9e325f9f3345dc6696e6352/chart/operator/templates/webhook.yaml#L22

What you expected to happen

no matter how long the release name is given, the deployment should be in success

How to reproduce

Example:

helm -n adapter upgrade --install test-a-very-long-name-that-should-fail ./chart/operator

Anything else

No response

Are you willing to submit PR?

Code of Conduct

dashanji commented 1 year ago

@kezhenxu94 Thanks for pointing out the bug, I will fix it later.