Ansible, AWS CLI and Kubectl in a portable Docker OpsBox
This is the description of another one of neat little tools we made for our toolkit: Docker OpsBox, a portable runtime environment for error-proof Ansible+AWS CLI+Kubectl launch on any admin’s machine.
We believe Docker to become the mainstay of the corporate software development. Thus said, we continue to make more and more solutions that utilize all the possibilities that Docker platform provides. For example, one day we decided to remove “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.
The goals of developing the Ansible AWS CLI Kubectl container
We wanted to get the following results:
- Provide an encapsulated user environment for working with the infrastructure
- Exclude 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 deletion, 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.