Code Monkey home page Code Monkey logo

hashi-k8s-demo's Introduction

k8s consul/vault/transit-app/mariadb demo

Software requirements (on your laptop):

git curl jq kubectl(v1.17 or greater) helm3 consul vault

Setup

  1. Set your GCP creds. I've done mine via environment variables https://www.terraform.io/docs/providers/google/provider_reference.html

If using TFE, use the GOOGLE_CREDENTIALS environment variable. Also the JSON credential data is required to all be on one line. Just modify in a text editor before adding to TFE.

GOOGLE_CREDENTIALS: {"type": "service_account","project_id": "klaas","private_key_id":.......... 
  1. Fill out terraform.tfvars with your values

  2. plan/apply

terraform apply --auto-approve;
  1. Copy the command for "connecting" to your k8s cluster from the terraform output.
gcloud container clusters get-credentials your-cluster-name --zone us-central1-c --project your-project
  1. Deploy Consul/Vault/Mariadb/Python-transit-app. This takes a minute or two as there are a bunch of sleeps setup in the script.
cd demo
./full_stack_deploy.sh

cat that script if you want to see how to deploy each of the above by hand/manually.

Teardown

demo/cleanup.sh

UI

Refresh your browser tab when they initally open up. They are started by nohup commands using kubectl port-forward. see demo/vault/vault.sh and demo/consul/consul.sh

#Consul
http://localhost:8500

#Vault
http://localhost:8200

Encryption as a service demo

Use the following command to access the application. Use port 5000.

$ kubectl get svc k8s-transit-app
NAME              TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
k8s-transit-app   LoadBalancer   10.15.250.236   <pending>     5000:30549/TCP   11s

Go Movies App Demo

Blog post: [Medium.com link] Use the following command to access the application. Use port 8080.

$ kubectl get svc go-movies-app
NAME              TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
go-movies-app   LoadBalancer   10.15.250.237   <pending>     8080:30539/TCP   11s

Consul Ingress Gateway

The ingress gateway can be used to access either the k8s-transit-app (Vault features) or go-movies-app (Consul L7 features)

hashi-k8s-demo's People

Contributors

andrew-klaas avatar kecorbin 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.