From ee25aa5bea22e4a863be909b7650dbf82723958b Mon Sep 17 00:00:00 2001 From: Michel Blanc Date: Sat, 18 Feb 2023 10:34:12 +0100 Subject: [PATCH 1/2] update ingresses change networking.k8s.io/v1beta1 and extensions/v1beta1 to networking.k8s.io/v1 --- cyberchef/templates/ingress.yaml | 3 ++- devopsworks-website/templates/ingress.yaml | 7 ++----- echoip/templates/ingress.yaml | 3 ++- phpsecscan/templates/ingress.yaml | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cyberchef/templates/ingress.yaml b/cyberchef/templates/ingress.yaml index 6283cd9..2f6d4b1 100644 --- a/cyberchef/templates/ingress.yaml +++ b/cyberchef/templates/ingress.yaml @@ -1,7 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "cyberchef.fullname" . -}} {{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} @@ -31,6 +31,7 @@ spec: http: paths: - path: {{ $ingressPath }} + pathType: Prefix backend: serviceName: {{ $fullName }} servicePort: http diff --git a/devopsworks-website/templates/ingress.yaml b/devopsworks-website/templates/ingress.yaml index 7e611cf..d4a0880 100644 --- a/devopsworks-website/templates/ingress.yaml +++ b/devopsworks-website/templates/ingress.yaml @@ -1,11 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "devopsworks-website.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} @@ -33,6 +29,7 @@ spec: paths: {{- range .paths }} - path: {{ . }} + pathType: Prefix backend: serviceName: {{ $fullName }} servicePort: {{ $svcPort }} diff --git a/echoip/templates/ingress.yaml b/echoip/templates/ingress.yaml index adbbd68..6797bd5 100644 --- a/echoip/templates/ingress.yaml +++ b/echoip/templates/ingress.yaml @@ -1,7 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "echoip.fullname" . -}} {{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} @@ -31,6 +31,7 @@ spec: http: paths: - path: {{ $ingressPath }} + pathType: Prefix backend: serviceName: {{ $fullName }} servicePort: http diff --git a/phpsecscan/templates/ingress.yaml b/phpsecscan/templates/ingress.yaml index b87b7a9..91964f4 100644 --- a/phpsecscan/templates/ingress.yaml +++ b/phpsecscan/templates/ingress.yaml @@ -29,6 +29,7 @@ spec: http: paths: - path: {{ $ingressPath }} + pathType: Prefix backend: service: name: {{ $fullName }} From 99f7e8d73789b26f2691850c51497b7760b11507 Mon Sep 17 00:00:00 2001 From: Michel Blanc Date: Sat, 18 Feb 2023 12:58:00 +0100 Subject: [PATCH 2/2] fixes phpsecscan chart --- phpsecscan/Chart.yaml | 4 +- phpsecscan/templates/deployment.yaml | 65 +++++++++++++++------------- phpsecscan/values.yaml | 22 ++++++---- 3 files changed, 49 insertions(+), 42 deletions(-) diff --git a/phpsecscan/Chart.yaml b/phpsecscan/Chart.yaml index ade8644..588df62 100644 --- a/phpsecscan/Chart.yaml +++ b/phpsecscan/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: phpsecscan description: A Helm chart to deploy phpsecscan in Kubernetes type: application -version: 0.0.9 -appVersion: "0.0.9" +version: 0.0.14 +appVersion: "0.0.14" home: https://github.com/devops-works/phpsecscan sources: - https://github.com/devops-works/phpsecscan diff --git a/phpsecscan/templates/deployment.yaml b/phpsecscan/templates/deployment.yaml index 5f51a1e..6b2e2c8 100644 --- a/phpsecscan/templates/deployment.yaml +++ b/phpsecscan/templates/deployment.yaml @@ -1,35 +1,38 @@ +--- apiVersion: apps/v1 kind: Deployment metadata: - annotations: - {{ toYaml .Values.deployment.annotations }} - name: {{ include "phpsecscan.fullname" . }} - labels: - {{- include "phpsecscan.labels" . | nindent 8 }} + name: {{ include "phpsecscan.fullname" . }} + labels: + {{- include "phpsecscan.labels" . | nindent 8 }} +{{- with .Values.deployment.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "phpsecscan.labels" . | nindent 10 }} - template: - metadata: - labels: - app: {{ include "phpsecscan.fullname" . }} - spec: - containers: - - name: {{ include "phpsecscan.fullname" . }} - image: {{ .Values.container.image }} - args: ["-port", "{{ .Values.container.port }}"] - imagePullPolicy: {{ .Values.container.imagePullPolicy }} - resources: -{{ toYaml .Values.resources | indent 20 }} - livenessProbe: - httpGet: - path: {{ .Values.liveness.path }} - port: {{ .Values.container.port }} - initialDelaySeconds: {{ .Values.liveness.initialDelay }} - periodSeconds: {{ .Values.liveness.period }} - ports: - - name: "http" - containerPort: {{ .Values.container.port }} - + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "phpsecscan.labels" . | nindent 10 }} + template: + metadata: + labels: + {{- include "phpsecscan.labels" . | nindent 10 }} + spec: + containers: + - name: {{ include "phpsecscan.fullname" . }} + image: {{ .Values.container.image }} + args: ["-port", "{{ .Values.container.port }}", "-logformat", "json"] + imagePullPolicy: {{ .Values.container.imagePullPolicy }} + ports: + - name: "http" + containerPort: {{ .Values.container.port }} + protocol: TCP + livenessProbe: + httpGet: + path: {{ .Values.liveness.path }} + port: {{ .Values.container.port }} + initialDelaySeconds: {{ .Values.liveness.initialDelay }} + periodSeconds: {{ .Values.liveness.period }} + resources: +{{ toYaml .Values.resources | indent 12 }} diff --git a/phpsecscan/values.yaml b/phpsecscan/values.yaml index 8a688dc..24e5c0d 100644 --- a/phpsecscan/values.yaml +++ b/phpsecscan/values.yaml @@ -1,27 +1,31 @@ name: phpsecscan + replicaCount: 1 + liveness: period: 3 path: /status - initialDelay: 0 + initialDelay: 120 + container: - image: devopsworks/phpsecscan:v0.0.9 + image: devopsworks/phpsecscan:v0.0.14 imagePullPolicy: Always port: 8000 + resources: requests: - memory: "100Mi" - cpu: "200m" + memory: "180Mi" + cpu: "50m" limits: - memory: "150Mi" - cpu: "375m" + memory: "260Mi" + cpu: "150m" nameOverride: "" fullnameOverride: "" -podMonitor: - enabled: false - path: /metrics +podMonitor: + enabled: false + path: /metrics service: type: ClusterIP