---
apiVersion: v1
kind: Service
metadata:
  name: grafana
  namespace: {ISTIO_NAMESPACE}
spec:
  ports:
  - port: 3000
    protocol: TCP
    name: http
  selector:
    app: grafana
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: grafana
  namespace: {ISTIO_NAMESPACE}
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: grafana
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      serviceAccountName: grafana
      containers:
      - name: grafana
        image: {MIXER_HUB}/grafana:{MIXER_TAG}
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 3000
        env:
          # Only put environment related config here. Generic Istio config
          # should go in addons/grafana/grafana.ini.
        - name: GF_PATHS_DATA
          value: /data/grafana
        volumeMounts:
        - mountPath: /data/grafana
          name: grafana-data
      volumes:
      - name: grafana-data
        emptyDir: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: grafana
  namespace: {ISTIO_NAMESPACE}
---
