summaryrefslogtreecommitdiff
path: root/contrib/k8s-emc/graphite-statefulset.yml
blob: 5bd376e821aa2dab7e57ab58676b22081463d67b (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
66
67
68
69
70
71
72
73
74
75
76
apiVersion: apps/v1
kind: StatefulSet
metadata:
  namespace: emc
  name: stats-graphite
  labels:
    app: graphite
    tier: stats
spec:
  serviceName: stats-graphite
  replicas: 1
  selector:
    matchLabels:
      app: graphite
      tier: stats
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: graphite
        tier: stats
    spec:
      nodeName: emc-master
      securityContext:
        runAsUser: 998
        fsGroup: 998
      initContainers:
      - name: prepare-graphite-data
        image: busybox
        command: ['sh', '-c', 'chown 998:998 /srv/data && chmod 700 /srv/data']
        securityContext:
          runAsUser: 0
        volumeMounts:
        - name: graphite-data
          mountPath: /srv/data
      containers:
      - name: carbon
        image: spreadspace/graphite-carbon:master-4
        imagePullPolicy: Always
        volumeMounts:
        - name: home
          mountPath: /srv
        - name: carbon-config
          mountPath: /srv/config
        - name: graphite-data
          mountPath: /srv/data
      - name: api
        image: spreadspace/graphite-api:master-4
        imagePullPolicy: Always
        volumeMounts:
        - name: home
          mountPath: /srv
        - name: api-config
          mountPath: /srv/config
        - name: api-index
          mountPath: /srv/index
        - name: graphite-data
          mountPath: /srv/data
      volumes:
      - name: home
        emptyDir:
          medium: Memory
      - name: graphite-data
        hostPath:
          type: DirectoryOrCreate
          path: /srv/stats/graphite
      - name: carbon-config
        configMap:
          name: stats-graphite-carbon
      - name: api-config
        configMap:
          name: stats-graphite-api
      - name: api-index
        emptyDir:
          medium: Memory