https://github.com/mohammadrony/kubernetes-cluster-setup-playbook
An Ansible playbook for Kubernetes cluster with control plane and worker node in CentOS.
https://github.com/mohammadrony/kubernetes-cluster-setup-playbook
ansible ansible-playbook ansible-roles centos9 kubernetes kubernetes-cluster kubernetes-controller kubernetes-setup kubernetes-worker-node redhat-enterprise-linux
Last synced: about 1 month ago
JSON representation
An Ansible playbook for Kubernetes cluster with control plane and worker node in CentOS.
- Host: GitHub
- URL: https://github.com/mohammadrony/kubernetes-cluster-setup-playbook
- Owner: mohammadrony
- Created: 2023-07-07T10:42:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T13:18:19.000Z (7 months ago)
- Last Synced: 2025-03-29T07:05:45.237Z (about 2 months ago)
- Topics: ansible, ansible-playbook, ansible-roles, centos9, kubernetes, kubernetes-cluster, kubernetes-controller, kubernetes-setup, kubernetes-worker-node, redhat-enterprise-linux
- Language: Shell
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Configure Kubernetes cluster in CentOS 9
An Ansible playbook to prepare Kubernetes cluster with control plane and worker node.
## Pre-requisites
Prepare ansible connection from ansible host to control plane and worker node. You can follow this document [ansible setup](./pre-requisites/Ansible-setup-in-CentOS.md) to prepare the connection.
## Clone this repository
```bash
su - ansible
git clone https://github.com/mohammadrony/kubernetes-cluster-setup-playbook.git
```## Update variable in playbook
Update the variables in [kube control setup](./kube-control-setup/vars/main.yml), [kube node setup](./kube-node-setup/vars/main.yml) and [post installation](./post-installation/vars/main.yml) role.
## Check ansible hosts file
Check [hosts](./hosts) file for host-group and host-names with control plane and worker node host names. By default it would work as follows
```bash
[kcontrol]
vm-master[knodes]
vm-worker
```## Run Ansible playbook
```bash
ansible-playbook playbook.yml
```## Access Kubernetes cluster from remote host
- Find the config file for the cluster from Ansible control host's `/home/ansible/kubeconfig` file.
- Copy the config file to remote host's `~/.kube/config` file.Thank you.