From eca177c09fd6f89ab341c51efda4440d2c24d865 Mon Sep 17 00:00:00 2001 From: Johannes Schnatterer Date: Thu, 5 Nov 2020 16:19:10 +0100 Subject: [PATCH] Service: Refer to targetPort name. It's not enough to use the same name for targetPort in pod and port in service. If targetPort field is empty in service, it defaults to the same value as port. --- k8s/production/service.yaml | 5 +++-- k8s/staging/service.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/k8s/production/service.yaml b/k8s/production/service.yaml index 8735376e2..e86d0620a 100644 --- a/k8s/production/service.yaml +++ b/k8s/production/service.yaml @@ -8,7 +8,8 @@ metadata: spec: type: LoadBalancer ports: - - port: 9094 - name: http + - name: http + port: 9094 + targetPort: http selector: app: spring-petclinic-plain diff --git a/k8s/staging/service.yaml b/k8s/staging/service.yaml index 4b8922055..fb7ad6ba4 100644 --- a/k8s/staging/service.yaml +++ b/k8s/staging/service.yaml @@ -8,7 +8,8 @@ metadata: spec: type: LoadBalancer ports: - - port: 9093 - name: http + - name: http + port: 9093 + targetPort: http selector: app: spring-petclinic-plain