Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExternalName Service targetPort is not honored #4508

Closed
ryanelian opened this issue Aug 29, 2019 · 2 comments
Closed

ExternalName Service targetPort is not honored #4508

ryanelian opened this issue Aug 29, 2019 · 2 comments

Comments

@ryanelian
Copy link

ryanelian commented Aug 29, 2019

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.): No

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.): ExternalName Service targetPort


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

NGINX Ingress controller version:

0.25.1

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: UpCloud 2 Core 4 GB
  • OS (e.g. from /etc/os-release):
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
  • Kernel (e.g. uname -a): Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
  • Install tools: kubeadm
  • Others:

What happened:

apiVersion: v1
kind: Service
metadata:
  name: db-cockpit-svc
spec:
  type: ExternalName
  externalName: db.XXX.com
  ports:
  - name: https
    port: 443
    targetPort: 9090

---

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: db-cockpit-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  tls:
  - hosts:
    - db-cockpit.XXX.com
    secretName: XXX-wildcard-letsencrypt-cert
  rules:
  - host: db-cockpit.XXX.com
    http:
      paths:
      - backend:
          serviceName: db-cockpit-svc
          servicePort: 443
2019/08/29 16:19:56 [error] 867#867: *7875658 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XXX.XXX.XXX, server: db-cockpit.XXX.com, request: "GET / HTTP/2.0", upstream: "https://XXX.XXX.XXX.XXX:443/", host: "db-cockpit.XXX.com"

Despite using targetPort: 9090, NGINX ingress still attempts to reach backend server on port 443?!?!?

What you expected to happen:

NGINX should reach backend server on specified targetPort 9090

How to reproduce it (as minimally and precisely as possible):

Use something like above YAML.

Anything else we need to know:

The back-end server is a cockpit server: https://www.sitepoint.com/how-to-install-cockpit-on-ubuntu-18-04/

@aledbf
Copy link
Member

aledbf commented Aug 29, 2019

Closing. This is fixed in master #4449

@aledbf aledbf closed this as completed Aug 29, 2019
@ryanelian
Copy link
Author

Great to hear that! Thank you, can't wait for 0.26.0 to land

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants