java icon indicating copy to clipboard operation
java copied to clipboard

How to create a deployment from a YAML file

Open smaillns opened this issue 7 years ago • 6 comments

May you give some examples of can we create Kubernetes objects from YAML files using this API, Thanks.

smaillns avatar Jul 14 '19 15:07 smaillns

https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/YamlExample.java

load the object from your yaml at first, then fire the request to the apiserver using the client

yue9944882 avatar Jul 15 '19 03:07 yue9944882

Closing this as the question is answered. Please re-open if there are further questions.

brendandburns avatar Jul 15 '19 03:07 brendandburns

load the object from your yaml at first, then fire the request to the apiserver using the client

Excuse me, but how to load the YAML file ?

smaillns avatar Jul 15 '19 08:07 smaillns

using Yaml#load i suppose. see https://github.com/kubernetes-client/java/issues/611#issuecomment-511265984

yue9944882 avatar Jul 15 '19 08:07 yue9944882

There are some problems occured while trying to execute the code from a docker container !!

smaillns avatar Jul 24 '19 15:07 smaillns

#634

smaillns avatar Jul 24 '19 16:07 smaillns