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

Add one parameter to instantiate multiple similar pods with indexes #30256

Closed
tobegit3hub opened this issue Aug 9, 2016 · 5 comments
Closed
Labels
sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@tobegit3hub
Copy link

It's the requirement when we're trying to deploy distributed TensorFlow in Kubernetes. The process of TensorFlow can be containerized in docker image and we can start multiple processes with the deployment yaml file.

But what if the users want to setup the deployment with different number of pods, we have to generate different deployment yaml files. The most parts of yaml file are similar and we're using the same docker image and labels. It would be better to add the parameter like "number" and Kubernetes will create multiple pods for that and pass the index so that each pod knows about its index. I think this may be something useful in Google Borg.

To be clear, this is different from replica set because they are not exactly the "same" replicas. And it's similar to indexed-job but used for general pods.

@tobegit3hub tobegit3hub changed the title Add one parameter to instantiate multiple similiar pods with indexes Add one parameter to instantiate multiple similar pods with indexes Aug 9, 2016
@pwittrock pwittrock added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed area/kubectl team/ux labels Aug 10, 2016
@pwittrock
Copy link
Member

cc @erictune
cc @pwittrock

@bprashanth Is this something that PetSet addresses?

@bprashanth
Copy link
Contributor

@tobegit3hub please take a look at http://kubernetes.io/docs/user-guide/petset/#ordinal-index when you have some time. Unsure if it covers your usecase.

@tobegit3hub
Copy link
Author

Thanks @pwittrock and @bprashanth and petset is exactly nice for our scenario. TensorFlow cluster is like ZooKeeper or other clusters which should use petset.

The ordinal-index is exactly what we want. Because the cluster is started by the developer and their TensorFlow applications need to know its index which is quite different from ZooKeeper. Now petset provides three ways to get this identity but it's not really convenient.

1. Use the downward api to find its pod name
2. Run hostname to find its DNS name
3. Run mount or df to find its volumes (usually this is unnecessary)

Is it possible to add environment variable or API for each pet to know its index? If it's reasonable, I may open another issue to track that. This issue could be closed and thanks for all your help.

@bprashanth
Copy link
Contributor

#30427

@tobegit3hub
Copy link
Author

Great! Thanks @bprashanth 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

No branches or pull requests

4 participants