From 9c4c0369b7138b14dbc8c71d03620c89ebecb744 Mon Sep 17 00:00:00 2001 From: David Wickstrom Date: Tue, 30 Jul 2024 15:27:21 -0400 Subject: [PATCH 1/2] update to use service port and support docker registry semver --- charts/generic-service/templates/imagepolicy.yaml | 11 ++++++++++- charts/generic-service/templates/preexisting-lb.yaml | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/charts/generic-service/templates/imagepolicy.yaml b/charts/generic-service/templates/imagepolicy.yaml index 438ec1c..18455e9 100644 --- a/charts/generic-service/templates/imagepolicy.yaml +++ b/charts/generic-service/templates/imagepolicy.yaml @@ -23,12 +23,21 @@ metadata: name: {{ $.Release.Namespace }}-{{ $value.name }} namespace: flux-system spec: + {{- if not (or (empty $value.imagepolicy.repositoryType) (eq $value.imagepolicy.repositoryType "ecr")) }} filterTags: extract: $ts pattern: {{ $value.imagepolicy.pattern }} + {{- end }} imageRepositoryRef: name: {{ $.Values.project | replace "_" "-" }} + {{- if and $value.imagepolicy.repositoryType (eq $value.imagepolicy.repositoryType "docker") }} + policy: + semver: + range: {{ $value.imagepolicy.semverRange }} + {{- else }} policy: numerical: order: asc -{{- end -}} + {{- end }} + {{- end }} + \ No newline at end of file diff --git a/charts/generic-service/templates/preexisting-lb.yaml b/charts/generic-service/templates/preexisting-lb.yaml index 4172000..d351b7f 100644 --- a/charts/generic-service/templates/preexisting-lb.yaml +++ b/charts/generic-service/templates/preexisting-lb.yaml @@ -15,7 +15,7 @@ spec: ports: - name: http targetPort: {{ $value.port }} # Port that the container listens on - port: {{ $value.port }} # Port that the service listens on + port: {{ $value.servicePort | default 80 }} # Port that the service listens on selector: app.kubernetes.io/name: {{ $value.name }} app.kubernetes.io/component: web @@ -29,7 +29,7 @@ metadata: spec: serviceRef: name: {{ $value.name }}-service # route traffic to the created service - port: {{ $value.port }} + port: {{ $value.servicePort | default 80 }} targetGroupARN: {{ $value.loadBalancer.targetGroupARN }} networking: ingress: From 02cb6203c173d7748190c5b81098bee89614467b Mon Sep 17 00:00:00 2001 From: David Wickstrom Date: Tue, 30 Jul 2024 15:29:09 -0400 Subject: [PATCH 2/2] update chart version --- charts/generic-service/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/generic-service/Chart.yaml b/charts/generic-service/Chart.yaml index 55a70fb..c2f2123 100644 --- a/charts/generic-service/Chart.yaml +++ b/charts/generic-service/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: generic-service description: A Helm chart for Kubernetes -version: 1.1.3 +version: 1.1.4 dependencies: - name: memcached version: 6.6.x