Skip to content

Commit

Permalink
grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
jjsiv committed Jan 18, 2023
1 parent c312f1e commit 10b6bb2
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
29 changes: 29 additions & 0 deletions gitops/grafana/grafana/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: Service
metadata:
name: grafana
spec:
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
selector:
app: grafana
sessionAffinity: None
type: ClusterIP

---

apiVersion: v1
kind: Service
metadata:
name: grafana-headless
spec:
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
selector:
app: grafana
type: ClusterIP
clusterIP: None
63 changes: 63 additions & 0 deletions gitops/grafana/grafana/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: grafana
name: grafana
spec:
replicas: 2
serviceName: grafana-headless
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
securityContext:
fsGroup: 472
supplementalGroups:
- 0
containers:
- name: grafana
image: grafana/grafana:9.1.0
imagePullPolicy: IfNotPresent
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: 750Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
volumeClaimTemplates:
- metadata:
name: grafana-pv
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: "nfs-default"
resources:
requests:
storage: 10Gi
12 changes: 12 additions & 0 deletions gitops/grafana/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- grafana/services.yaml
- grafana/statefulset.yaml

namespace: grafana

images:
- name: grafana/grafana
newTag: 9.1.0

0 comments on commit 10b6bb2

Please sign in to comment.