Giter VIP home page Giter VIP logo

simple-app-kb8s's Introduction

Flask API dockerized

I use Kubectl and minikube for make this works

Follow this guide if you dont have docker and kubernetes installed in your computer (Mac OS)


Docker


brew install docker

or


Download Docker for mac from the url : https://download.docker.com/mac/stable/Docker.dmg

check your docker version

docker version

Kubernetes (Kubectl)

brew install kubectl

or

  • Download the latest release:
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl"
To download a specific version, replace the $(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) portion of the command with the specific version.
For example, to download version v1.18.0 on macOS, type:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/darwin/amd64/kubectl
  • Make the kubectl binary executable.
chmod +x ./kubectl
  • Move the binary in to your PATH.
sudo mv ./kubectl /usr/local/bin/kubectl

check your kubectl version

kubectl version --client

Helm

brew install helm

or

Download your version - https://github.com/helm/helm/releases
  • Unpack it
tar -zxvf helm-v3.0.0-linux-amd6
  • Find the helm binary in the unpacked directory, and move it to its desired destination
mv linux-amd64/helm /usr/local/bin/helm

check helm version

helm version

Start kubectl

  • Start Minikube and create a cluster:
minikube start

clone this repository

git clone https://github.com/julialamenza/simple-app-kb8s
  • go to the folder
cd simple-app-kb8s/
  • to deploy de application you need to follow this order:

1- Namespace 2- ConfigMap 3- Deployment 4- Service 5-Ingress

or run

chmod +x deploy.sh
./deploy.sh

Access application

you can acess the application checking your minikube ip

minikube ip

Curl in the app

curl <minikube-ip:80/>

Or add you ip in you /etc/hosts

sudo vim /etc/hosts

minikube-ip   app.ptova
curl app.prova

Remember your app route exist in / and /health

To deploy prometheus and grafana with helm

run these commands

$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
$ helm repo add stable https://charts.helm.sh/stable
$ helm repo update
$ helm install prometheus prometheus-community/kube-prometheus-stack
$ kubectl port-forward deployment/prometheus-grafana 3000

Login into grafana

username: admin password: prom-operator

For more information check Kubernetes documentation -> https://kubernetes.io/docs/home/

TO DO:

  • Deploy Kibana
  • Send logs to Kibana

simple-app-kb8s's People

Contributors

julialamenza avatar

Watchers

James Cloos avatar  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.