Skip to content

Repository files navigation

CI status

is_it_up

A testbed for deploying and monitoring clustered Elixir applications in Kubernetes - with Prometheus monitoring and Grafana metrics display.

ex_bench supported

This project builds with ex_bench support

TODO

running

See the Makefile for all available tasks - the tasks are currently :

CommandDescription
attach-app-0attach to first instance of app running in stateful set
attach-app-1attach to second instance of app running in stateful set
backup-monitoring-secretsbackup the monitoring secrets to namespace backup
buildbuild the application into a docker image
deploy-appdeploy the application to k8s namespace elixir
deploy-monitoringdeploy the monitoring tools (prometheus/grafana) to namespace monitoring
docker-runrun single instance of the image in docker (no kubenetes involved)
kaniko-buildbuild the docker image using kaniko (rootless, runs as a kubernetes job)
mix-run-0run instance 0 of the application using iex/mix (dev mode, libcluster hard coded 2 nodes)
mix-run-1run instance 1 of the application using iex/mix (dev mode, libcluster hard coded 2 nodes)
port-forward-elixirport forward the first elixir container to localhost (14000) so you can access via http
port-forward-grafanaport forward the grafana container to localhost (3000) so you can access via http
port-forward-prometheusport forward the prometheus container to localhost (9090) so you can access via http
pushpush the project to docker hub
rerun-grafana-import-dashboardstweak grafana dashboards, export via GUI, copy to ops/monitoring/config/grafana-import-dashboards and execute to import
restore-monitoring-secretsdestroyed the monitoring namespace, use this to avoid having to re-enter the required secrets
undeploy-appdestroy the elixir namespace
undeploy-monitoringdestroy the monitoring namespace
deploy-loggingdeploy elasticsearch, fluentd, kibana
undeploy-loggingundeploy elasticsearch, fluentd, kibana
deploy-counter-exampledeploy a pod which outputs an incrementing counter to stdout (picked up by fluentd, sent to elasticsearch, viewable in kibana

Publicly exposing services (Ingress)

This project has not been made to by default expose services directly to the internet - if you want to do so - you can execute one of the following commands in order to expose the 'is-it-up' service.

Direct TCP access

cat <<EOF | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: is-it-up-ingress
namespace: elixir
spec:
backend:
serviceName: is-it-up
servicePort: 4000
EOF

HTTP proxying - restricted to two paths

cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: simple-fanout-example
namespace: elixir
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host:
http:
paths:
- path: /metrics
backend:
serviceName: is-it-up
servicePort: 4000
- path: /google_status
backend:
serviceName: is-it-up
servicePort: 4000
EOF

Expose grafana

#apiVersion: extensions/v1beta1
#kind: Ingress
#metadata:
# name: grafana-ingress
# namespace: monitoring
#spec:
# rules:
# - http:
# paths:
# - backend:
# serviceName: grafana
# servicePort: 3000
#EOF

Doesn't work - see the following for more info :

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages