Skip to content

Commit

Permalink
Update helm charts to create ingress and svc
Browse files Browse the repository at this point in the history
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
  • Loading branch information
PrasadG193 committed Jul 26, 2020
1 parent f307503 commit f2869a7
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 9 deletions.
1 change: 0 additions & 1 deletion cmd/botkube/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/infracloudio/botkube/pkg/metrics"
"github.com/infracloudio/botkube/pkg/notify"
"github.com/infracloudio/botkube/pkg/utils"
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions comm_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ communications:

# Settings for MS Teams
teams:
enabled: true
appID: "4300ff5c-ec94-4f13-a0ed-b9bf4a9da064"
appPassword: "XkuXl18Bl6pU-=e7oZRkuDLdbERDzI-/"
port: 3978
enabled: false
appID: 'APPLICATION_ID'
appPassword: 'APPLICATION_PASSWORD'
notiftype: short
port: 3978

# Settings for ELS
elasticsearch:
Expand Down
8 changes: 8 additions & 0 deletions deploy-all-in-one-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,14 @@ stringData:
type: botkube-event
shards: 1
replicas: 0
# Settings for MS Teams
teams:
enabled: false
appID: 'APPLICATION_ID'
appPassword: 'APPLICATION_PASSWORD'
notiftype: short
port: 3978
# Settings for Webhook
webhook:
Expand Down
7 changes: 4 additions & 3 deletions deploy-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,11 @@ stringData:
# Settings for MS Teams
teams:
enabled: true
appID: "4300ff5c-ec94-4f13-a0ed-b9bf4a9da064"
appPassword: "XkuXl18Bl6pU-=e7oZRkuDLdbERDzI-/"
enabled: false
appID: 'APPLICATION_ID'
appPassword: 'APPLICATION_PASSWORD'
notiftype: short
port: 3978
# Settings for Webhook
webhook:
Expand Down
33 changes: 33 additions & 0 deletions helm/botkube/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ if .Values.ingress.create }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ include "botkube.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "botkube.name" . }}
helm.sh/chart: {{ include "botkube.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app: botkube
annotations:
{{- if .Values.ingress.annotations }}
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
rules:
- http:
paths:
- path: {{ .Values.ingress.urlPath }}
backend:
serviceName: {{ include "botkube.fullname" . }}
servicePort: {{ .Values.communications.teams.port }}
{{- if .Values.ingress.host }}
host: {{ .Values.ingress.host }}
{{- end }}
{{- end -}}
8 changes: 7 additions & 1 deletion helm/botkube/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.serviceMonitor.enabled }}
{{- if or .Values.serviceMonitor.enabled .Values.communications.teams.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -12,9 +12,15 @@ metadata:
spec:
type: ClusterIP
ports:
{{- if .Values.serviceMonitor.enabled }}
- name: {{ .Values.service.name }}
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
{{- end }}
{{- if .Values.communications.teams.enabled }}
- name: "teams"
port: {{ .Values.communications.teams.port }}
{{- end }}
selector:
app: botkube
{{- end }}
20 changes: 20 additions & 0 deletions helm/botkube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ communications:
channel: 'MATTERMOST_CHANNEL' # Mattermost Channel for receiving BotKube alerts
notiftype: short # Change notification type short/long you want to receive. notiftype is optional and Default notification type is short (if not specified)

# Settings for MS Teams
teams:
enabled: false
appID: 'APPLICATION_ID'
appPassword: 'APPLICATION_PASSWORD'
notiftype: short
port: 3978

# Settings for ELS
elasticsearch:
enabled: false
Expand All @@ -293,6 +301,18 @@ service:
name: metrics
port: 2112
targetPort: 2112

# Ingress settings to expose teams endpoint
ingress:
create: false
annotations:
kubernetes.io/ingress.class: nginx
host: 'HOST'
urlPath: "/"
tls:
enabled: false
secretName: ''


serviceMonitor:
## If true, a ServiceMonitor CR is created for a botkube
Expand Down

0 comments on commit f2869a7

Please sign in to comment.