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

ServiceEntry allows short names in hosts, but pilot does not #13436

Closed
GregHanson opened this issue Apr 18, 2019 · 3 comments

Comments

2 participants
@GregHanson
Copy link
Member

commented Apr 18, 2019

Bug description
Validation logic in ServiceEntry.Hosts allows shortnames, but pilot is silently ignoring ServiceEntries defined with a non-FQDN name

sample rules:

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: rabbitmq
spec:
  hosts:
  - rabbitmq.com
  addresses:
  - XX.XXX.XX.XX
  ports:
  - number: 5673
    name: tcp-5673
    protocol: TCP
  resolution: NONE
  location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: rabbitmq
spec:
  hosts:
  - rabbitmq
  ports:
  - number: 5673
    name: tcp-5673
    protocol: TCP
  endpoints:
  - address: "rabbit1.com"
    ports:
      tcp-5673: 5677
  resolution: DNS
  location: MESH_EXTERNAL

Both rules are accepted by the validation plugin but pilot silently complaining about the non-FQDN names with only a message logged at the Info level.

$ kubectl logs -n istio-system istio-pilot-5b7d5696f-htn9c discovery | grep rabbit
2019-04-18T21:16:42.298081Z	info	parseHostname(rabbitmq) => error missing service name and namespace from the service hostname "rabbitmq"

checking the config_dumps of sidecars show non of the corresponding configs get pushed for rabbit:

$ kubectl exec httpbin-54f5bb4957-7nkbh -c istio-proxy -- curl -is localhost:15000/config_dump | grep rabbit
Gregorys-MBP:istio gihanson$

Expected behavior
Invalid rules should notify user at the creation step

Version (include the output of istioctl version --remote and kubectl version)
1.1.3

@hzxuzhonghu

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Oh, this is just a info, for k8s registry this will fail. But for external service registry, it will not.

@hzxuzhonghu

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

@GregHanson

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

shortnames now make it to sidecar in config_dump, closing

@GregHanson GregHanson closed this Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.