1
0
Fork 0

grafana configuration

This commit is contained in:
Massaki Archambault 2021-08-26 12:42:28 -04:00
parent 89c09df7bf
commit 14342f2136
8 changed files with 118 additions and 66 deletions

View File

@ -32,6 +32,10 @@ spec:
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 80
resources:
requests:
cpu: 2000m
memory: 4Gi
--- ---
kind: Role kind: Role
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1

View File

@ -41,9 +41,10 @@ spec:
secretKeyRef: secretKeyRef:
name: drone-secret name: drone-secret
key: rpc_secret key: rpc_secret
ports: resources:
- name: http requests:
containerPort: 80 cpu: 500m
memory: 1Gi
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service

View File

@ -56,14 +56,18 @@ spec:
- name: http - name: http
containerPort: 3000 containerPort: 3000
- name: ssh - name: ssh
containerPort: 22 containerPort: 22
resources:
requests:
cpu: 500m
memory: 1Gi
volumeMounts: volumeMounts:
- name: gitea-data - name: gitea-pv
mountPath: /data mountPath: /data
volumes: volumes:
- name: gitea-data - name: gitea-pv
persistentVolumeClaim: persistentVolumeClaim:
claimName: gitea-data claimName: gitea-pvc
# --- # ---
# apiVersion: v1 # apiVersion: v1
# kind: PersistentVolume # kind: PersistentVolume
@ -84,7 +88,7 @@ spec:
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: gitea-data name: gitea-pvc
labels: labels:
app: gitea app: gitea
spec: spec:
@ -93,7 +97,7 @@ spec:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
requests: requests:
storage: 100Mi storage: 10Gi
# selector: # selector:
# matchLabels: # matchLabels:
# app: gitea # app: gitea

View File

@ -20,39 +20,77 @@ spec:
- name: GF_AUTH_ANONYMOUS_ENABLED - name: GF_AUTH_ANONYMOUS_ENABLED
value: "true" value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_ROLE - name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: Admin value: Viewer
- name: GF_DATABASE_TYPE # - name: GF_DATABASE_TYPE
value: postgres # value: postgres
- name: GF_DATABASE_HOST # - name: GF_DATABASE_HOST
valueFrom: # valueFrom:
secretKeyRef: # secretKeyRef:
name: postgres-credentials-secret # name: postgres-credentials-secret
key: host # key: host
- name: GF_DATABASE_NAME # - name: GF_DATABASE_NAME
valueFrom: # valueFrom:
secretKeyRef: # secretKeyRef:
name: postgres-credentials-secret # name: postgres-credentials-secret
key: database # key: database
- name: GF_DATABASE_USER # - name: GF_DATABASE_USER
valueFrom: # valueFrom:
secretKeyRef: # secretKeyRef:
name: postgres-credentials-secret # name: postgres-credentials-secret
key: username # key: username
- name: GF_DATABASE_PASSWORD # - name: GF_DATABASE_PASSWORD
valueFrom: # valueFrom:
secretKeyRef: # secretKeyRef:
name: postgres-credentials-secret # name: postgres-credentials-secret
key: password # key: password
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
ports: ports:
- name: http - name: http
containerPort: 3000 containerPort: 3000
resources:
requests:
cpu: 250m
memory: 750Mi
volumeMounts: volumeMounts:
- name: grafana-datasources - name: grafana-datasources
mountPath: /etc/grafana/provisioning/datasources mountPath: /etc/grafana/provisioning/datasources
- mountPath: /var/lib/grafana
name: grafana-pv
volumes: volumes:
- name: grafana-datasources - name: grafana-datasources
configMap: configMap:
name: grafana-datasources name: grafana-datasources
- name: grafana-pv
persistentVolumeClaim:
claimName: grafana-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
@ -60,7 +98,6 @@ metadata:
name: grafana name: grafana
labels: labels:
app: grafana app: grafana
monitor: main
spec: spec:
selector: selector:
app: grafana app: grafana

View File

@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: grafana
labels:
app: grafana
annotations:
# nginx.ingress.kubernetes.io/rewrite-target: /
# cert-manager.io/cluster-issuer: letsencrypt
spec:
# tls:
# - hosts:
# - ${GRAFANA_EXTERNAL_HOST}
# secretName: letsencrypt-cert
rules:
- host: ${GRAFANA_EXTERNAL_HOST}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: grafana
port:
name: http

View File

@ -1,22 +0,0 @@
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: grafana
labels:
app: grafana
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- ${GRAFANA_EXTERNAL_HOST}
secretName: letsencrypt-cert
rules:
- host: ${GRAFANA_EXTERNAL_HOST}
http:
paths:
- path: /
backend:
serviceName: grafana
servicePort: http

View File

@ -1,18 +1,21 @@
resources: resources:
- grafana-deployment.yaml - grafana-deployment.yaml
- ingress.yaml - grafana-ingress.yaml
configMapGenerator: configMapGenerator:
- name: grafana-datasources - name: grafana-datasources
files: files:
- datasources.yaml=provision/datasources.yaml - datasources.yaml=provision/datasources.yaml
secretGenerator: # secretGenerator:
- name: postgres-credentials-secret # - name: postgres-credentials-secret
type: Opaque # type: Opaque
behavior: create # behavior: create
literals: # literals:
- host=172.18.1.2:5432 # - host=172.18.1.2:5432
- database=grafana # - database=grafana
- username=grafana # - username=grafana
- password=changeme # - password=changeme
# default username: admin
# default password: admin

View File

@ -1,7 +1,7 @@
bases: bases:
- ../../namespaces/kubernetes-dashboard - ../../namespaces/kubernetes-dashboard
- ../../namespaces/gitea - ../../namespaces/gitea
# - ../../namespaces/grafana - ../../namespaces/grafana
# - ../../namespaces/nextcloud # - ../../namespaces/nextcloud
# resources: # resources: