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

scaledjobs.keda.sh CRD is too long. #4740

Closed
iKubernetes opened this issue Jun 27, 2023 · 7 comments
Closed

scaledjobs.keda.sh CRD is too long. #4740

iKubernetes opened this issue Jun 27, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@iKubernetes
Copy link

iKubernetes commented Jun 27, 2023

Report

When I install KEDA with kubectl, it returns a message like this:
The CustomResourceDefinition "scaledjobs.keda.sh" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Expected Behavior

customresourcedefinition.apiextensions.k8s.io/scaledjobs.keda.sh created

Actual Behavior

The CustomResourceDefinition "scaledjobs.keda.sh" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Steps to Reproduce the Problem

  1. run this command: kubectl apply -f https://github.com/kedacore/keda/releases/download/v2.11.0/keda-2.11.0.yaml

Logs from KEDA operator

……

2023-06-27T09:38:32Z    ERROR   controller-runtime.source.EventHandler  if kind is a CRD, it should be installed before calling Start   {"kind": "ScaledJob.keda.sh", "error": "no matches for kind \"ScaledJob\" in version \"keda.sh/v1alpha1\""}
sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1
        /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/source/kind.go:63
k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext.func1
        /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go:62
k8s.io/apimachinery/pkg/util/wait.loopConditionUntilContext
        /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/loop.go:63
k8s.io/apimachinery/pkg/util/wait.PollUntilContextCancel
        /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/poll.go:33
sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1
        /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/source/kind.go:56
2023-06-27T09:38:42Z    ERROR   controller-runtime.source.EventHandler  if kind is a CRD, it should be installed before calling Start   {"kind": "ScaledJob.keda.sh", "error": "no matches for kind \"ScaledJob\" in version \"keda.sh/v1alpha1\""}
sigs.k8s.io/controller-runtime/pkg/internal/source.(*Kind).Start.func1.1
……
2023-06-27T09:40:22Z    ERROR   setup   problem running manager {"error": "failed to wait for scaledjob caches to sync: timed out waiting for cache to be synced for Kind *v1alpha1.ScaledJob"}
main.main
        /workspace/cmd/operator/main.go:294
runtime.main
        /usr/local/go/src/runtime/proc.go:250

KEDA Version

2.11.0

Kubernetes Version

1.27.3

Platform

kubeadm

Anything else?

No response

@iKubernetes iKubernetes added the bug Something isn't working label Jun 27, 2023
@iKubernetes iKubernetes changed the title The metadata.annotations in scaledjobs.keda.sh CRD is too long. The definition of scaledjobs.keda.sh CRD is too long. Jun 27, 2023
@iKubernetes iKubernetes changed the title The definition of scaledjobs.keda.sh CRD is too long. scaledjobs.keda.sh CRD is too long. Jun 27, 2023
@zroubalik
Copy link
Member

@iKubernetes does kubectl apply --server-side -f ... help with the problem?

@iKubernetes
Copy link
Author

@iKubernetes does kubectl apply --server-side -f ... help with the problem?

It works.

@chrisjohnson00
Copy link

@iKubernetes does kubectl apply --server-side -f ... help with the problem?

It works.

Same happens with the helm chart, how do we force server-side with that?

@alpozcan
Copy link

@iKubernetes does kubectl apply --server-side -f ... help with the problem?

It works.

Same happens with the helm chart, how do we force server-side with that?

Render the chart via helm template subcommand, then if you write the output to a file which you can then apply as above.

@sondrelg
Copy link

In case anyone comes to this thread and they're using ArgoCD (like me), you can adjust the sync policy using:

"syncPolicy" = {
  "syncOptions" = [
    "ServerSideApply=true"
  ]
}

@DanielCalvo
Copy link

In case anyone comes to this thread and they're using ArgoCD (like me), you can adjust the sync policy using:

"syncPolicy" = {
  "syncOptions" = [
    "ServerSideApply=true"
  ]
}

@sondrelg thank you!

Google also sent me here after upgrading from keda 2.6 on some new clusters and stumbling upon this error. For reference, here's what the relevant part of my config now looks like:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: keda
  namespace: argocd
spec:
  syncPolicy:
    syncOptions:
    - ServerSideApply=true
(...)

Docs on server side apply are here: https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#server-side-apply

@adiii717
Copy link

adiii717 commented Mar 20, 2024

Instead of making changes at the ArgoCD application level, I found that adding the annotation for the CRD did the trick, and it worked perfectly

values.yaml

crds:
  additionalAnnotations:
    argocd.argoproj.io/sync-options: ServerSideApply=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

7 participants