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

[section_request] Testing Kubernetes with Molecule, Kind, and Ansible #36

Closed
geerlingguy opened this issue Mar 12, 2020 · 5 comments · Fixed by #67
Closed

[section_request] Testing Kubernetes with Molecule, Kind, and Ansible #36

geerlingguy opened this issue Mar 12, 2020 · 5 comments · Fixed by #67

Comments

@geerlingguy
Copy link
Owner

I was just thinking, I don't have a dedicated chapter to testing Kubernetes infrastructure configurations, but that's one thing that's actually easier to do with Molecule + Ansible than (IMO) with most other solutions, especially in CI. I already have things working in GitHub Actions and Travis CI, so I could do a chapter that introduces:

  • Using Kind to create a lightweight Kubernetes environment locally or in CI.
  • Using Molecule to test Ansible playbooks and roles.
  • Using Molecule to create a Kind cluster and test k8s resources on it with Ansible (similar to how I use it for this book's playbooks in some cases, and for tower-operator and other K8s projects).
  • Using Molecule in GitHub Actions (and/or Travis CI) to run tests using CI for your project.
@geerlingguy
Copy link
Owner Author

The Molecule setup in the official Ansible Kubernetes Collection is also a pretty good / thorough example: https://github.com/ansible-collections/kubernetes/blob/master/.github/workflows/ci.yml#L64-L95 (the book example would be a bit more lightweight than that, though—that molecule playbook is testing a heck of a lot that we probably wouldn't need to test).

@geerlingguy
Copy link
Owner Author

Did some initial work on this tonight. My plan is to build a playbook which deploys some sort of application into Kubernetes (something simple for now, since the point is to show how Molecule + Kind work together, mainly) and have it work with maybe both Kind and also either a regular cluster (with delegated driver and managed: false), or a Minikube cluster (similar to the Kind configuration?).

geerlingguy added a commit that referenced this issue Aug 28, 2020
Issue #36: Add an example testing with Molecule and Kind.
@geerlingguy geerlingguy reopened this Aug 28, 2020
@geerlingguy
Copy link
Owner Author

Still working on the prose in chapter 7...

@geerlingguy
Copy link
Owner Author

Lots of commits here! I'm just about finished with this chapter. It's been a fun one :)

@geerlingguy
Copy link
Owner Author

First draft complete, I'm doing a once-over review and closing this issue. Hopefully will be posting a new version of the book in the next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant