From 3596760a12dec2ef80e7b1e7973c82f11d56a671 Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:39:52 +0100 Subject: [PATCH] modify the labels of apache-nas + add ports to container --- apache-nas/Chart.yaml | 2 +- apache-nas/templates/apache-nas-depl.yaml | 12 ++++++++---- apache-nas/templates/apache-nas-svc.yaml | 12 ++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/apache-nas/Chart.yaml b/apache-nas/Chart.yaml index d737638..b063f88 100644 --- a/apache-nas/Chart.yaml +++ b/apache-nas/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: apache-nas description: A Helm chart for deploying a Apache-httpd server type: application -version: 1.2.1 +version: 1.3.0 appVersion: "1.16.0" diff --git a/apache-nas/templates/apache-nas-depl.yaml b/apache-nas/templates/apache-nas-depl.yaml index a664ee6..9d88fdc 100644 --- a/apache-nas/templates/apache-nas-depl.yaml +++ b/apache-nas/templates/apache-nas-depl.yaml @@ -1,18 +1,18 @@ apiVersion: apps/v1 kind: Deployment metadata: + name: {{ include "apache-nas.fullname" . }} labels: - app.kubernetes.io/name: apache-nas - name: apache-nas + {{- include "apache-nas.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: apache-nas + {{- include "apache-nas.selectorLabels" . | nindent 6 }} template: metadata: labels: - app.kubernetes.io/name: apache-nas + {{- include "apache-nas.labels" . | nindent 8 }} spec: containers: - image: {{ .Values.docker_image }} @@ -28,6 +28,10 @@ spec: {{- if .Values.nas.extraVolumeMounts }} {{- .Values.nas.extraVolumeMounts | toYaml | nindent 10 }} {{- end }} + ports: + - name: http + containerPort: 80 + protocol: TCP volumes: - name: apache-nas-data persistentVolumeClaim: diff --git a/apache-nas/templates/apache-nas-svc.yaml b/apache-nas/templates/apache-nas-svc.yaml index 89534f3..64c47e4 100644 --- a/apache-nas/templates/apache-nas-svc.yaml +++ b/apache-nas/templates/apache-nas-svc.yaml @@ -1,10 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: apache-nas-svc + name: {{ include "apache-nas.fullname" . }} + labels: + {{- include "apache-nas.labels" . | nindent 4 }} spec: - selector: - app.kubernetes.io/name: apache-nas ports: - port: 80 - targetPort: 80 + targetPort: http + protocol: TCP + name: http + selector: + {{- include "apache-nas.selectorLabels" . | nindent 4 }}