This repository contains Ansible playbooks for managing and configuring servers, with a focus on setting up Kubernetes clusters and related tasks.
- Ansible: Install Ansible on your control machine.
- SSH Access: Ensure SSH access is set up between the control machine and your servers.
- Python: Ansible requires Python 3.
inventory.yml
: Defines the hosts and groups for Ansible.playbook.yml
: Contains the main playbook to configure Kubernetes and nodes.join-command
: Temporary file for storing the Kubernetes join command.
-
Clone the Repository
git clone https://github.com/your-repo/ansible_lab.git cd ansible_lab
-
Edit Inventory
Update
inventory.yml
with your server IPs or hostnames.[k8s-master] master-server ansible_host=192.168.50.10 [k8s-nodes] node-1 ansible_host=192.168.50.11 node-2 ansible_host=192.168.50.12
-
Run the Playbook
Execute the following command to start the playbook:
ansible-playbook -i inventory.yml playbook.yml
- Initialize Kubernetes: Sets up the Kubernetes master node.
- Configure Nodes: Prepares worker nodes to join the Kubernetes cluster.
- Install Network Plugin: Applies Calico or other network plugins for Kubernetes.
- Generate Join Command: Creates a command to join worker nodes to the cluster.
- File Not Found: Ensure file paths and names are correct.
- Permission Denied: Verify file permissions and ownership.
- Connectivity Issues: Check network connections and SSH access.
Feel free to suggest improvements or submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
For help or questions, email Amit Singh.
- Update the repository URL, IP addresses, and email with your specific details.
- This
README.md
provides essential information for setting up and running the Ansible playbooks, making it a handy study resource.