Ansible, AWS CLI, and Kubectl in a Portable Docker OpsBox
Take a look at this new tool that can help you deploy a combination of technology to solve the ''works on my machine'' problem.
Join the DZone community and get the full member experience.Join For Free
This is the description of another one of neat little tools we made for our toolkit: Docker OpsBox, a portable runtime environment for an error-proof Ansible-AWS CLI-Kubectl launch on any admin’s machine.
We believe Docker has become the mainstay of corporate software development. Thus said, we continue to make more and more solutions that utilize all the possibilities that the Docker platform provides. For example, one day we decided to remove the “works on my machine" problem once and for all, the case when operation yields different results due to having other versions of certain components installed on the other machine or lacking some components outright. The most obvious solution was an encapsulated user environment for infrastructure management.
We wanted to get the following results:
- Provide an encapsulated user environment for working with the infrastructure
- Resolve the “works well on my machine” situation
- Launch the solutions like our AWS+Kubernetes container on any computer, for demonstration purposes, or to have a portable runtime environment
The Ansible-AWS CLI-Kubectl Tool Features
Currently, the container available on Github and Dockerhub provides commands for some basic features like launching, stopping, rebooting and deleting, as well as some advanced functionality, like inserting the current user’s credentials to the containerized services upon launch, to remove the need to enter the login and password manually. You can simply launch the container and use the AWS CLI and Kubectl tools you need at once, without any additional authentication. The tool also contains Docker commands for interactive Ansible input and colorful output.
We also have a Kube-AWS branch, yet it was not merged with the main repo, as the users might have a different version of Kube-AWS in place, and these versions are not reverse-compatible. Regardless of this, our container can be used as the user’s environment for infrastructure management on a machine without Kube-AWS installed. The other variant is using it for demonstration purposes on a clean machine.
Here is an example of what customers might face while installing the components manually (without using our solution):
# pip install awscli
# pip install ansible
Here is how the situation looks when using our Docker OpsBox:
Currently Under Development
There will be the following improvements:
- We can pin every component to a release
- We can tag the releases of the container following the Semver rules (the first version would be 0.1.0, the version with an updated Kubectl would be 0.2.0, etc.)
The Results so Far
We have created Docker OpsBox as one of the tools for using our AWS-Kubernetes solution. We are going to improve it and increase the range of the components included.
Thus said, feel free to contact us should you want a custom container developed for your needs, as we have ample experience with creating DevOps Solutions for our customers.
Opinions expressed by DZone contributors are their own.