From 065befd7033ecafea3b0b2bb932f0ff82b65a080 Mon Sep 17 00:00:00 2001 From: Roman Minebaev Date: Tue, 24 Jun 2025 15:14:13 +0400 Subject: [PATCH 1/3] helm-chart --- containers/helm/Chart.yaml | 4 +- containers/helm/templates/deployment.yaml | 28 ++++++------ containers/helm/templates/service.yaml | 3 +- containers/helm/values.yaml | 56 +++++++++++++++++------ 4 files changed, 59 insertions(+), 32 deletions(-) diff --git a/containers/helm/Chart.yaml b/containers/helm/Chart.yaml index 0b09c041b99..403449f600e 100644 --- a/containers/helm/Chart.yaml +++ b/containers/helm/Chart.yaml @@ -16,13 +16,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.37.9" +appVersion: "1.58.0" maintainers: - name: pglombardo diff --git a/containers/helm/templates/deployment.yaml b/containers/helm/templates/deployment.yaml index a63973fbc87..9dd15d334d7 100644 --- a/containers/helm/templates/deployment.yaml +++ b/containers/helm/templates/deployment.yaml @@ -2,10 +2,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "helm.fullname" . }} - namespace: {{ .Values.namespace }} labels: {{- include "helm.labels" . | nindent 4 }} - {{- range $k, $v := .Values.deployment.labels }} + {{- range $k, $v := .Values.labels }} {{ $k }}: {{ $v | quote }} {{- end }} spec: @@ -21,8 +20,8 @@ spec: {{- end }} labels: {{- include "helm.selectorLabels" . | nindent 8 }} - {{- range $k, $v := .Values.deployment.labels }} - {{ $k }}: {{ $v | quote }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} {{- end }} spec: securityContext: @@ -33,19 +32,18 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} ports: - name: http - containerPort: {{ .Values.deployment.containerPort }} + containerPort: {{ .Values.service.port }} protocol: TCP - {{- if .Values.deployment.livenessProbe.enabled }} livenessProbe: - httpGet: - path: {{ .Values.deployment.livenessProbe.path }} - port: http - {{- end }} - {{- if .Values.deployment.readinessProbe.enabled }} + {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: - httpGet: - path: {{ .Values.deployment.readinessProbe.path }} - port: http - {{- end }} + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/containers/helm/templates/service.yaml b/containers/helm/templates/service.yaml index 1a18221af35..fde9f0f15ad 100644 --- a/containers/helm/templates/service.yaml +++ b/containers/helm/templates/service.yaml @@ -2,10 +2,9 @@ apiVersion: v1 kind: Service metadata: name: {{ include "helm.fullname" . }} - namespace: {{ .Values.namespace }} labels: {{- include "helm.labels" . | nindent 4 }} - {{- range $k, $v := .Values.deployment.labels }} + {{- range $k, $v := .Values.labels }} {{ $k }}: {{ $v | quote }} {{- end }} spec: diff --git a/containers/helm/values.yaml b/containers/helm/values.yaml index 329c22aae8b..527ccb2db1f 100644 --- a/containers/helm/values.yaml +++ b/containers/helm/values.yaml @@ -3,25 +3,55 @@ nameOverride: "" fullnameOverride: "" replicaCount: 1 -deployment: - labels: - app: "pwpush" - # component: ingress-controller - # type: nginx - containerPort: 5100 - readinessProbe: - enabled: true - path: / - livenessProbe: - enabled: true - path: / - image: repository: docker.io/pglombardo/pwpush pullPolicy: Always tag: "release" +labels: + app: "pwpush" +podLabels: + app: "pwpush" + +env: + PWP__ENABLE_LOGINS: true + # PWP__ENABLE_FILE_PUSHES: true + # PWP__FILES__STORAGE: local + +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + service: type: ClusterIP port: 5100 sessionAffinity: None + +ingress: + enabled: true + className: "nginx" + annotations: {} + # kubernetes.io/ingress.class: nginx + # cert-manager.io/cluster-issuer: cluster-issuer + hosts: + - host: pwpush.example.com + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: pwpush-tls + # hosts: + # - pwpush.example.com From 548a35e97b328d41edaccf9eb38798c7d6eba534 Mon Sep 17 00:00:00 2001 From: Roman Minebaev Date: Tue, 24 Jun 2025 15:19:35 +0400 Subject: [PATCH 2/3] fix --- containers/helm/templates/ingress.yaml | 46 ++++++++++++++++++++++++++ containers/helm/values.yaml | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 containers/helm/templates/ingress.yaml diff --git a/containers/helm/templates/ingress.yaml b/containers/helm/templates/ingress.yaml new file mode 100644 index 00000000000..c6f9ea5d7ba --- /dev/null +++ b/containers/helm/templates/ingress.yaml @@ -0,0 +1,46 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "helm.fullname" . }} + labels: + {{- include "helm.labels" . | nindent 4 }} + {{- range $k, $v := .Values.labels }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "helm.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/containers/helm/values.yaml b/containers/helm/values.yaml index 527ccb2db1f..cfff77313ff 100644 --- a/containers/helm/values.yaml +++ b/containers/helm/values.yaml @@ -41,7 +41,7 @@ service: sessionAffinity: None ingress: - enabled: true + enabled: false className: "nginx" annotations: {} # kubernetes.io/ingress.class: nginx From 430ae137490ba7a0f37fe806074fe2e85253ae33 Mon Sep 17 00:00:00 2001 From: Roman Minebaev Date: Thu, 3 Jul 2025 16:33:28 +0400 Subject: [PATCH 3/3] fix env --- containers/helm/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/helm/values.yaml b/containers/helm/values.yaml index cfff77313ff..8101a5663d4 100644 --- a/containers/helm/values.yaml +++ b/containers/helm/values.yaml @@ -13,8 +13,8 @@ labels: podLabels: app: "pwpush" -env: - PWP__ENABLE_LOGINS: true +env: {} + # PWP__ENABLE_LOGINS: true # PWP__ENABLE_FILE_PUSHES: true # PWP__FILES__STORAGE: local