Application can be deployed to a kubernetes cluster
Dependent technology stack:
- Kubernetes (pods, jobs, services, persistent storage, ingress)
- Elasticsearch
- Grafana
- Python3
Available here.
This document describes how to deploy the application in Kubernetes.
Variables used in the manifest:
__GITHUB_PAT____GRAFANA_USERNAME____GRAFANA_PASSWORD____ORGANIZATION_SLUGS__
Replacement can be done using envsubst tool:
export __GITHUB_PAT__=your_pat
export __GRAFANA_USERNAME__=your_user
export __GRAFANA_PASSWORD__=your_pass
export __ORGANIZATION_SLUGS__=your_orgs
envsubst < deploy/aks-deployment.yml | kubectl apply -f -If you're using Azure Kubernetes Service - AKS:
- Enable App Routing
- Update variables.
- Apply the manifest in your cluster.
- Update PVC (Persitent Volume Claim) to one supported in your cluster
- Update Ingress
- Update variables.
- Apply the manifest in your cluster.
Grafana database can lock which can cause container to fail, see Grafana, SQLite, and database is locked
Use following Job to unlock the database.
---
apiVersion: batch/v1
kind: Job
metadata:
name: fix-grafana-once
spec:
template:
spec:
containers:
- name: fix-grafana
image: keinos/sqlite3
imagePullPolicy: IfNotPresent
command:
- "/bin/sh"
- "-c"
- "/usr/bin/sqlite3 /var/lib/grafana/grafana.db '.clone /var/lib/grafana/grafana.db.clone'; mv /var/lib/grafana/grafana.db.clone /var/lib/grafana/grafana.db; chmod a+w /var/lib/grafana/grafana.db"
volumeMounts:
- name: grafana-data
mountPath: /var/lib/grafana
subPath: grafana
securityContext:
runAsUser: 0
resources:
requests:
cpu: "0.25"
memory: "256Mi"
limits:
cpu: "0.5"
memory: "512Mi"
restartPolicy: Never
volumes:
- name: grafana-data
persistentVolumeClaim:
claimName: shared-pvcForce restart grafana container after to re-create.
