Can I deploy using JSON string in Kubernetes?

Viewed 330

As per kubectl documentation, kubectl apply is possible by using a file or stdin. My usecase is that there would be service/deployment json strings in runtime and I have to deploy those in clusters using nodejs. Of course, I can create files and just do kubectl apply -f thefilename. But, I don't want to create files. Is there any approach where I can do like below:

kubectl apply "{"apiVersion": "extensions/v1beta1","kind": "Ingress"...}"

For the record, I am using node_ssh library.

1 Answers
Related