From 65f587895878183ebfcc8186c9f0542a2ca8fc98 Mon Sep 17 00:00:00 2001 From: Thomas Leclaire Date: Tue, 24 Sep 2024 19:21:58 +0200 Subject: [PATCH] improve deployment (#344) Signed-off-by: Thomas Leclaire --- README.md | 10 +++++----- deploy/chart/Chart.yaml | 4 ++-- deploy/chart/README.md | 2 +- deploy/chart/templates/rbac.yaml | 5 ++++- deploy/chart/templates/serviceaccount.yaml | 6 ++++++ deploy/chart/values.yaml | 2 ++ deploy/deploy.yaml | 7 +++++-- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 233e5e29..2da2adf1 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ ```shell helm repo add kwatch https://kwatch.dev/charts -helm install [RELEASE_NAME] kwatch/kwatch --namespace kwatch --create-namespace --version 0.10.0 +helm install [RELEASE_NAME] kwatch/kwatch --namespace kwatch --create-namespace --version 0.10.1 ``` To get more details, please check [chart's configuration](https://github.com/abahmed/kwatch/blob/main/deploy/chart/README.md) @@ -46,7 +46,7 @@ To get more details, please check [chart's configuration](https://github.com/aba You need to get config template to add your configs ```shell -curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.10.0/deploy/config.yaml -o config.yaml +curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.10.1/deploy/config.yaml -o config.yaml ``` Then edit `config.yaml` file and apply your configuration @@ -58,7 +58,7 @@ kubectl apply -f config.yaml To deploy **kwatch**, execute following command: ```shell -kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.0/deploy/deploy.yaml +kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.1/deploy/deploy.yaml ``` ## High Level Architecture @@ -337,8 +337,8 @@ basic auth ### Cleanup ```shell -kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.0/deploy/config.yaml -kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.0/deploy/deploy.yaml +kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.1/deploy/config.yaml +kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.10.1/deploy/deploy.yaml ``` ## 👍 Contribute & Support diff --git a/deploy/chart/Chart.yaml b/deploy/chart/Chart.yaml index fca95eef..25ccadac 100644 --- a/deploy/chart/Chart.yaml +++ b/deploy/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: kwatch -version: "0.10.0" -appVersion: "v0.10.0" +version: "0.10.1" +appVersion: "v0.10.1" description: monitor all changes in your Kubernetes(K8s) cluster, detects crashes in your running apps in realtime, and publishes notifications to your channels (Slack, Discord, etc.) instantly diff --git a/deploy/chart/README.md b/deploy/chart/README.md index 64b9d794..9e1d7755 100644 --- a/deploy/chart/README.md +++ b/deploy/chart/README.md @@ -13,7 +13,7 @@ helm repo update ## Install Chart ```console -helm install [RELEASE_NAME] kwatch/kwatch --version 0.10.0 +helm install [RELEASE_NAME] kwatch/kwatch --version 0.10.1 ``` ## Uninstall Chart diff --git a/deploy/chart/templates/rbac.yaml b/deploy/chart/templates/rbac.yaml index b8aec1a5..99327470 100644 --- a/deploy/chart/templates/rbac.yaml +++ b/deploy/chart/templates/rbac.yaml @@ -4,7 +4,10 @@ metadata: name: {{ .Release.Name }} rules: - apiGroups: [""] - resources: ["pods", "pods/log", "events", "nodes"] + resources: ["events", "nodes", "nodes/proxy", "pods", "pods/log", "persistentvolumeclaims"] + verbs: ["get", "watch", "list"] +- apiGroups: ["apps"] + resources: ["daemonsets", "statefulsets", "deployments", "replicasets"] verbs: ["get", "watch", "list"] --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/chart/templates/serviceaccount.yaml b/deploy/chart/templates/serviceaccount.yaml index 81c0d7ed..0e7cd6ef 100644 --- a/deploy/chart/templates/serviceaccount.yaml +++ b/deploy/chart/templates/serviceaccount.yaml @@ -3,3 +3,9 @@ kind: ServiceAccount metadata: name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.sacAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index c78dbe49..da752b09 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -25,6 +25,8 @@ affinity: {} podAnnotations: {} +sacAnnotations: {} + podLabels: {} # kwatch configuration diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index 5cf36bdf..96c5485b 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -9,7 +9,10 @@ metadata: name: kwatch rules: - apiGroups: [""] - resources: ["pods", "pods/log", "events", "nodes"] + resources: ["events", "nodes", "nodes/proxy", "pods", "pods/log", "persistentvolumeclaims"] + verbs: ["get", "watch", "list"] +- apiGroups: ["apps"] + resources: ["daemonsets", "statefulsets", "deployments", "replicasets"] verbs: ["get", "watch", "list"] --- apiVersion: v1 @@ -49,7 +52,7 @@ spec: serviceAccountName: kwatch containers: - name: kwatch - image: ghcr.io/abahmed/kwatch:v0.10.0 + image: ghcr.io/abahmed/kwatch:v0.10.1 imagePullPolicy: Always volumeMounts: - name: config-volume