Skip to content

Commit 41a74aa

Browse files
committed
add fully working Helm Chart
it's enough to get you started, just install it and do a port-forward to :8080 and you'll have a demo status page at your disposal Resolves: valeriansaliou#63 Related: Signed-off-by: Daniel-Andrei Minca <mandrei17@gmail.com>
1 parent 9707897 commit 41a74aa

File tree

12 files changed

+582
-0
lines changed

12 files changed

+582
-0
lines changed

charts/vigil/.helmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/

charts/vigil/Chart.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: vigil
3+
description: Microservices Status Page
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
version: 0.1.2
18+
19+
# This is the version number of the application being deployed. This version number should be
20+
# incremented each time you make changes to the application.
21+
appVersion: 1.22.2

charts/vigil/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# vigil
2+
> Microservices Status Page. Monitors a distributed infrastructure and sends alerts (Slack, SMS, etc.).
3+
4+
Github: [valeriansaliou/vigil][1]
5+
6+
DockerHub: [valeriansaliou/vigil/][2]
7+
8+
[1]: https://github.com/valeriansaliou/vigil
9+
[2]: https://hub.docker.com/r/valeriansaliou/vigil/

charts/vigil/templates/NOTES.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "app.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "app.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "app.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "app.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
echo "Visit http://127.0.0.1:8080 to use your application"
20+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
21+
{{- end }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "app.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "app.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "app.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "app.labels" -}}
38+
helm.sh/chart: {{ include "app.chart" . }}
39+
{{ include "app.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end -}}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "app.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "app.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end -}}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "app.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create -}}
59+
{{ default (include "app.fullname" .) .Values.serviceAccount.name }}
60+
{{- else -}}
61+
{{ default "default" .Values.serviceAccount.name }}
62+
{{- end -}}
63+
{{- end -}}
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
creationTimestamp: null
5+
name: {{ include "app.fullname" . }}
6+
labels:
7+
{{- include "app.labels" . | nindent 4 }}
8+
data:
9+
vigil.cfg: |-
10+
# Vigil
11+
# Microservices Status Page
12+
# Configuration file
13+
# Example: https://github.com/valeriansaliou/vigil/blob/master/config.cfg
14+
15+
16+
[server]
17+
18+
log_level = "debug"
19+
inet = "0.0.0.0:8080"
20+
workers = 4
21+
reporter_token = "REPLACE_THIS_WITH_A_SECRET_KEY"
22+
23+
[assets]
24+
25+
path = "./res/assets/"
26+
27+
[branding]
28+
29+
page_title = "Crisp Status"
30+
page_url = "https://status.crisp.chat/"
31+
company_name = "Crisp IM SARL"
32+
icon_color = "#1972F5"
33+
icon_url = "https://valeriansaliou.github.io/vigil/images/crisp-icon.png"
34+
logo_color = "#1972F5"
35+
logo_url = "https://valeriansaliou.github.io/vigil/images/crisp-logo.svg"
36+
website_url = "https://crisp.chat/"
37+
support_url = "mailto:support@crisp.chat"
38+
39+
[metrics]
40+
41+
poll_interval = 120
42+
poll_retry = 2
43+
44+
poll_http_status_healthy_above = 200
45+
poll_http_status_healthy_below = 400
46+
47+
poll_delay_dead = 30
48+
poll_delay_sick = 10
49+
50+
push_delay_dead = 20
51+
52+
push_system_cpu_sick_above = 0.90
53+
push_system_ram_sick_above = 0.90
54+
55+
script_interval = 300
56+
57+
local_delay_dead = 40
58+
59+
[plugins]
60+
61+
[plugins.rabbitmq]
62+
63+
api_url = "http://127.0.0.1:15672"
64+
auth_username = "rabbitmq-administrator"
65+
auth_password = "RABBITMQ_ADMIN_PASSWORD"
66+
virtualhost = "crisp"
67+
68+
queue_ready_healthy_below = 500
69+
queue_nack_healthy_below = 100
70+
queue_ready_dead_above = 20000
71+
queue_nack_dead_above = 5000
72+
queue_loaded_retry_delay = 500
73+
74+
[notify]
75+
76+
startup_notification = true
77+
reminder_interval = 300
78+
79+
[notify.email]
80+
81+
from = "status@crisp.chat"
82+
to = "status@crisp.chat"
83+
84+
smtp_host = "localhost"
85+
smtp_port = 587
86+
smtp_username = "user-access"
87+
smtp_password = "user-password"
88+
smtp_encrypt = false
89+
90+
[notify.twilio]
91+
92+
to = [
93+
"+336xxxxxxx",
94+
"+337xxxxxxx"
95+
]
96+
97+
service_sid = "service-sid"
98+
account_sid = "account-sid"
99+
auth_token = "auth-token"
100+
101+
reminders_only = true
102+
103+
[notify.slack]
104+
105+
hook_url = "https://hooks.slack.com/services/xxxx"
106+
mention_channel = true
107+
108+
[notify.zulip]
109+
110+
bot_email = "bot-name@domain.zulipchat.com"
111+
bot_api_key = "xxxx"
112+
channel = "vigil"
113+
api_url = "https://domain.zulipchat.com/api/v1/"
114+
115+
[notify.telegram]
116+
117+
bot_token = "xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
118+
chat_id = "xxxxxxxxx"
119+
120+
[notify.pushover]
121+
122+
app_token = "xxxx"
123+
user_keys = ["xxxx"]
124+
125+
[notify.gotify]
126+
127+
app_url = "https://push.gotify.net"
128+
app_token = "xxxx"
129+
130+
[notify.xmpp]
131+
132+
from = "vigil@valeriansaliou.name"
133+
to = "valerian@valeriansaliou.name"
134+
135+
xmpp_password = "xmpp-password"
136+
137+
[notify.matrix]
138+
139+
homeserver_url = "https://matrix.org"
140+
access_token = "xxxx"
141+
room_id = "!abc123:matrix.org"
142+
143+
[notify.webhook]
144+
145+
hook_url = "https://domain.com/webhooks/xxxx"
146+
147+
[probe]
148+
149+
[[probe.service]]
150+
151+
id = "web"
152+
label = "Web nodes"
153+
154+
[[probe.service.node]]
155+
156+
id = "router"
157+
label = "Core main router"
158+
mode = "poll"
159+
160+
replicas = [
161+
"icmp://edge-1.pool.net.crisp.chat",
162+
"icmp://edge-2.pool.net.crisp.chat"
163+
]
164+
165+
[[probe.service.node]]
166+
167+
id = "load-balancer"
168+
label = "Core main load balancer"
169+
mode = "poll"
170+
171+
replicas = [
172+
"tcp://edge-1.pool.net.crisp.chat:80",
173+
"tcp://edge-2.pool.net.crisp.chat:80",
174+
"tcp://edge-3.pool.net.crisp.chat:80"
175+
]
176+
177+
[[probe.service.node]]
178+
179+
id = "help"
180+
label = "Core help load balancer"
181+
mode = "poll"
182+
replicas = ["tcp://help-1.pool.net.crisp.chat:80"]
183+
184+
[[probe.service.node]]
185+
186+
id = "api"
187+
label = "Access to API service"
188+
mode = "poll"
189+
replicas = ["https://api.crisp.chat/v1/_system/health"]
190+
191+
[[probe.service.node]]
192+
193+
id = "status"
194+
label = "Access to status page"
195+
mode = "poll"
196+
replicas = ["https://status.crisp.chat/robots.txt"]
197+
http_body_healthy_match = "User-agent:.*"
198+
199+
[[probe.service]]
200+
201+
id = "relay"
202+
label = "Relay nodes"
203+
204+
[[probe.service.node]]
205+
206+
id = "socket-client"
207+
label = "Visitor realtime sockets"
208+
mode = "push"
209+
rabbitmq_queue = "client"
210+
rabbitmq_queue_nack_healthy_below = 100
211+
rabbitmq_queue_nack_dead_above = 1000
212+
213+
[[probe.service]]
214+
215+
id = "internal"
216+
label = "Internal nodes"
217+
218+
[[probe.service.node]]
219+
220+
id = "gateway"
221+
label = "Private gateway"
222+
mode = "local"
223+
224+
[[probe.service.node]]
225+
226+
id = "capacity"
227+
label = "Network capacity"
228+
mode = "local"

0 commit comments

Comments
 (0)