kubeflow / spark-operator

Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Apache License 2.0
2.81k stars 1.38k forks source link

[BUG] helm chart crds are invalid in chart versions >=1.4.5 #2151

Closed dada-engineer closed 3 months ago

dada-engineer commented 3 months ago

Description

When Running the kubectl apply command to install custom resource definitions for spark-operator I get an error that metadata.annotations are too long. It worked in 1.4.4 of the chart but not in newer versions.

The error is:

The CustomResourceDefinition "sparkapplications.sparkoperator.k8s.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Reproduction Code [Required]

kubectl apply -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.4/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml
# customresourcedefinition.apiextensions.k8s.io/sparkapplications.sparkoperator.k8s.io created
kubectl apply -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.6/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml
# The CustomResourceDefinition "sparkapplications.sparkoperator.k8s.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Steps to reproduce the behavior:

Execute the above statements in terminal

Expected behavior

The crds should be installable without an issue

Actual behavior

Installing CRDs fails hard

Environment & Versions

ChenYi015 commented 3 months ago

@dada-engineer For client-side apply, it will fail since the definition of the whole CRD will be patched as an annotation, which exceeds the size limit. You can install the CRDs with kubectl create -f:

kubectl create -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.4/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml
kubectl create -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.6/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml

Or use server-side apply:

kubectl apply --server-side -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.4/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubeflow/spark-operator/spark-operator-chart-1.4.6/charts/spark-operator-chart/crds/sparkoperator.k8s.io_sparkapplications.yaml
dada-engineer commented 3 months ago

Oh thanks a lot. this makes a lot of sense ❤️