feat: setting env for slack and telegram from helm (#270)

This commit is contained in:
George 2022-09-05 17:12:18 +03:00 committed by GitHub
parent f7500052ad
commit dd6975858a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 0 deletions

View file

@ -83,6 +83,34 @@ helm upgrade \
grafana/oncall
```
### Set up Slack and Telegram
You can set up Slack connection via following variables:
```
oncall:
slack:
enabled: true
command: ~
clientId: ~
clientSecret: ~
apiToken: ~
apiTokenCommon: ~
```
`oncall.slack.command` is used for changing default bot slash command,
`oncall`. In slack, it could be called via `/<oncall.slack.command>`.
To set up Telegram tokem and webhook url use:
```
oncall:
telegram:
enabled: true
token: ~
webhookUrl: ~
```
### Set up external access
Grafana OnCall can be connected to the external monitoring systems or grafana deployed to the other cluster.
Nginx Ingress Controller and Cert Manager charts are included in the helm chart with the default configuration.

View file

@ -23,6 +23,40 @@
value: "1024"
{{- end }}
{{- define "snippet.oncall.slack.env" -}}
{{- if .Values.oncall.slack.enabled -}}
- name: FEATURE_SLACK_INTEGRATION_ENABLED
value: {{ .Values.oncall.slack.enabled | toString | title | quote }}
- name: SLACK_SLASH_COMMAND_NAME
value: "/{{ .Values.oncall.slack.commandName | default "oncall" }}"
- name: SLACK_CLIENT_OAUTH_ID
value: {{ .Values.oncall.slack.clientId | default "" | quote }}
- name: SLACK_CLIENT_OAUTH_SECRET
value: {{ .Values.oncall.slack.clientSecret | default "" | quote }}
- name: SLACK_API_TOKEN
value: {{ .Values.oncall.slack.apiToken | default "" | quote }}
- name: SLACK_API_TOKEN_COMMON
value: {{ .Values.oncall.slack.apiTokenCommon | default "" | quote }}
{{- else -}}
- name: FEATURE_SLACK_INTEGRATION_ENABLED
value: {{ .Values.oncall.slack.enabled | toString | title | quote }}
{{- end -}}
{{- end }}
{{- define "snippet.oncall.telegram.env" -}}
{{- if .Values.oncall.telegram.enabled -}}
- name: FEATURE_TELEGRAM_INTEGRATION_ENABLED
value: {{ .Values.oncall.telegram.enabled | toString | title | quote }}
- name: TELEGRAM_WEBHOOK_URL
value: {{ .Values.oncall.telegram.webhookUrl | default "" | quote }}
- name: TELEGRAM_TOKEN
value: {{ .Values.oncall.telegram.token | default "" | quote }}
{{- else -}}
- name: FEATURE_TELEGRAM_INTEGRATION_ENABLED
value: {{ .Values.oncall.telegram.enabled | toString | title | quote }}
{{- end -}}
{{- end }}
{{- define "snippet.celery.env" -}}
- name: CELERY_WORKER_QUEUE
value: "default,critical,long,slack,telegram,webhook,celery"

View file

@ -39,6 +39,8 @@ spec:
env:
{{- include "snippet.celery.env" . | nindent 12 }}
{{- include "snippet.oncall.env" . | nindent 12 }}
{{- include "snippet.oncall.slack.env" . | nindent 12 }}
{{- include "snippet.oncall.telegram.env" . | nindent 12 }}
{{- include "snippet.mysql.env" . | nindent 12 }}
{{- include "snippet.rabbitmq.env" . | nindent 12 }}
{{- include "snippet.redis.env" . | nindent 12 }}

View file

@ -45,6 +45,8 @@ spec:
protocol: TCP
env:
{{- include "snippet.oncall.env" . | nindent 12 }}
{{- include "snippet.oncall.slack.env" . | nindent 12 }}
{{- include "snippet.oncall.telegram.env" . | nindent 12 }}
{{- include "snippet.mysql.env" . | nindent 12 }}
{{- include "snippet.rabbitmq.env" . | nindent 12 }}
{{- include "snippet.redis.env" . | nindent 12 }}

View file

@ -40,6 +40,19 @@ celery:
# cpu: 100m
# memory: 128Mi
oncall:
slack:
enabled: false
command: ~
clientId: ~
clientSecret: ~
apiToken: ~
apiTokenCommon: ~
telegram:
enabled: false
token: ~
webhookUrl: ~
# Whether to run django database migrations automatically
migrate:
enabled: true