An Ansible connection plugin for remotely provisioning kubernetes containers.
This works by SSHing to the host capable of accessing the kubernetes API (typically a cluster member) using the standard Ansible SSH connection, using it for storing temporary files, and controlling the target container from there via kubectl.
This is a merge of two connection plugins:
Control node (your workstation or deployment server):
- Ansible 2.16+
- Python 3
kubectl host:
- accessible by SSH
- kubectl binary installed
- Python 3
Target container:
- Python 3
This is a "Connection Type Plugin", as outlined in the Ansible docs.
To install sshjail:
- Clone this repo.
- Copy or link
sshkubectl.pyto one of the supported locations:
/usr/share/ansible/plugins/connection_plugins/sshkubectl.pypath/to/your/toplevelplaybook/connection_plugins/sshkubectl.py
TBD
Let me know if you have any difficulties using this, by creating an issue.
Pull requests are always welcome! I'll try to get them reviewed in a timely manner.