From e38906e5598c96ad829e4d706a50fd694329f807 Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 15 Nov 2023 13:50:31 +0200 Subject: [PATCH 1/6] control the payload support for the agent --- charts/port-agent/Chart.yaml | 4 ++-- charts/port-agent/templates/configmap.yml | 9 +++++++++ charts/port-agent/templates/deployment.yaml | 13 ++++++++++++- charts/port-agent/values.yaml | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 charts/port-agent/templates/configmap.yml diff --git a/charts/port-agent/Chart.yaml b/charts/port-agent/Chart.yaml index 0020f4f..65ff155 100644 --- a/charts/port-agent/Chart.yaml +++ b/charts/port-agent/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: port-agent description: A Helm chart for Port Agent type: application -version: 0.4.0 -appVersion: "v0.4.0" +version: 0.5.0 +appVersion: "v0.5.0" home: https://getport.io/ sources: - https://github.com/port-labs/port-agent diff --git a/charts/port-agent/templates/configmap.yml b/charts/port-agent/templates/configmap.yml new file mode 100644 index 0000000..a13edbc --- /dev/null +++ b/charts/port-agent/templates/configmap.yml @@ -0,0 +1,9 @@ +{{ if .Values.controlThePayloadConfigFile }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-configmap +data: + controlThePayloadConfig: | + {{- .Files.Get .Values.controlThePayloadConfigFile | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/port-agent/templates/deployment.yaml b/charts/port-agent/templates/deployment.yaml index dd2bab7..35109c9 100644 --- a/charts/port-agent/templates/deployment.yaml +++ b/charts/port-agent/templates/deployment.yaml @@ -39,7 +39,18 @@ spec: {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} - + volumeMounts: + {{- if .Values.controlThePayloadConfigFile }} + - mountPath: /app/control_the_payload_config.json + name: {{ .Release.Name }}-configmap + subPath: controlThePayloadConfig + {{- end }} + volumes: + {{- if .Values.controlThePayloadConfigFile }} + - name: {{ .Release.Name }}-configmap + configMap: + name: {{ .Release.Name }}-configmap + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/port-agent/values.yaml b/charts/port-agent/values.yaml index de22008..9c6a336 100644 --- a/charts/port-agent/values.yaml +++ b/charts/port-agent/values.yaml @@ -7,6 +7,7 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +controlThePayloadConfigFile: "" secret: annotations: {} name: "" From 2b8366a20d1d7edc885b1849e77a5a95283f6a84 Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 15 Nov 2023 19:50:42 +0200 Subject: [PATCH 2/6] using latest agent version --- charts/port-agent/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/port-agent/Chart.yaml b/charts/port-agent/Chart.yaml index 65ff155..b9137b1 100644 --- a/charts/port-agent/Chart.yaml +++ b/charts/port-agent/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: port-agent description: A Helm chart for Port Agent type: application -version: 0.5.0 -appVersion: "v0.5.0" +version: 0.5.1 +appVersion: "v0.5.1" home: https://getport.io/ sources: - https://github.com/port-labs/port-agent From ce50eaff5e981416e11a1e9e5133ca5a0fdab8da Mon Sep 17 00:00:00 2001 From: yair Date: Wed, 15 Nov 2023 21:12:49 +0200 Subject: [PATCH 3/6] passing the config with --set-file instead of --set --- charts/port-agent/templates/configmap.yml | 6 +++--- charts/port-agent/templates/deployment.yaml | 4 ++-- charts/port-agent/values.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/port-agent/templates/configmap.yml b/charts/port-agent/templates/configmap.yml index a13edbc..6136eca 100644 --- a/charts/port-agent/templates/configmap.yml +++ b/charts/port-agent/templates/configmap.yml @@ -1,9 +1,9 @@ -{{ if .Values.controlThePayloadConfigFile }} +{{ if .Values.controlThePayloadConfig }} apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-configmap data: - controlThePayloadConfig: | - {{- .Files.Get .Values.controlThePayloadConfigFile | nindent 4 }} + controlThePayloadConfig: |- + {{- .Values.controlThePayloadConfig | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/charts/port-agent/templates/deployment.yaml b/charts/port-agent/templates/deployment.yaml index 35109c9..01e973f 100644 --- a/charts/port-agent/templates/deployment.yaml +++ b/charts/port-agent/templates/deployment.yaml @@ -40,13 +40,13 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - {{- if .Values.controlThePayloadConfigFile }} + {{- if .Values.controlThePayloadConfig }} - mountPath: /app/control_the_payload_config.json name: {{ .Release.Name }}-configmap subPath: controlThePayloadConfig {{- end }} volumes: - {{- if .Values.controlThePayloadConfigFile }} + {{- if .Values.controlThePayloadConfig }} - name: {{ .Release.Name }}-configmap configMap: name: {{ .Release.Name }}-configmap diff --git a/charts/port-agent/values.yaml b/charts/port-agent/values.yaml index 9c6a336..fed417e 100644 --- a/charts/port-agent/values.yaml +++ b/charts/port-agent/values.yaml @@ -7,7 +7,7 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -controlThePayloadConfigFile: "" +controlThePayloadConfig: "" secret: annotations: {} name: "" From 635b1ff19c8f3f22399bffa4732ebaa93d5b58aa Mon Sep 17 00:00:00 2001 From: yair Date: Thu, 16 Nov 2023 10:36:52 +0200 Subject: [PATCH 4/6] configmap.yml --- charts/port-agent/templates/configmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/port-agent/templates/configmap.yml b/charts/port-agent/templates/configmap.yml index 6136eca..a7591fb 100644 --- a/charts/port-agent/templates/configmap.yml +++ b/charts/port-agent/templates/configmap.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-configmap + name: {{ include "port-agent.fullname" . }} data: controlThePayloadConfig: |- {{- .Values.controlThePayloadConfig | nindent 4 }} From 3878343352be60d9e77d001ee25d92385dc49f0a Mon Sep 17 00:00:00 2001 From: yair Date: Thu, 16 Nov 2023 11:11:03 +0200 Subject: [PATCH 5/6] configmap.yml --- charts/port-agent/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/port-agent/templates/deployment.yaml b/charts/port-agent/templates/deployment.yaml index 01e973f..0f43a2d 100644 --- a/charts/port-agent/templates/deployment.yaml +++ b/charts/port-agent/templates/deployment.yaml @@ -42,14 +42,14 @@ spec: volumeMounts: {{- if .Values.controlThePayloadConfig }} - mountPath: /app/control_the_payload_config.json - name: {{ .Release.Name }}-configmap + name: {{ include "port-agent.fullname" . }} subPath: controlThePayloadConfig {{- end }} volumes: {{- if .Values.controlThePayloadConfig }} - - name: {{ .Release.Name }}-configmap + - name: {{ include "port-agent.fullname" . }} configMap: - name: {{ .Release.Name }}-configmap + name: {{ include "port-agent.fullname" . }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: From c0d5c20280a4036d255c2f28d80d7b832b965264 Mon Sep 17 00:00:00 2001 From: yair Date: Thu, 16 Nov 2023 11:14:06 +0200 Subject: [PATCH 6/6] readme updates --- charts/port-agent/README.md | 61 +++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/charts/port-agent/README.md b/charts/port-agent/README.md index 0c87545..2d675fa 100644 --- a/charts/port-agent/README.md +++ b/charts/port-agent/README.md @@ -8,7 +8,7 @@ This chart installs the Port Agent via a `Deployment` resource. ## Usage -[Helm](https://helm.sh) must be installed to use the charts. Please refer to +[Helm](https://helm.sh) must be installed to use the charts. Please refer to Helm's [documentation](https://helm.sh/docs) to get started. Once Helm has been set up correctly, add the repo as follows: @@ -16,10 +16,10 @@ Once Helm has been set up correctly, add the repo as follows: helm repo add port-labs https://port-labs.github.io/helm-charts If you had already added this repo earlier, run `helm repo update` to retrieve -the latest versions of the packages. You can then run `helm search repo +the latest versions of the packages. You can then run `helm search repo port-labs` to see the charts. -Then, install the chart. +Then, install the chart. For example, to use the `KafkaToWebhookStreamer` Streamer, use the following command: helm install my-port-agent port-labs/port-agent \ @@ -42,33 +42,34 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configuration parameters of the `port-agent` chart and default values. -| Parameter | Description | Default | -|------------------------------------------------------|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `image.repository` | Image repository | `ghcr.io/port-labs/port-agent` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.tag` | Image tag | `""` | -| `imagePullSecrets` | Image pull secrets | `[]` | -| `nameOverride` | Chart name override | `""` | -| `fullnameOverride` | Fully qualified app name override | `""` | -| `secret.annotations` | Annotations for Secret object | `{}` | -| `secret.name` | Secret object name | `""` | -| `secret.useExistingSecret` | Enable this if you wish to create your own secret with credentials | `false` | -| `env.normal.STREAMER_NAME` | Streamer name, one of: [`KafkaToWebhookStreamer`] - **Required** | `"KafkaToWebhookStreamer"` | -| `env.normal.PORT_ORG_ID` | Your Port org id - **Required** | `""` | -| `env.normal.KAFKA_CONSUMER_GROUP_ID` | Kafka consumer group id - **Required if using any Kafka streamer** | `""` | -| `env.normal.KAFKA_CONSUMER_BROKERS` | Kafka consumer brokers | `"b-1-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-2-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-3-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196"` | -| `env.normal.KAFKA_CONSUMER_SECURITY_PROTOCOL` | Kafka consumer security protocol | `"SASL_SSL"` | -| `env.normal.KAFKA_CONSUMER_AUTHENTICATION_MECHANISM` | Kafka consumer authentication mechanism | `"SCRAM-SHA-512"` | -| `env.normal.KAFKA_CONSUMER_AUTO_OFFSET_RESET` | Kafka consumer auto offset reset | `"largest"` | -| `env.secret.KAFKA_CONSUMER_USERNAME` | Kafka Username - **Required if using any Kafka streamer** | `""` | -| `env.secret.KAFKA_CONSUMER_PASSWORD` | Kafka Password - **Required if using any Kafka streamer** | `""` | -| `podAnnotations` | Annotations to be added to the pod | `{}` | -| `podSecurityContext` | Security context applied to the pod | `{}` | -| `securityContext` | Security context applied to the container | `{}` | -| `resources` | Container resource requests & limits | `{}` | -| `nodeSelector` | NodeSelector applied to the pod | `{}` | -| `tolerations` | Tolerations applied to the pod | `[]` | -| `affinity` | Affinity applied to the pod | `{}` | +| Parameter | Description | Default | +|------------------------------------------------------|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `image.repository` | Image repository | `ghcr.io/port-labs/port-agent` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.tag` | Image tag | `""` | +| `imagePullSecrets` | Image pull secrets | `[]` | +| `nameOverride` | Chart name override | `""` | +| `fullnameOverride` | Fully qualified app name override | `""` | +| `secret.annotations` | Annotations for Secret object | `{}` | +| `secret.name` | Secret object name | `""` | +| `secret.useExistingSecret` | Enable this if you wish to create your own secret with credentials | `false` | +| `env.normal.STREAMER_NAME` | Streamer name, one of: [`KafkaToWebhookStreamer`] - **Required** | `"KafkaToWebhookStreamer"` | +| `env.normal.PORT_ORG_ID` | Your Port org id - **Required** | `""` | +| `env.normal.KAFKA_CONSUMER_GROUP_ID` | Kafka consumer group id - **Required if using any Kafka streamer** | `""` | +| `env.normal.KAFKA_CONSUMER_BROKERS` | Kafka consumer brokers | `"b-1-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-2-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196,b-3-public.publicclusterprod.t9rw6w.c1.kafka.eu-west-1.amazonaws.com:9196"` | +| `env.normal.KAFKA_CONSUMER_SECURITY_PROTOCOL` | Kafka consumer security protocol | `"SASL_SSL"` | +| `env.normal.KAFKA_CONSUMER_AUTHENTICATION_MECHANISM` | Kafka consumer authentication mechanism | `"SCRAM-SHA-512"` | +| `env.normal.KAFKA_CONSUMER_AUTO_OFFSET_RESET` | Kafka consumer auto offset reset | `"largest"` | +| `env.secret.KAFKA_CONSUMER_USERNAME` | Kafka Username - **Required if using any Kafka streamer** | `""` | +| `env.secret.KAFKA_CONSUMER_PASSWORD` | Kafka Password - **Required if using any Kafka streamer** | `""` | +| `controlThePayloadConfig` | Override the default control the payload configuration file with custom json configuration | `""` | +| `podAnnotations` | Annotations to be added to the pod | `{}` | +| `podSecurityContext` | Security context applied to the pod | `{}` | +| `securityContext` | Security context applied to the container | `{}` | +| `resources` | Container resource requests & limits | `{}` | +| `nodeSelector` | NodeSelector applied to the pod | `{}` | +| `tolerations` | Tolerations applied to the pod | `[]` | +| `affinity` | Affinity applied to the pod | `{}` | To override values in `helm install`, use either the `--set` flag or the `--set-file` flag to set individual values from a file.