Skip to content

Commit

Permalink
chore: add grafana kube configs (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoy authored Nov 2, 2023
2 parents 88295e4 + 453ec3d commit 3975783
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kube/configs/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: rs-api
minReplicas: 2
maxReplicas: 4
minReplicas: 4
maxReplicas: 6
metrics:
- type: Resource
resource:
Expand Down
76 changes: 76 additions & 0 deletions kube/configs/grafana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: rs-grafana
spec:
serviceName: rs-grafana
replicas: 1
selector:
matchLabels:
app: rs-grafana
template:
metadata:
labels:
app: rs-grafana
spec:
initContainers:
- name: rs-grafana-chown
image: alpine
command: ["chown", "-R", "472:472", "/var/lib/grafana"]
resources:
requests:
cpu: 0.1
memory: 100Mi
limits:
cpu: 0.1
memory: 500Mi
volumeMounts:
- name: grafana-data
mountPath: /var/lib/grafana
containers:
- name: rs-grafana
image: grafana/grafana-oss
env:
- name: discovery.type
value: single-node
ports:
- containerPort: 3000
resources:
requests:
cpu: 0.2
memory: 300Mi
limits:
cpu: 1
memory: 500Mi
volumeMounts:
- name: grafana-data
mountPath: /var/lib/grafana
volumes:
- name: grafana-data
persistentVolumeClaim:
claimName: grafana-data
---
apiVersion: v1
kind: Service
metadata:
name: rs-grafana
spec:
type: ClusterIP
selector:
app: rs-grafana
ports:
- protocol: TCP
port: 3000
targetPort: 3000
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
storageClassName: do-block-storage
13 changes: 12 additions & 1 deletion kube/configs/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
nginx.ingress.kubernetes.io/limit-rps: "5"
nginx.ingress.kubernetes.io/limit-burst-multiplier: "4"
nginx.ingress.kubernetes.io/limit-burst-multiplier: "6"
nginx.ingress.kubernetes.io/server-snippet: |
gzip on;
gzip_vary on;
Expand Down Expand Up @@ -80,6 +80,16 @@ spec:
name: rs-pushpin
port:
number: 7999
- host: grafana.recipesage.com
http:
paths:
- path: /()(.*)
pathType: Prefix
backend:
service:
name: rs-grafana
port:
number: 3000
tls:
- hosts:
- recipesage.com
Expand All @@ -89,6 +99,7 @@ spec:
- api.recipesage.com
- api.beta.recipesage.com
- grip.recipesage.com
- grafana.recipesage.com
secretName: rs-tls
---
apiVersion: cert-manager.io/v1
Expand Down

0 comments on commit 3975783

Please sign in to comment.