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

Max length k8s namespace breaks certificate creation script #1739

Open
JonRossEventus opened this issue May 1, 2023 · 1 comment · May be fixed by #1740
Open

Max length k8s namespace breaks certificate creation script #1739

JonRossEventus opened this issue May 1, 2023 · 1 comment · May be fixed by #1740

Comments

@JonRossEventus
Copy link

https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/5f2efd4ff97e7c0bfdb726a066118d3401576730/hack/gencerts.sh#L120-L125

x509 cert's only allow 64 characters for the CN name, and all k8's values we're using here could be that length by themselves.

"/CN=${SERVICE}.${NAMESPACE}.svc"

The script already is using the cert extensions for DNS, but if you try to setup the operator in a namespace with 40+ characters, it will fail to launch with an error like this:

Generating certs for the Spark pod admission webhook in /tmp/spark-pod-webhook-certs.
803BB7BE987F0000:error:06800097:asn1 encoding routines:ASN1_mbstring_ncopy:string too long:../crypto/asn1/a_mbstr.c:106:maxsize=64
req: Error adding subject name attribute "/CN=app-spark-operator-webhook.eventus-app-885b9f64-87f8-4eda-a6a3-9895cdd5fab5.svc"

The script should probably just use the value for the service as it's not going to be longer than 64 characters and is a valid dns endpoint within the namespace

 "/CN=${SERVICE}"
@cinesia
Copy link

cinesia commented Nov 22, 2023

Any news? It's been a long time since it was open. Please, open your PR and sing the CLA to continue with the fix.
Let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants