blob: c4e6d620c1b6daf51d59833e8302c4d63a684cde [file] [log] [blame]
apiVersion: v1
kind: Service
metadata:
name: grafana
annotations:
beta.cloud.google.com/backend-config: '{"ports": {"8000":"skia-default-backendconfig"}}'
spec:
selector:
app: grafana
type: NodePort
ports:
- port: 8000
name: http
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: grafana
spec:
replicas: 1
updateStrategy:
type: RollingUpdate
serviceName: "grafana"
template:
metadata:
labels:
app: grafana
annotations:
prometheus.io.scrape: "true"
prometheus.io.port: "8000"
spec:
automountServiceAccountToken: false
securityContext:
runAsUser: 2000 # aka skia
fsGroup: 2000 # aka skia
containers:
- name: grafana
image: grafana/grafana:5.3.2
env:
# Grafana lets environment variables overwrite some values in the
# .ini files. But then they go and set those environment variables
# in their Dockerfile, so we have to set them here because env
# variables are applied after the .ini config files.
- name: GF_PATHS_CONFIG
value: /etc/grafana/grafana.ini
- name: GF_PATHS_DATA
value: /mnt/grafana
- name: GF_PATHS_HOME
value: /usr/share/grafana
- name: GF_PATHS_LOGS
value: /dev/stdout
ports:
- containerPort: 8000
readinessProbe:
httpGet:
path: /metrics
port: 8000
initialDelaySeconds: 1
periodSeconds: 3
volumeMounts:
- name: grafana-ini
mountPath: /etc/grafana/
- name: grafana-storage-volume-claim
mountPath: /mnt/grafana/
resources:
requests:
memory: "100Mi"
cpu: "100m"
volumes:
- name: grafana-ini
secret:
secretName: grafana-ini
volumeClaimTemplates:
- metadata:
name: grafana-storage-volume-claim
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi