-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Error creating deployment with deployment.yaml file - Unknown apiVersionKind apps/v1/Deployment is it registered? #2241
Comments
Added the following line to resolve the issue. Note: That method is deprecated. Yaml.addModelMap("apps/v1","Deployment", V1Deployment.class); |
Glad that helps, but that should be loaded for you automatically based on this static initializer:
Is there something weird/different about your classloaders? |
I use spring boot, don't know what is causing that issue. but without that, it was not working. |
i suppose it's related to #1659 |
@cdkgenie can you try init the model mapping via calling the following method to perform a full on-line api-discovery?
|
If you are executing from a fatJar, the initModelMap won't find the api classes from the model. You can add them manually by ModelMapper.addModel for every K8s object you use. Or alternatively, while #1659 is not fixed, you could create the Docker container exploding the fatJar (which is what buildpacks do, for example) so you won't be executing a fatJar and it should work. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
How would the string arguments actually look like for the following kinds?
|
@PostConstruct |
When I running my app in IDEA, it is OK, but when running as a jar (java -jar xxx.jar), this problem is appear:
|
I fixd this bug:
|
#2241 fix bug: when running with a fat jar, need to read entries with openConnection
…read entries with openConnection when running in IDE or a thin jar, it is ok, when running with a fat jar in server, new JarFile can not open and read the entries.
I am creating a deployment using deployment.yaml file below with version 15.0.1 (Current Latest)
My java code is, in which resourceFile object has the deployment.yaml content:
My cluster-role.yaml file for the container running the above code is:
So I have permissions to create the deployments. But when I run this code, Im getting exception as
Unknown apiVersionKind apps/v1/Deployment is it registered?
How can I resolve this issue?
The text was updated successfully, but these errors were encountered: