summaryrefslogtreecommitdiff
path: root/contrib/k8s-emc/grafana-statefulset.yml
blob: b0c863255d3da37757c3c4cf91c64df7db1f5798 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
apiVersion: apps/v1
kind: StatefulSet
metadata:
  namespace: emc
  name: stats-grafana
  labels:
    app: grafana
    tier: stats
spec:
  serviceName: stats-grafana
  replicas: 1
  selector:
    matchLabels:
      app: grafana
      tier: stats
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: grafana
        tier: stats
    spec:
      nodeName: emc-master
      initContainers:
      - name: prepare-grafana-data
        image: busybox
        command: ['sh', '-c', 'mkdir -p /srv/data/lib /srv/data/log']
        volumeMounts:
        - name: grafana-data
          mountPath: /srv/data
      containers:
      - name: grafana
        image: grafana/grafana:6.6.2
        imagePullPolicy: Always
        resources:
          limits:
            memory: 3072Mi
          requests:
            memory: 2048Mi
        env:
        - name: GF_SERVER_ROOT_URL
          value: https://emc-stats.elev8.at/grafana
        - name: GF_SECURITY_ADMIN_PASSWORD
          value: secret
        - name: GF_ANALYTICS_CHECK_FOR_UPDATES
          value: "false"
        - name: GF_SECURITY_DISABLE_GRAVATAR
          value: "true"
        - name: GF_USERS_ALLOW_SIGN_UP
          value: "false"
        - name: GF_USERS_ALLOW_ORG_CREATE
          value: "false"
        volumeMounts:
        - name: grafana-data
          mountPath: /var/lib/grafana
          subPath: lib
        - name: grafana-data
          mountPath: /var/log/grafana
          subPath: log
      volumes:
      - name: grafana-data
        hostPath:
          type: DirectoryOrCreate
          path: /srv/stats/grafana