-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TLS support for Mattermost in Botkube
Closes #81
- Loading branch information
1 parent
06e1b3c
commit f2048fb
Showing
6 changed files
with
305 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,253 @@ | ||
--- | ||
# Configmap | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: botkube-configmap | ||
labels: | ||
app: botkube | ||
data: | ||
config.yaml: | | ||
## Resources you want to watch | ||
resources: | ||
- name: pods # Name of the resources e.g pods, deployments, ingresses, etc. (Resource name must be in plural form) | ||
namespaces: # List of namespaces, "all" will watch all the namespaces | ||
- all | ||
events: # List of lifecycle events you want to receive, e.g create, update, delete OR all | ||
- create | ||
- delete | ||
- name: services | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: deployments | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: ingresses | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: nodes | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: namespaces | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: persistentvolumes | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: persistentvolumeclaims | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: secrets | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: configmaps | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: daemonsets | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: jobs | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: roles | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: rolebindings | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: clusterroles | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: clusterrolebindings | ||
namespace: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
- name: nodes | ||
namespaces: | ||
- all | ||
events: | ||
- create | ||
- delete | ||
# K8S error/warning events you want to receive for the configured resources | ||
events: | ||
types: | ||
#- normal | ||
- warning | ||
# Check true if you want to receive recommendations | ||
# about the best practices for the created resource | ||
recommendations: true | ||
# Channels configuration | ||
communications: | ||
# Settings for Slack | ||
slack: | ||
enabled: false | ||
channel: 'SLACK_CHANNEL' | ||
token: 'SLACK_API_TOKEN' | ||
# Settings for Mattermost | ||
mattermost: | ||
enabled: false | ||
url: 'MATTERMOST_SERVER_URL' # URL where Mattermost is running. e.g https://example.com:9243 | ||
token: 'MATTERMOST_TOKEN' # Personal Access token generated by BotKube user | ||
team: 'MATTERMOST_TEAM' # Mattermost Team to configure with BotKube | ||
channel: 'MATTERMOST_CHANNEL' # Mattermost Channel for receiving BotKube alerts | ||
# Settings for ELS | ||
elasticsearch: | ||
enable: false | ||
server: 'ELASTICSEARCH_ADDRESS' # e.g https://example.com:9243 | ||
username: 'ELASTICSEARCH_USERNAME' | ||
password: 'ELASTICSEARCH_PASSWORD' | ||
# ELS index settings | ||
index: | ||
name: botkube | ||
type: botkube-event | ||
shards: 1 | ||
replicas: 0 | ||
# Setting to support multiple clusters | ||
settings: | ||
# Cluster name to differentiate incoming messages | ||
clustername: not-configured | ||
# Set false to disable kubectl commands execution | ||
allowkubectl: false | ||
--- | ||
# serviceaccount | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: botkube-sa | ||
labels: | ||
app: botkube | ||
--- | ||
# Source: botkube/templates/clusterrole.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: botkube-clusterrole | ||
labels: | ||
app: botkube | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["get", "watch", "list"] | ||
--- | ||
# clusterrolebinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: botkube-clusterrolebinding | ||
labels: | ||
app: botkube | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: botkube-clusterrole | ||
subjects: | ||
- kind: ServiceAccount | ||
name: botkube-sa | ||
namespace: botkube | ||
--- | ||
# Secret | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: botkube-secret | ||
labels: | ||
app: botkube | ||
data: | ||
ca-certificates.crt: ENCODED_CERTIFICATE | ||
--- | ||
# deployment | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: botkube | ||
labels: | ||
component: controller | ||
app: botkube | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
component: controller | ||
app: botkube | ||
template: | ||
metadata: | ||
labels: | ||
component: controller | ||
app: botkube | ||
spec: | ||
serviceAccountName: botkube-sa | ||
containers: | ||
- name: botkube | ||
image: "infracloud/botkube:0.7.0" | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: "/config" | ||
- name: certs | ||
mountPath: "/etc/ssl/certs" | ||
env: | ||
- name: CONFIG_PATH | ||
value: "/config/" | ||
# set one of the log levels- info, warn, debug, error, fatal, panic | ||
- name: LOG_LEVEL | ||
value: "info" | ||
# set BotKube release version | ||
- name: BOTKUBE_VERSION | ||
value: 0.7.0 | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: botkube-configmap | ||
- name: certs | ||
secret: | ||
secretName: botkube-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if ne .Values.config.communications.mattermost.cert "None" }} | ||
|
||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "botkube.fullname" . }}-secret | ||
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 }} | ||
data: | ||
ca-certificates.crt: {{ .Files.Get (printf "%s" .Values.config.communications.mattermost.cert) | b64enc }} | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters