Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankkkkk/vagrant-ansible-kubernetes
Provision a full kubernetes cluster on Vagrant with ansible
https://github.com/frankkkkk/vagrant-ansible-kubernetes
ansible cicd k8s k8s-cluster kubernetes kubernetes-cluster vagrant vagrantfile
Last synced: 15 days ago
JSON representation
Provision a full kubernetes cluster on Vagrant with ansible
- Host: GitHub
- URL: https://github.com/frankkkkk/vagrant-ansible-kubernetes
- Owner: Frankkkkk
- License: mit
- Created: 2019-12-27T18:19:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T09:17:02.000Z (almost 5 years ago)
- Last Synced: 2025-01-02T23:49:11.671Z (20 days ago)
- Topics: ansible, cicd, k8s, k8s-cluster, kubernetes, kubernetes-cluster, vagrant, vagrantfile
- Language: Shell
- Size: 6.84 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vagrant-ansible-kubernetes - Run a kubernetes cluster on vagrant
This repo allows you tu setup and run a full kubernetes cluster on vagrant. By default, it consists of:
* One master node
* Two slave nodes
* Flannel networking
* Not storage (for now)As of now, this installs kubernetes v1.17.2
# Setting up the cluster
## Requirements
To run this, you need the following requirements:
* vagrant
* virtualbox
* ansible
## Set-up + usage
To set up the cluster, just type the following command:
```bash
$ vagrant up
```
Vagrant and the ansible playbook will automatically create the `kubeconfig` file on the current directory. To use kubectl you can either run it from your session or from the master node.### kubectl from the current session
To communicate with the cluster from the current terminal, you need to export the KUBECONFIG file path:
```bash
$ export KUBECONFIG=$(pwd)/kubeconfig
```
Then, you'll be able to run kubectl normally:
```bash
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
va-k8s-master Ready master 7m20s v1.17.0
va-k8s-n1 Ready 5m49s v1.17.0
va-k8s-n2 Ready 4m32s v1.17.0
```### kubectl from the master node
You can also login to the master node and run kubectl form there:
```bash
$ vagrant ssh va-k8s-master
vagrant@va-k8s-master:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
va-k8s-master Ready master 7m20s v1.17.0
va-k8s-n1 Ready 5m49s v1.17.0
va-k8s-n2 Ready 4m32s v1.17.0
```## Teardown
Likewise, to destroy the cluster, run:
```bash
$ vagrant destroy -f
```