From cd71863853236cfcc36b4406e1d88431fcc909a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bibron?= Date: Tue, 30 Jan 2024 17:28:35 +0100 Subject: [PATCH 1/3] fix: Documentation updated for targetPort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Bibron --- charts/mercure/README.md | 1 + charts/mercure/templates/deployment.yaml | 4 ++-- charts/mercure/templates/service.yaml | 2 +- charts/mercure/values.yaml | 18 ++++++++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/charts/mercure/README.md b/charts/mercure/README.md index 4d2924c0..f77c62de 100644 --- a/charts/mercure/README.md +++ b/charts/mercure/README.md @@ -50,6 +50,7 @@ To install the chart with the release name `my-release`, run the following comma | securityContext | object | `{}` | Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. | | service.annotations | object | `{}` | | | service.port | int | `80` | Service port. | +| service.targetPort | int | `80` | Service target port. | | service.type | string | `"ClusterIP"` | Kubernetes [service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types). | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account. | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created. | diff --git a/charts/mercure/templates/deployment.yaml b/charts/mercure/templates/deployment.yaml index 99e685aa..ed81283b 100644 --- a/charts/mercure/templates/deployment.yaml +++ b/charts/mercure/templates/deployment.yaml @@ -41,7 +41,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: SERVER_NAME - value: :80 + value: :{{ .Values.service.targetPort }} - name: GLOBAL_OPTIONS valueFrom: configMapKeyRef: @@ -94,7 +94,7 @@ spec: {{- end }} ports: - name: http - containerPort: 80 + containerPort: {{ .Values.service.targetPort }} protocol: TCP livenessProbe: httpGet: diff --git a/charts/mercure/templates/service.yaml b/charts/mercure/templates/service.yaml index 11779a9b..2490f8b3 100644 --- a/charts/mercure/templates/service.yaml +++ b/charts/mercure/templates/service.yaml @@ -13,7 +13,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: http + targetPort: {{ .Values.service.targetPort }} protocol: TCP name: http selector: diff --git a/charts/mercure/values.yaml b/charts/mercure/values.yaml index 6d9161f8..6e8edae1 100644 --- a/charts/mercure/values.yaml +++ b/charts/mercure/values.yaml @@ -58,12 +58,14 @@ podAnnotations: {} # -- Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 # -- Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -76,6 +78,8 @@ service: type: ClusterIP # -- Service port. port: 80 + # -- Service target port. + targetPort: 80 annotations: {} ingress: @@ -84,7 +88,8 @@ ingress: # -- Ingress [class name](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class). className: "" # -- Annotations to be added to the ingress. - annotations: {} + annotations: + {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" # -- Ingress host configuration. @@ -92,8 +97,8 @@ ingress: hosts: - host: mercure-example.local paths: - - path: / - pathType: ImplementationSpecific + - path: / + pathType: ImplementationSpecific # -- Ingress TLS configuration. # @default -- See [values.yaml](values.yaml). tls: [] @@ -104,7 +109,8 @@ ingress: # -- Container resource [requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources) for details. # @default -- No requests or limits. -resources: {} +resources: + {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following From 23e62663bdfa7ae2fb8a5127f8180bd9a894e790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bibron?= Date: Tue, 30 Jan 2024 17:30:21 +0100 Subject: [PATCH 2/3] fix: fix linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Bibron --- charts/mercure/values.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/charts/mercure/values.yaml b/charts/mercure/values.yaml index 6e8edae1..9f4688e9 100644 --- a/charts/mercure/values.yaml +++ b/charts/mercure/values.yaml @@ -88,8 +88,7 @@ ingress: # -- Ingress [class name](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class). className: "" # -- Annotations to be added to the ingress. - annotations: - {} + annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" # -- Ingress host configuration. @@ -97,8 +96,8 @@ ingress: hosts: - host: mercure-example.local paths: - - path: / - pathType: ImplementationSpecific + - path: / + pathType: ImplementationSpecific # -- Ingress TLS configuration. # @default -- See [values.yaml](values.yaml). tls: [] @@ -109,8 +108,7 @@ ingress: # -- Container resource [requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources) for details. # @default -- No requests or limits. -resources: - {} +resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following From c1534e9fbaf7878473e64712cb9310733a3674c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bibron?= Date: Tue, 30 Jan 2024 17:30:49 +0100 Subject: [PATCH 3/3] fix: fix linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Bibron --- charts/mercure/values.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/mercure/values.yaml b/charts/mercure/values.yaml index 9f4688e9..bfdacc68 100644 --- a/charts/mercure/values.yaml +++ b/charts/mercure/values.yaml @@ -58,14 +58,12 @@ podAnnotations: {} # -- Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. -podSecurityContext: - {} +podSecurityContext: {} # fsGroup: 2000 # -- Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. -securityContext: - {} +securityContext: {} # capabilities: # drop: # - ALL