-
Notifications
You must be signed in to change notification settings - Fork 698
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
[Refactor] pod_failure_by_litmus to use ansible k8s module #824
Conversation
Signed-off-by: Jayadeep KM <[email protected]>
ecfbef4
to
d9a6a2f
Compare
Signed-off-by: Jayadeep KM <[email protected]>
@kmjayadeep ! Thanks for the refactor. Have a few comments, PTAL! Would be great if you could post a final test output while running as a job (with a dev image for the runner) ! |
@ksatchit |
Signed-off-by: Jayadeep KM <[email protected]>
Here is the log from pod-delete by following the example from docs
And here is the chaosresult
|
It took me a while to figure out how to run the experiment with the changed code :) I had to modify the ansible runner dockerfile to include 2 extra dependencies (openshift and jmespath) which are needed to run k8s module. |
Typically, the approach is to run the playbook on the localhost (i.e., you work-environment that has access to the cluster via kubeconfig), before testing the final runs from an dev-image as a job, similar to what you have done. You could also just run the dev image with a huge sleep, for example & test these playbooks from inside the pod, if you wish to escape ansible setup etc., on your local workspace. Once you are done with the test, you can submit the jobs as is (with official tag) - the travis CI will take care of building and tagging it. |
Signed-off-by: Jayadeep KM [email protected]
What this PR does / why we need it:
Many of of the ansible modules are using shell commands using kubectl to access kubernetes resources. This PR would be contributing towards litmuschaos/litmus-ansible#39 and #703 in converting them to k8s and k8s_facts module provided by ansible
Checklist
Special notes for your reviewer:
Could not change the kill_pod task to k8s module, as the module doesn't support --grace-period parameter. Also I have moved the pod kill logic to separate file as ansible doesn't support looping over blocks.
Tested locally in minikube by invoking the following playbook with various parameters