-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adds Pod Affinity to Kubernetes driver #245
Adds Pod Affinity to Kubernetes driver #245
Conversation
Signed-off-by: Simon Davies <[email protected]>
54166c9
to
4aa3690
Compare
For the pod affinity label, is the plan that the k8s operator will generate a unique value, set that on the porter job container, and then pass through this label so that the k8s driver will also use the same label on the invocation image pod? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Signed-off-by: Simon Davies <[email protected]>
@carolynvs The approach I have used in the controller is to set the |
We can chat about that once we have a PR against the operator with this change, but people can run actions against an installation at the same time, though I'd advise anyone against it right now. Ideally it is more unique than the installation name. In another place where I needed a unique value, I used the CRD revision that triggered the event appended to the installation name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change introduces a setting to specify labels to be used for affinity for the Kubernetes driver.
The driver uses a PVC to copy input and output data between the driver and the job that runs the invocation image, In some cases there is a need to make sure that the job runs on the same node as another pod. For example, where the PVC is bound to the node running the driver with ReadWriteOnce access mode then the job running the invocation image must run on the same node as the pod creating the PVC, this change enables a client to set pod affinity appropriately.
To specify affinity with a pod the client should set the environment variable
AFFINITY_MATCH_LABELS
with label name value pairs separated by whitespace. (e.g 'A=B X=Y'). These labels are used to set Pod Affinity constraints for the job running the invocation image.Signed-off-by: Simon Davies [email protected]