install botkube
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Tobias Brunner 2020-12-13 11:23:13 +01:00
parent 9ec8de4081
commit d09789f631
5 changed files with 346 additions and 0 deletions

23
_apps/botkube.yaml Normal file
View File

@ -0,0 +1,23 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: botkube
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: botkube
server: https://kubernetes.default.svc
project: apps
source:
path: botkube
repoURL: https://git.tbrnt.ch/tobru/gitops-tbrnt.git
targetRevision: HEAD
directory:
recurse: true
---
apiVersion: v1
kind: Namespace
metadata:
name: botkube

222
botkube/configmap.yaml Normal file
View File

@ -0,0 +1,222 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: botkube-configmap
namespace: botkube
labels:
app: botkube
data:
resource_config.yaml: |
## Resources you want to watch
resources:
- name: v1/pods # Name of the resource. Resource name must be in group/version/resource (G/V/R) format
# resource name should be plural (e.g apps/v1/deployments, v1/pods)
namespaces: # List of namespaces, "all" will watch all the namespaces
include:
- all
ignore: # List of namespaces to be ignored (omitempty), used only with include: all
- # example : include [all], ignore [x,y,z]
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
- create
- delete
- error
- name: v1/services
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: apps/v1/deployments
namespaces:
include:
- all
ignore:
-
events:
- create
- update
- delete
- error
updateSetting:
includeDiff: true
fields:
- spec.template.spec.containers[*].image
- status.availableReplicas
- name: apps/v1/statefulsets
namespaces:
include:
- all
ignore:
-
events:
- create
- update
- delete
- error
updateSetting:
includeDiff: true
fields:
- spec.template.spec.containers[*].image
- status.readyReplicas
- name: networking.k8s.io/v1beta1/ingresses
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: v1/nodes
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: v1/namespaces
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: v1/persistentvolumes
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: v1/persistentvolumeclaims
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: v1/configmaps
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: apps/v1/daemonsets
namespaces:
include:
- all
ignore:
-
events:
- create
- update
- delete
- error
updateSetting:
includeDiff: true
fields:
- spec.template.spec.containers[*].image
- status.numberReady
- name: batch/v1/jobs
namespaces:
include:
- all
ignore:
-
events:
- create
- update
- delete
- error
updateSetting:
includeDiff: true
fields:
- spec.template.spec.containers[*].image
- status.conditions[*].type
- name: rbac.authorization.k8s.io/v1/roles
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: rbac.authorization.k8s.io/v1/rolebindings
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: rbac.authorization.k8s.io/v1/clusterrolebindings
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: rbac.authorization.k8s.io/v1/clusterroles
namespaces:
include:
- all
ignore:
-
events:
- create
- delete
- error
# Check true if you want to receive recommendations
# about the best practices for the created resource
recommendations: true
# Setting to support multiple clusters
settings:
# Cluster name to differentiate incoming messages
clustername: knurrli
# Kubectl executor configs
kubectl:
# Set true to enable kubectl commands execution
enabled: false
commands:
# method which are allowed
verbs: ["api-resources", "api-versions", "cluster-info", "describe", "diff", "explain", "get", "logs", "top", "auth"]
# resource configuration which is allowed
resources: ["deployments", "pods" , "namespaces", "daemonsets", "statefulsets", "storageclasses", "nodes"]
# set Namespace to execute botkube kubectl commands by default
defaultNamespace: default
# Set true to enable commands execution from configured channel only
restrictAccess: false
# Set true to enable config watcher
configwatcher: true
# Set false to disable upgrade notification
upgradeNotifier: true

49
botkube/deployment.yaml Normal file
View File

@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: botkube
namespace: 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: "infracloudio/botkube:v0.11.0"
imagePullPolicy: Always
volumeMounts:
- name: config-volume
mountPath: "/config"
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: v0.11.0
volumes:
- name: config-volume
projected:
sources:
- configMap:
name: botkube-configmap
- secret:
name: botkube-communication-secret
# run as non privilaged user
securityContext:
runAsUser: 101
runAsGroup: 101

33
botkube/rbac.yaml Normal file
View File

@ -0,0 +1,33 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: botkube-sa
namespace: botkube
labels:
app: botkube
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: botkube-clusterrole
labels:
app: botkube
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "watch", "list"]
---
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

19
botkube/secret.yaml Normal file
View File

@ -0,0 +1,19 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: botkube-communication-secret
namespace: botkube
spec:
encryptedData:
comm_config.yaml: AgA5Gh3mUqpe6nR2r9k27TQZOPlqSNY+mTU7TpK+MzmfiRDwjrsHkDfN2Bo+91Y2ISJF9EdSmbcmN4CcGZs9eP2alMyVcXOt/LmuQozSmU3Tn08ClrmNuVKfkDt+3P1TvGKlyNtOK6M7b4YwpFXrfQbhWSea3R8gYaca4V1Zcf8WC25BDPavjd9Ld/3z+eq8BpH6a3UvAoRPPPFBSemA/olF1sA2yKEFCJwBe9q2x94heH2fvB77joZn5LMqEKW2qvKNBNz1zbMue4GPvfp3/Xwd2k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XDuMt9+j30dgJInfS+0lk2/SQvxDyCGYMAfhAfb1mjAi7RxB2fcPxYl4gHw6D/b2fOZrgSmzg96UKY4q5GSjYACdAvHiN5fK0ZFN7KDxlD1zsIMo0JYrVEm0p07NXKraUatZUGRK7T+dvbjfzBc3ZVPHkAMb7NkZ0V4E84AdubvccQYj62u96rdp4lvDJBMBQVOA==
template:
metadata:
creationTimestamp: null
labels:
app: botkube
name: botkube-communication-secret
namespace: botkube
type: Opaque
status: {}