Giter Site home page Giter Site logo

vagrant-k8s's Introduction

Vagrant-k8s

Ansible playbook to create a k8s cluster in Google Cloud, using a vagrant file for testing and labs.

Create/change the playbook file with your configurations.

- hosts: all
  connection: local
  gather_facts: yes
  vars:
    k8s_cluster: YOURCLUSTERNAME
    k8s_zone: us-central1-a
    kubectl_version: v1.14.0
    gcloud_project: YOURGCLOUDPROJECT
    node_type: n1-standard-4
    disk_size: 40
    node_count: 2
    install_ingress_controller: False
    install_istio: True
    istio_version: 1.1.4
    kiali_user: kiali
    kiali_pass: password
  roles:
    - { role: create-k8s-cluster }
    - { role: install-tools }
    - { role: install-istio }

Run your vagrant file and have your vm and k8s cluster ready.

vagrant up

to destroy your vm (remember to destroy your k8s cluster first)

  1. Log into your vm
vagrant ssh
  1. Run the ansible playbook to destroy your k8s Cluster
ansible-playbook /vagrant/playbook-destroy.yml -i /vagrant/hosts
  1. Destroy the vm
vagrant destroy -f

Notes:

You must create an account previously and write the associated key to roles/create-k8s-cluster/files/gcp-service-account.json, this account must have enough privileges to create a cluster in your gcloud project.

For your GCloud project (Example for this lab is 'gdcdevops')

This account can be created in

IAM & admin
Service Accounts
Create Service Account
    Role: Project/Owner

Then create key in json format and write it to roles/create-k8s-cluster/files/gcp-service-account.json

Istio

To access Grafana

Get istio gateway external ip.

kubectl get svc istio-ingressgateway -o=custom-columns=NAME:.metadata.name,EXTERNAL-IP:.status.loadBalancer.ingress[*].ip -n istio-system
NAME                   EXTERNAL-IP
istio-ingressgateway   35.232.36.158

Open browser with the ip and port 1031

vagrant-k8s's People

Contributors

aldenso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.