Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stackzoo/k8s-local-cluster
Deploy a local multinode k8s cluster with vagrant and ansible π§ βΈοΈ
https://github.com/stackzoo/k8s-local-cluster
ansible development kubernetes vagrant
Last synced: 26 days ago
JSON representation
Deploy a local multinode k8s cluster with vagrant and ansible π§ βΈοΈ
- Host: GitHub
- URL: https://github.com/stackzoo/k8s-local-cluster
- Owner: stackzoo
- Created: 2023-03-13T08:36:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T09:29:01.000Z (almost 2 years ago)
- Last Synced: 2024-11-15T07:12:13.905Z (3 months ago)
- Topics: ansible, development, kubernetes, vagrant
- Homepage:
- Size: 12.7 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# k8s-local-cluster
[![ansible-lint](https://github.com/stackzoo/k8s-local-cluster/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/stackzoo/k8s-local-cluster/actions/workflows/ansible-lint.yml)Deploy a local multinode k8s cluster with vagrant and ansible π§ βΈοΈ
## Abstract
This repo allows you to create a local development cluster using `vagrant` and `ansible`.
Solutions like `KinD` and `Minikube` are excellent but often limited.
With a cluster made up of several VMs it is possible to test a scenario that is closer to a production context.## Prerequisites
- `ansible`
- `vagrant`## Instructions
### Define amount of nodes
Modify the following variable in Vagrantfile:
```
N =
```### Spin up cluster
```
$ vagrant up
```### Verify on master
```
$ vagrant ssh k8s-master
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane,master 5m6s v1.26.0
k8s-worker-1 Ready 2m59s v1.26.0
k8s-worker-2 Ready 68s v1.26.0
```## Useful Commands
*vagrant status* β Get the current status of your VM
*vangrant destroy* β Remove all traces of the virtual machine from your system
*vagrant suspend* β Stop the machine and save its current state.
*vagrant provision {vm-name}* β Manually execute ansible playbook against a VM.
*vagrant halt* β Shut down the virtual machine.
*vagrant box list* - List local vagrant box images
*vagrant box remove {vagrant-box-image-name}* - Remove local vagrant box images
*vagrant plugin list* - List local vagrant plugins