Skip to content

amnk/foobar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains an example app, that shows big power of containers and all current ecosystem of Kubernetes.

It contains:

  • application itself:
    • flask app with a simple /hello endpoint;
    • uwsgi uwsgi to serve Python app;
  • Helm chart;
  • Jenkinsfile for integration with Jenkins;
  • foobar.groovy which defines sample job in JobDSL;

This Helm Chart implies two flows:

  • usual one, when you deploy app to remote k8s cluster and follow all usual guidlines;

  • local development one. After doing certain steps:

    minikube mount foobar/:/src helm install --name hello --set development=true ./helm-chart/

    app will be deployed with foobar/ mounted inside container, so all changed done to Python code will cause hot reload.

In all cases, after deployment one can get name of the pod using

kubectl get pods

and then do port-forward:

kubectl port-forward $POD_NAME 8080:8080

Afterwards curl localhost:8080/hello should display some awesome hello :)

Prometheus monitoring

Prometheus chart is not included in this repo, but app has all needed annotations. Just run helm install stable/prometheus, let pods start and configure port forwarding:

  • export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
  • kubectl --namespace default port-forward $POD_NAME 9090

Now, by navigating to Prometheus Targets you should be able to see kubernetes pods scraped, and hello app there. If you go back to Graph section, and put requests_for_host into Expression - you should be able to see the graph from hello app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published