apiVersion: v1 kind: PersistentVolumeClaim metadata: name: conf-grafana namespace: kube-public spec: accessModes: - ReadWriteMany resources: requests: storage: 100Mi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: data-grafana namespace: kube-public spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi --- apiVersion: apps/v1 kind: Deployment metadata: labels: name: grafana name: grafana namespace: kube-public spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 7 selector: matchLabels: app: grafana strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: metadata: labels: app: grafana spec: containers: - name: grafana image: harbor.uenpay.com/base/grafana-enterprise:9.4.2-ubuntu #image: grafana/grafana-enterprise:9.4.2-ubuntu #image: grafana/grafana-enterprise:10.2.0-ubuntu imagePullPolicy: IfNotPresent readinessProbe: tcpSocket: port: 3000 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 10 failureThreshold: 2 successThreshold: 1 livenessProbe: tcpSocket: port: 3000 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 10 failureThreshold: 2 successThreshold: 1 ports: - containerPort: 3000 protocol: TCP resources: limits: cpu: '2' memory: 4Gi requests: cpu: 100m memory: 100Mi volumeMounts: - name: config mountPath: /etc/grafana - name: data mountPath: /var/lib/grafana - name: timezone mountPath: /etc/localtime restartPolicy: Always securityContext: runAsUser: 0 terminationGracePeriodSeconds: 30 volumes: - name: config persistentVolumeClaim: claimName: conf-grafana - name: data persistentVolumeClaim: claimName: data-grafana - name: timezone hostPath: path: /usr/share/zoneinfo/Asia/Shanghai type: "" tolerations: - key: prometheus effect: NoSchedule operator: Exists --- apiVersion: v1 kind: Service metadata: name: grafana namespace: kube-public spec: ports: - port: 3000 protocol: TCP targetPort: 3000 selector: app: grafana type: ClusterIP --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/ssl-redirect: 'true' name: grafana namespace: kube-public spec: ingressClassName: nginx rules: - host: grafana.uenpay.com http: paths: - backend: service: name: grafana port: number: 3000 path: / pathType: ImplementationSpecific tls: - hosts: - grafana.uenpay.com secretName: uenpay.com