Skip to content

Commit 5494033

Browse files
committed
add deploy files
1 parent 4585536 commit 5494033

File tree

6 files changed

+142
-3
lines changed

6 files changed

+142
-3
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"zincobserve"
4+
]
5+
}

deployment/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use the busybox image
2+
FROM busybox
3+
4+
# Copy a directory from your host to the container
5+
COPY . /code
6+
WORKDIR /code
7+
RUN npm install && npm run build
8+
9+
10+
# Default command to execute
11+
CMD ["sh"]
12+
13+
#
14+

deployment/create_secret.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
kubectl create secret generic grafana-config --from-file=grafana.ini
4+
5+
# same command as above with dry run
6+
# kubectl create secret generic grafana-config --from-file=grafana.ini --dry-run=client -o yaml
7+

deployment/grafana.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[date_formats]
2+
default_timezone = UTC
3+
[server]
4+
root_url = https://g2.gke.zinclabs.dev
5+
[auth.google]
6+
enabled = true
7+
client_id = 66265839154-evvpnbl5246gau96gflonsdg15od5hs8.apps.googleusercontent.com
8+
client_secret = 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
9+
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
10+
auth_url = https://accounts.google.com/o/oauth2/auth
11+
token_url = https://accounts.google.com/o/oauth2/token
12+
allowed_domains = zinclabs.io
13+
allow_sign_up = true
14+
15+
enable_alpha = false
16+
app_tls_skip_verify_insecure = false
17+
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
18+
allow_loading_unsigned_plugins = zinclabs_zincobserve
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: grafana
5+
spec:
6+
serviceName: "grafana"
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: grafana
11+
template:
12+
metadata:
13+
labels:
14+
app: grafana
15+
spec:
16+
initContainers:
17+
- name: zincobserve_plugin_loader
18+
image: busybox
19+
command: ['sh', '-c', 'cp -R /code/dist/* /var/lib/grafana/plugins/']
20+
containers:
21+
- name: grafana
22+
image: grafana/grafana:latest
23+
ports:
24+
- containerPort: 3000
25+
name: grafana
26+
volumeMounts:
27+
- name: grafana-base
28+
mountPath: /var/lib/grafana
29+
- name: grafana-plugins
30+
mountPath: /var/lib/grafana/plugins
31+
volumes:
32+
- name: grafana-base
33+
persistentVolumeClaim:
34+
claimName: grafana-base
35+
- name: grafana-plugins
36+
persistentVolumeClaim:
37+
claimName: grafana-plugins
38+
- name: grafana-config
39+
secret:
40+
defaultMode: 420
41+
secretName: grafana-config
42+
volumeClaimTemplates:
43+
- metadata:
44+
name: grafana-base
45+
spec:
46+
accessModes: [ "ReadWriteOnce" ]
47+
resources:
48+
requests:
49+
storage: 1Gi
50+
- metadata:
51+
name: grafana-plugins
52+
spec:
53+
accessModes: [ "ReadWriteOnce" ]
54+
resources:
55+
requests:
56+
storage: 1Gi
57+
---
58+
apiVersion: v1
59+
kind: Service
60+
metadata:
61+
name: grafana
62+
spec:
63+
ports:
64+
- port: 3000
65+
targetPort: 3000
66+
selector:
67+
app: grafana
68+
69+
---
70+
71+
apiVersion: networking.k8s.io/v1
72+
kind: Ingress
73+
metadata:
74+
annotations:
75+
cert-manager.io/issuer: letsencrypt-prod
76+
kubernetes.io/ingress.class: nginx
77+
name: g2.gke.zinclabs.dev
78+
spec:
79+
rules:
80+
- host: g2.gke.zinclabs.dev
81+
http:
82+
paths:
83+
- pathType: Prefix
84+
backend:
85+
service:
86+
name: grafana
87+
port:
88+
number: 3000
89+
path: /
90+
tls:
91+
- hosts:
92+
- g2.gke.zinclabs.dev
93+
secretName: g2.gke.zinclabs.dev

src/plugin.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json",
33
"type": "datasource",
44
"name": "ZincObserve",
5-
"id": "zinclabs-zincobserve",
5+
"id": "zinclabs_zincobserve",
66
"info": {
77
"description": "Zinc Observe",
88
"author": {
99
"name": "ZincLabs"
1010
},
11-
"keywords": ["ZincObserve"],
11+
"keywords": [
12+
"ZincObserve"
13+
],
1214
"logos": {
1315
"small": "img/logo.png",
1416
"large": "img/logo.png"
@@ -24,4 +26,4 @@
2426
},
2527
"logs": true,
2628
"metrics": true
27-
}
29+
}

0 commit comments

Comments
 (0)