It's possible to create pod dynamically in kubernetes local cluster?

2/26/2020

Hi i am new to kubernetes.

I want to create dynamically pod when an event occured.for example when a push a file in directory.i want to create pod dynamically to process this file.I work in a local cluster(minikube)

-- Andre Kouame
kubernetes

2 Answers

2/27/2020

Write a service that continuously keeps on monitoring your directory and provision pod for provisioning it.

-- vishnu gupta
Source: StackOverflow

2/27/2020

You said you want to create a pod

when a push a file in directory

What do you mean by push ? You mean using an SCM like Git for example ?

Anyway, this seems a basic CI/CD workflow to me. You can certainly do it using the Kubernetes API as told in comment but (in my opinion) it will be more simple to just do it with your CI/CD tool (supposing you're using one).

If not, here are some hints :

  • If you're using Git, then you should have a look at Gitlab
  • If you're not using Git, then you should look at Jenkins

Those are not the only existing tools, but probably the most popular with the most help and documentation out there.

-- Marc ABOUCHACRA
Source: StackOverflow