DeploymentConflictingPorts

Message NameDeploymentConflictingPorts
Message CodeIST0137
DescriptionTwo services selecting the same workload with the same targetPort MUST refer to the same port.
LevelWarning

This message occurs when two services select the same workload with the same targetPort but different ports.

An example

Consider an Istio mesh with the following services:

  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: nginx-a
  5. spec:
  6. ports:
  7. - port: 8080
  8. protocol: TCP
  9. targetPort: 80
  10. selector:
  11. app: nginx
  12. ---
  13. apiVersion: v1
  14. kind: Service
  15. metadata:
  16. name: nginx-b
  17. spec:
  18. ports:
  19. - port: 80
  20. protocol: TCP
  21. targetPort: 80
  22. selector:
  23. app: nginx

In this example, service nginx-a and service nginx-b select the same workload nginx with the same targetPort but different ports.

How to resolve

This may be fixed in one of two ways:

  • Make both services use the same port. This will require reconfiguring the clients of one of the services to connect to a different port.
  • Make both services use different targetPorts. This will require configuring the workload pods of one of the services to listen on the same targetPort as the other service.