Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jalilbengoufa/k8s-vagrant-ansible
K8s cluster with ansible, vagrant (ubuntu box)
https://github.com/jalilbengoufa/k8s-vagrant-ansible
ansible kubernetes vagrant virtualbox
Last synced: 27 days ago
JSON representation
K8s cluster with ansible, vagrant (ubuntu box)
- Host: GitHub
- URL: https://github.com/jalilbengoufa/k8s-vagrant-ansible
- Owner: jalilbengoufa
- Created: 2019-06-04T03:23:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T03:46:12.000Z (over 5 years ago)
- Last Synced: 2024-11-07T05:35:25.615Z (3 months ago)
- Topics: ansible, kubernetes, vagrant, virtualbox
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# k8s-vagrant-ansible
- Install vagrant, ansible, kubectl and virtualbox in your local env.
- To start the cluster run `vagrant up` (change N in Vagranfile for the number of nodes needed)
#### Set remote access from local env
- run `scp -r [email protected]:/home/vagrant/.kube/config .` (use `vagrant` as password, this will copy config file to your local env )
- run `KUBECONFIG=~/.kube/config:$PWD/config kubectl config view --flatten > ~/.kube/config` (merge current config file with the one we copied from cluster)
#### Testing cluster hello-node
- Run deployment hello-node `kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node`
- Run service hello-node `kubectl apply -f hello-node-service.yaml`
- Verify deployments, pods and services with `kubectl get deployments` , `kubectl get pods` and ` kubectl get rs`
- Copy the pods name example: `hello-node-78cd77d68f-sqc2p`
- forward port 8080 to localhost with `kubectl port-forward hello-node-78cd77d68f-sqc2p 8080:8080`
- Test the app hello-node with `curl http://localhost:8080` should see the output `Hello World!`