Automating Kubernetes the hard way cluster with Ansible. Support Vagrant and OIDC! feature to renew the certificate, add a new worker node, and upgrade the Kubernetes version!
Ansible template to create kubernetes cluster with the following specs:
Execution happen on the deployer node. All the ceritificate generated and store in the deployer node. The deployer node cannot be deleted if you want to renew certificate or extending kubernetes worker node. All this step executed in the deployer node.
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt update
sudo apt install ansible -y
please make sure that
ssh-keygen
# copy to deployer itself
ssh-copy-id <user>@<deployer-node>
# copy to etcd node
ssh-copy-id <user>@<etcd-node>
ssh-copy-id <user>@<etcd-node>
ssh-copy-id <user>@<etcd-node>
# copy to master node
ssh-copy-id <user>@<master-node>
ssh-copy-id <user>@<master-node>
ssh-copy-id <user>@<master-node>
# copy to master node
ssh-copy-id <user>@<worker-node>
ssh-copy-id <user>@<worker-node>
ssh-copy-id <user>@<worker-node>
[defaults]
host_key_checking = False
* Clone this repository
```bash
git clone https://github.com/zufardhiyaulhaq/kubernetes-hardway-ansible.git
git checkout --track origin/<TAG>
Adjust variable in the group_vars
vi group_vars/all.yml
Adjust Kubernetes host and nodes
vi hosts/hosts
Run ansible
ansible-playbook main.yml -i hosts/hosts
Please backup certificate directory in the deployer node!