From e9b150f71029870d3b71e5079d01265b37a95c77 Mon Sep 17 00:00:00 2001 From: aktoboy Date: Sat, 25 Nov 2023 16:23:55 +0530 Subject: [PATCH 1/4] Added flags to control service deployment --- charts/akto-setup/templates/deployment.yaml | 7 ++++++- charts/akto-setup/values.yaml | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/akto-setup/templates/deployment.yaml b/charts/akto-setup/templates/deployment.yaml index b98b172..d889b16 100644 --- a/charts/akto-setup/templates/deployment.yaml +++ b/charts/akto-setup/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{ if .Values.dashboard.aktoApiSecurityDashboard.env.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -70,7 +71,9 @@ spec: ports: - containerPort: 8080 resources: {{- toYaml .Values.dashboard.aktoApiSecurityDashboard.resources | nindent 10 }} +{{ end }} --- +{{ if .Values.testing.aktoApiSecurityTesting.env.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -136,7 +139,9 @@ spec: name: akto-api-security-testing resources: {{- toYaml .Values.testing.aktoApiSecurityTesting.resources | nindent 10 }} restartPolicy: Always +{{ end }} --- +{{ if .Values.runtime.aktoApiSecurityRuntime.env.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -270,7 +275,7 @@ spec: - containerPort: 9999 resources: {{- toYaml .Values.runtime.kafka1.resources | nindent 10 }} restartPolicy: Always - +{{ end }} --- apiVersion: apps/v1 kind: Deployment diff --git a/charts/akto-setup/values.yaml b/charts/akto-setup/values.yaml index f6faaf5..0d46a4b 100644 --- a/charts/akto-setup/values.yaml +++ b/charts/akto-setup/values.yaml @@ -15,6 +15,7 @@ dashboard: aktoTrafficBatchSize: "100" aktoTrafficBatchTimeSecs: "10" puppeteerReplayServiceUrl: http://akto-puppeteer-replay:3000 + enabled: true image: repository: public.ecr.aws/aktosecurity/akto-api-security-dashboard tag: latest @@ -47,6 +48,7 @@ runtime: aktoTrafficBatchTimeSecs: "10" puppeteerReplayServiceUrl: http://akto-puppeteer-replay:3000 useHostName: true + enabled: true image: repository: public.ecr.aws/aktosecurity/akto-api-security-runtime tag: latest @@ -122,6 +124,7 @@ testing: aktoTrafficBatchSize: "100" aktoTrafficBatchTimeSecs: "10" puppeteerReplayServiceUrl: http://akto-puppeteer-replay:3000 + enabled: true image: repository: public.ecr.aws/aktosecurity/akto-api-testing tag: latest From bfc88ecdf351b1d6d0d20210a77f9467c06917bd Mon Sep 17 00:00:00 2001 From: aktoboy Date: Sat, 25 Nov 2023 18:14:00 +0530 Subject: [PATCH 2/4] Added keel, and fixed services to honour the flags --- charts/akto-setup/templates/dashboard.yaml | 4 +++- charts/akto-setup/templates/deployment.yaml | 4 +++- charts/akto-setup/templates/hpa.yaml | 4 +++- charts/akto-setup/templates/keel-rbac-binding.yaml | 4 +++- charts/akto-setup/templates/keel-rbac.yaml | 2 ++ charts/akto-setup/templates/keel.yaml | 2 ++ charts/akto-setup/templates/runtime.yaml | 2 ++ charts/akto-setup/templates/serviceaccount.yaml | 4 +++- charts/akto-setup/values.yaml | 1 + 9 files changed, 22 insertions(+), 5 deletions(-) diff --git a/charts/akto-setup/templates/dashboard.yaml b/charts/akto-setup/templates/dashboard.yaml index 2d2d096..6657635 100644 --- a/charts/akto-setup/templates/dashboard.yaml +++ b/charts/akto-setup/templates/dashboard.yaml @@ -1,3 +1,4 @@ +{{ if .Values.dashboard.aktoApiSecurityDashboard.env.enabled }} apiVersion: v1 kind: Service metadata: @@ -12,4 +13,5 @@ spec: app: {{ include "akto.fullname" . }}-dashboard {{- include "akto.selectorLabels" . | nindent 4 }} ports: - {{- .Values.dashboard.ports | toYaml | nindent 2 -}} \ No newline at end of file + {{- .Values.dashboard.ports | toYaml | nindent 2 -}} +{{ end }} \ No newline at end of file diff --git a/charts/akto-setup/templates/deployment.yaml b/charts/akto-setup/templates/deployment.yaml index d889b16..847ad7a 100644 --- a/charts/akto-setup/templates/deployment.yaml +++ b/charts/akto-setup/templates/deployment.yaml @@ -277,6 +277,7 @@ spec: restartPolicy: Always {{ end }} --- +{{ if .Values.keel.keel.env.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -345,4 +346,5 @@ spec: ports: - containerPort: 9300 resources: {{- toYaml .Values.keel.keel.resources | nindent 10 }} - serviceAccountName: {{ include "akto.fullname" . }}-keel \ No newline at end of file + serviceAccountName: {{ include "akto.fullname" . }}-keel +{{ end }} \ No newline at end of file diff --git a/charts/akto-setup/templates/hpa.yaml b/charts/akto-setup/templates/hpa.yaml index 7ac0a98..b7c86d9 100644 --- a/charts/akto-setup/templates/hpa.yaml +++ b/charts/akto-setup/templates/hpa.yaml @@ -1,3 +1,4 @@ +{{ if .Values.runtime.aktoApiSecurityRuntime.env.enabled }} apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: @@ -11,4 +12,5 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "akto.fullname" . }}-runtime - targetCPUUtilizationPercentage: 80 \ No newline at end of file + targetCPUUtilizationPercentage: 80 +{{ end }} \ No newline at end of file diff --git a/charts/akto-setup/templates/keel-rbac-binding.yaml b/charts/akto-setup/templates/keel-rbac-binding.yaml index 297ed81..8056db6 100644 --- a/charts/akto-setup/templates/keel-rbac-binding.yaml +++ b/charts/akto-setup/templates/keel-rbac-binding.yaml @@ -1,3 +1,4 @@ +{{ if .Values.keel.keel.env.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -11,4 +12,5 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "akto.fullname" . }}-keel' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file + namespace: '{{ .Release.Namespace }}' +{{ end }} \ No newline at end of file diff --git a/charts/akto-setup/templates/keel-rbac.yaml b/charts/akto-setup/templates/keel-rbac.yaml index 79a88b1..2d55899 100644 --- a/charts/akto-setup/templates/keel-rbac.yaml +++ b/charts/akto-setup/templates/keel-rbac.yaml @@ -1,3 +1,4 @@ +{{ if .Values.keel.keel.env.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -49,3 +50,4 @@ rules: - get - create - update +{{ end }} diff --git a/charts/akto-setup/templates/keel.yaml b/charts/akto-setup/templates/keel.yaml index 8b2d67e..76f8f09 100644 --- a/charts/akto-setup/templates/keel.yaml +++ b/charts/akto-setup/templates/keel.yaml @@ -1,3 +1,4 @@ +{{ if .Values.keel.keel.env.enabled }} apiVersion: v1 kind: Service metadata: @@ -12,3 +13,4 @@ spec: {{- include "akto.selectorLabels" . | nindent 4 }} ports: {{- .Values.keel.ports | toYaml | nindent 2 -}} +{{ end }} diff --git a/charts/akto-setup/templates/runtime.yaml b/charts/akto-setup/templates/runtime.yaml index 23c871c..bf2f79f 100644 --- a/charts/akto-setup/templates/runtime.yaml +++ b/charts/akto-setup/templates/runtime.yaml @@ -1,3 +1,4 @@ +{{ if .Values.runtime.aktoApiSecurityRuntime.env.enabled }} apiVersion: v1 kind: Service metadata: @@ -11,3 +12,4 @@ spec: {{- include "akto.selectorLabels" . | nindent 4 }} ports: {{- .Values.runtime.ports | toYaml | nindent 2 -}} +{{ end }} diff --git a/charts/akto-setup/templates/serviceaccount.yaml b/charts/akto-setup/templates/serviceaccount.yaml index 208ca25..765baa0 100644 --- a/charts/akto-setup/templates/serviceaccount.yaml +++ b/charts/akto-setup/templates/serviceaccount.yaml @@ -1,3 +1,4 @@ +{{ if .Values.keel.keel.env.enabled }} apiVersion: v1 kind: ServiceAccount metadata: @@ -6,4 +7,5 @@ metadata: app: {{ include "akto.fullname" . }}-keel {{- include "akto.labels" . | nindent 4 }} annotations: - {{- toYaml .Values.keel.serviceAccount.annotations | nindent 4 }} \ No newline at end of file + {{- toYaml .Values.keel.serviceAccount.annotations | nindent 4 }} +{{ end }} \ No newline at end of file diff --git a/charts/akto-setup/values.yaml b/charts/akto-setup/values.yaml index 0d46a4b..5effe32 100644 --- a/charts/akto-setup/values.yaml +++ b/charts/akto-setup/values.yaml @@ -154,6 +154,7 @@ keel: mattermostEndpoint: "" notificationLevel: info webhookEndpoint: "" + enabled: true image: repository: keelhq/keel tag: latest From 50c3f7c81f8fd0126ccdb70469b1928c80a026e8 Mon Sep 17 00:00:00 2001 From: aktoboy Date: Mon, 27 Nov 2023 15:19:57 +0530 Subject: [PATCH 3/4] Removed flag from dashboard.yaml file --- charts/akto-setup/templates/dashboard.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/akto-setup/templates/dashboard.yaml b/charts/akto-setup/templates/dashboard.yaml index 6657635..2d2d096 100644 --- a/charts/akto-setup/templates/dashboard.yaml +++ b/charts/akto-setup/templates/dashboard.yaml @@ -1,4 +1,3 @@ -{{ if .Values.dashboard.aktoApiSecurityDashboard.env.enabled }} apiVersion: v1 kind: Service metadata: @@ -13,5 +12,4 @@ spec: app: {{ include "akto.fullname" . }}-dashboard {{- include "akto.selectorLabels" . | nindent 4 }} ports: - {{- .Values.dashboard.ports | toYaml | nindent 2 -}} -{{ end }} \ No newline at end of file + {{- .Values.dashboard.ports | toYaml | nindent 2 -}} \ No newline at end of file From 397d907b8da8ca1e98d23e2bdb2dca488d9db6e9 Mon Sep 17 00:00:00 2001 From: aktoboy Date: Mon, 27 Nov 2023 15:24:07 +0530 Subject: [PATCH 4/4] Revert "Removed flag from dashboard.yaml file" This reverts commit 50c3f7c81f8fd0126ccdb70469b1928c80a026e8. --- charts/akto-setup/templates/dashboard.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/akto-setup/templates/dashboard.yaml b/charts/akto-setup/templates/dashboard.yaml index 2d2d096..6657635 100644 --- a/charts/akto-setup/templates/dashboard.yaml +++ b/charts/akto-setup/templates/dashboard.yaml @@ -1,3 +1,4 @@ +{{ if .Values.dashboard.aktoApiSecurityDashboard.env.enabled }} apiVersion: v1 kind: Service metadata: @@ -12,4 +13,5 @@ spec: app: {{ include "akto.fullname" . }}-dashboard {{- include "akto.selectorLabels" . | nindent 4 }} ports: - {{- .Values.dashboard.ports | toYaml | nindent 2 -}} \ No newline at end of file + {{- .Values.dashboard.ports | toYaml | nindent 2 -}} +{{ end }} \ No newline at end of file