From 7b9e9da8f0f658893724dd1409fb052c911389c0 Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Mon, 27 Nov 2023 17:58:05 +0200 Subject: [PATCH 1/7] Add node-enricher to chart --- charts/komodor-agent/templates/daemonset.yaml | 1 + .../templates/node-enricher/_containers.tpl | 24 +++++++++++++++++++ charts/komodor-agent/values.yaml | 15 ++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 charts/komodor-agent/templates/node-enricher/_containers.tpl diff --git a/charts/komodor-agent/templates/daemonset.yaml b/charts/komodor-agent/templates/daemonset.yaml index ec7b9ede..4c0a57d5 100644 --- a/charts/komodor-agent/templates/daemonset.yaml +++ b/charts/komodor-agent/templates/daemonset.yaml @@ -33,6 +33,7 @@ spec: containers: {{- include "metrics.daemonset.container" . | nindent 8 }} {{- include "network_mapper.daemonset.container" . | nindent 8 }} + {{- include "node_enricher.daemonset.container" . | nindent 8 }} volumes: {{- include "metrics.daemonset.volumes" . | nindent 8 }} {{- include "network_mapper.daemonset.volumes" . | nindent 8 }} diff --git a/charts/komodor-agent/templates/node-enricher/_containers.tpl b/charts/komodor-agent/templates/node-enricher/_containers.tpl new file mode 100644 index 00000000..de5c3861 --- /dev/null +++ b/charts/komodor-agent/templates/node-enricher/_containers.tpl @@ -0,0 +1,24 @@ +{{- define "node_enricher.daemonset.container" }} +{{- if .Values.capabilities.nodeEnricher }} +- name: node-enricher + image: {{ .Values.imageRepo }}/{{ .Values.components.komodorDaemon.nodeEnricher.image.name}}:{{ .Values.components.komodorDaemon.nodeEnricher.image.tag }} + imagePullPolicy: {{ .Values.pullPolicy }} + resources: + {{ toYaml .Values.components.komodorDaemon.nodeEnricher.resources | trim | nindent 4 }} + env: + {{- include "komodorAgent.proxy-conf" . | indent 2 }} + - name: API_KEY + value: {{ .Values.apiKey }} + - name: CLUSTER_NAME + value: {{ .Values.clusterName }} + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: SERVER_HOST + value: {{ .Values.communications.serverHost }} + {{- if gt (len .Values.components.komodorDaemon.nodeEnricher.extraEnvVars) 0 }} + {{ toYaml .Values.components.komodorDaemon.nodeEnricher.extraEnvVars | nindent 2 }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/komodor-agent/values.yaml b/charts/komodor-agent/values.yaml index cd3aa956..ea700486 100644 --- a/charts/komodor-agent/values.yaml +++ b/charts/komodor-agent/values.yaml @@ -54,6 +54,8 @@ capabilities: metrics: true # capabilities.networkMapper -- (bool) Enable network mapping capabilities by the komodor agent networkMapper: true + # capabilities.nodeEnricher -- (bool) Enable node enricher capabilities by the komodor agent + nodeEnricher: true # capabilities.actions -- (bool) Allow users to perform actions on the cluster, granular access control is defined in the application actions: true # capabilities.helm -- Enable helm capabilities by the komodor agent @@ -94,7 +96,6 @@ capabilities: # capabilities.telemetry.collectApiServerMetrics -- Collect metrics from the api server (Should only be used for debugging purposes) collectApiServerMetrics: false - # components -- Configure the agent components # @default -- See sub-values components: @@ -220,6 +221,16 @@ components: # components.komodorDaemon.networkSniffer.resources -- Set custom resources to the komodor agent network sniffer container resources: {} + nodeEnricher: + # components.komodorDaemon.nodeEnricher.image -- Override the komodor agent node enricher image name or tag. + image: + name: node_enricher + tag: + # components.komodorDaemon.nodeEnricher.resources -- Set custom resources to the komodor agent node enricher container + resources: {} + # components.komodorDaemon.nodeEnricher.extraEnvVars -- List of additional environment variables, Each entry is a key-value pair + extraEnvVars: [] + allowedResources: # allowedResources.event -- Enables watching `event` event: true @@ -336,4 +347,4 @@ communications: serverHost: &serverHost https://app.komodor.com wsHost: wss://app.komodor.com tasksServerHost: *serverHost - telemetryServerHost: https://telemetry.komodor.com \ No newline at end of file + telemetryServerHost: https://telemetry.komodor.com From 85e98ee65f6eacd33c494a96698995557bce04c5 Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Tue, 28 Nov 2023 11:25:23 +0200 Subject: [PATCH 2/7] fix ci --- charts/komodor-agent/templates/daemonset.yaml | 2 +- charts/komodor-agent/values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/komodor-agent/templates/daemonset.yaml b/charts/komodor-agent/templates/daemonset.yaml index 4c0a57d5..9a604a0d 100644 --- a/charts/komodor-agent/templates/daemonset.yaml +++ b/charts/komodor-agent/templates/daemonset.yaml @@ -33,7 +33,7 @@ spec: containers: {{- include "metrics.daemonset.container" . | nindent 8 }} {{- include "network_mapper.daemonset.container" . | nindent 8 }} - {{- include "node_enricher.daemonset.container" . | nindent 8 }} + {{- include "node_enricher.daemonset.container" . | nindent 8 }} volumes: {{- include "metrics.daemonset.volumes" . | nindent 8 }} {{- include "network_mapper.daemonset.volumes" . | nindent 8 }} diff --git a/charts/komodor-agent/values.yaml b/charts/komodor-agent/values.yaml index ea700486..a506d6d5 100644 --- a/charts/komodor-agent/values.yaml +++ b/charts/komodor-agent/values.yaml @@ -221,6 +221,8 @@ components: # components.komodorDaemon.networkSniffer.resources -- Set custom resources to the komodor agent network sniffer container resources: {} + # components.komodorDaemon.nodeEnricher -- Configure the komodor daemon node enricher components + # @default -- See sub-values nodeEnricher: # components.komodorDaemon.nodeEnricher.image -- Override the komodor agent node enricher image name or tag. image: From 14b3985f762152141aa46b4cb7592cbb2655a005 Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Tue, 28 Nov 2023 13:00:52 +0200 Subject: [PATCH 3/7] generate readme --- charts/komodor-agent/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/charts/komodor-agent/README.md b/charts/komodor-agent/README.md index 5da7243c..f78a4aca 100644 --- a/charts/komodor-agent/README.md +++ b/charts/komodor-agent/README.md @@ -115,6 +115,7 @@ The command removes all the Kubernetes components associated with the chart and | capabilities | object | See sub-values | Configure the agent capabilities | | capabilities.metrics | bool | `true` | Fetch workload metrics and send them to komodor backend | | capabilities.networkMapper | bool | `true` | Enable network mapping capabilities by the komodor agent | +| capabilities.nodeEnricher | bool | `true` | Enable node enricher capabilities by the komodor agent | | capabilities.actions | bool | `true` | Allow users to perform actions on the cluster, granular access control is defined in the application | | capabilities.helm | bool | `true` | Enable helm capabilities by the komodor agent | | capabilities.events | object | See sub-values | Configure the agent events capabilities | @@ -166,6 +167,10 @@ The command removes all the Kubernetes components associated with the chart and | components.komodorDaemon.networkSniffer | object | See sub-values | Configure the komodor daemon network sniffer components | | components.komodorDaemon.networkSniffer.image | object | `{"name":"network-mapper-sniffer","tag":"v1.0.3"}` | Override the komodor agent network sniffer image name or tag. | | components.komodorDaemon.networkSniffer.resources | object | `{}` | Set custom resources to the komodor agent network sniffer container | +| components.komodorDaemon.nodeEnricher | object | See sub-values | Configure the komodor daemon node enricher components | +| components.komodorDaemon.nodeEnricher.image | object | `{"name":"node_enricher","tag":null}` | Override the komodor agent node enricher image name or tag. | +| components.komodorDaemon.nodeEnricher.resources | object | `{}` | Set custom resources to the komodor agent node enricher container | +| components.komodorDaemon.nodeEnricher.extraEnvVars | list | `[]` | List of additional environment variables, Each entry is a key-value pair | | allowedResources.event | bool | `true` | Enables watching `event` | | allowedResources.deployment | bool | `true` | Enables watching `deployments` | | allowedResources.replicationController | bool | `true` | Enables watching `replicationControllers` | From 0b3daec6903064ad5a097cba6dabffdd6586352c Mon Sep 17 00:00:00 2001 From: buildkite Date: Thu, 30 Nov 2023 16:52:16 +0200 Subject: [PATCH 4/7] Fix template error by adding default tag version --- charts/komodor-agent/templates/daemonset.yaml | 2 +- charts/komodor-agent/templates/node-enricher/_containers.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/komodor-agent/templates/daemonset.yaml b/charts/komodor-agent/templates/daemonset.yaml index 9a604a0d..6e5578b8 100644 --- a/charts/komodor-agent/templates/daemonset.yaml +++ b/charts/komodor-agent/templates/daemonset.yaml @@ -33,7 +33,7 @@ spec: containers: {{- include "metrics.daemonset.container" . | nindent 8 }} {{- include "network_mapper.daemonset.container" . | nindent 8 }} - {{- include "node_enricher.daemonset.container" . | nindent 8 }} + {{- include "node_enricher.daemonset.container" . | nindent 8 }} volumes: {{- include "metrics.daemonset.volumes" . | nindent 8 }} {{- include "network_mapper.daemonset.volumes" . | nindent 8 }} diff --git a/charts/komodor-agent/templates/node-enricher/_containers.tpl b/charts/komodor-agent/templates/node-enricher/_containers.tpl index de5c3861..4654d9ef 100644 --- a/charts/komodor-agent/templates/node-enricher/_containers.tpl +++ b/charts/komodor-agent/templates/node-enricher/_containers.tpl @@ -1,7 +1,7 @@ {{- define "node_enricher.daemonset.container" }} {{- if .Values.capabilities.nodeEnricher }} - name: node-enricher - image: {{ .Values.imageRepo }}/{{ .Values.components.komodorDaemon.nodeEnricher.image.name}}:{{ .Values.components.komodorDaemon.nodeEnricher.image.tag }} + image: {{ .Values.imageRepo }}/{{ .Values.components.komodorDaemon.nodeEnricher.image.name}}:{{ .Values.components.komodorDaemon.nodeEnricher.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.pullPolicy }} resources: {{ toYaml .Values.components.komodorDaemon.nodeEnricher.resources | trim | nindent 4 }} From baa9b5125829a969dd705f3ad3c3491c3bf2ca0a Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Sun, 3 Dec 2023 17:32:24 +0200 Subject: [PATCH 5/7] use configuration instead of envvars --- .../templates/node-enricher/_containers.tpl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/charts/komodor-agent/templates/node-enricher/_containers.tpl b/charts/komodor-agent/templates/node-enricher/_containers.tpl index 4654d9ef..8f5d9fe3 100644 --- a/charts/komodor-agent/templates/node-enricher/_containers.tpl +++ b/charts/komodor-agent/templates/node-enricher/_containers.tpl @@ -5,18 +5,15 @@ imagePullPolicy: {{ .Values.pullPolicy }} resources: {{ toYaml .Values.components.komodorDaemon.nodeEnricher.resources | trim | nindent 4 }} + volumeMounts: + - name: configuration + mountPath: /etc/komodor env: {{- include "komodorAgent.proxy-conf" . | indent 2 }} - - name: API_KEY - value: {{ .Values.apiKey }} - - name: CLUSTER_NAME - value: {{ .Values.clusterName }} - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - - name: SERVER_HOST - value: {{ .Values.communications.serverHost }} {{- if gt (len .Values.components.komodorDaemon.nodeEnricher.extraEnvVars) 0 }} {{ toYaml .Values.components.komodorDaemon.nodeEnricher.extraEnvVars | nindent 2 }} {{- end }} From 748e4677d4e26d0124bf62faa69ec168c6bd985a Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Mon, 4 Dec 2023 16:07:58 +0200 Subject: [PATCH 6/7] disable enricher by default --- charts/komodor-agent/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/komodor-agent/values.yaml b/charts/komodor-agent/values.yaml index a506d6d5..13082d37 100644 --- a/charts/komodor-agent/values.yaml +++ b/charts/komodor-agent/values.yaml @@ -55,7 +55,7 @@ capabilities: # capabilities.networkMapper -- (bool) Enable network mapping capabilities by the komodor agent networkMapper: true # capabilities.nodeEnricher -- (bool) Enable node enricher capabilities by the komodor agent - nodeEnricher: true + nodeEnricher: false # capabilities.actions -- (bool) Allow users to perform actions on the cluster, granular access control is defined in the application actions: true # capabilities.helm -- Enable helm capabilities by the komodor agent From c27a8b910bed0a48aa80064ea20314512d99cfed Mon Sep 17 00:00:00 2001 From: Ran Elishayev Date: Wed, 6 Dec 2023 10:32:32 +0200 Subject: [PATCH 7/7] generate readme --- charts/komodor-agent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/komodor-agent/README.md b/charts/komodor-agent/README.md index f78a4aca..9e984283 100644 --- a/charts/komodor-agent/README.md +++ b/charts/komodor-agent/README.md @@ -115,7 +115,7 @@ The command removes all the Kubernetes components associated with the chart and | capabilities | object | See sub-values | Configure the agent capabilities | | capabilities.metrics | bool | `true` | Fetch workload metrics and send them to komodor backend | | capabilities.networkMapper | bool | `true` | Enable network mapping capabilities by the komodor agent | -| capabilities.nodeEnricher | bool | `true` | Enable node enricher capabilities by the komodor agent | +| capabilities.nodeEnricher | bool | `false` | Enable node enricher capabilities by the komodor agent | | capabilities.actions | bool | `true` | Allow users to perform actions on the cluster, granular access control is defined in the application | | capabilities.helm | bool | `true` | Enable helm capabilities by the komodor agent | | capabilities.events | object | See sub-values | Configure the agent events capabilities |