-
Notifications
You must be signed in to change notification settings - Fork 20
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
Example for using dependency information in configure #10
Comments
I see you are doing some real ochopoding there :) The dependencies are simply defined in the pod script's model. It's an array of identifiers. Each identifier maps to a cluster assumed to be running in the same namespace. Let's take an example (my internal Kafka image I use for my stuff at Autodesk) ->
That's it. If you run the Kafka container in namespace 'foo', it will only ever configure when it can find at least one container from namespace 'foo' called 'zookeeper'. You can use the grep() helper on that Cluster wrapper to get you a connection string for a given port. So for instance if I was to do grep("zookeeper", 2181) in my example, i would get a bunch of IP: pointing to my zookeeper containers. look at https://github.com/autodesk-cloud/ochopod/blob/master/sdk/ochopod/models/piped.py line 50 to see how I use the dependencies dict. |
another example .. this is my HAProxy pod script. In my case HAProxy is configuring itself against a cluster of Play! framework REST endpoint called "api" (which listens on TCP 9000). class Model(Reactive):
|
Looks great. I'll give it a try. |
Can you post an example for how to use the dependency information from the cluster in the configure(self, cluster) method?
I know I can do something like this.
Does the dependencies dict work the same way?
The text was updated successfully, but these errors were encountered: