Newer
Older
KubernetesApplication / Grafana / deployment.yaml
@Jerry Xie Jerry Xie on 3 Jul 2021 1 KB first commit
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-deployment
  labels:
    app: grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
      - name: grafana
        image: grafana/grafana
        imagePullPolicy: IfNotPresent
        env:
        - name: GF_SERVER_ROOT_URL
          value: /kubernetes/grafana
        - name: GF_SERVER_SERVE_FROM_SUB_PATH
          value: "true"
        ports:
        - containerPort: 3000
          name: http-grafana
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /robots.txt
            port: 3000
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 2
        livenessProbe:
          failureThreshold: 3
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 3000
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 250m
            memory: 100Mi
        volumeMounts:
          - mountPath: /var/lib/grafana
            name: grafana-config
      volumes:
        - name: grafana-config
          persistentVolumeClaim:
            claimName: pvc-grafana