TIS0601 - Port Name Must Follow the 'protocol'[-suffix]
Format
The port name must follow the 'protocol'[-suffix]
format.
For clarity and proper traffic routing, always name service ports following the 'protocol'[-suffix]
format, where protocol
is a recognized value such as http
, https
, tcp
, etc. For available protocol values, refer to the Istio Protocol Selection documentation.
While Istio can automatically detect HTTP and HTTP/2 traffic, explicitly naming ports is recommended to ensure clearer configuration and is required for certain protocols. If the protocol cannot automatically be determined, traffic will be treated as plain TCP traffic.
Examples
-
Service Port Name Not Following Required Format
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: example-namespace
spec:
ports:
- port: 80
name: web
- port: 443
name: frontend
- port: 3306
name: databaseExplanation: While HTTP traffic will work through auto-detection, the port names don't follow the expected format. For HTTPS and MySQL, this configuration may cause connectivity issues.
Recommendation
Rename the service port name to follow the required format for proper traffic flow.
-
Correct the Port Name to Follow Format
Update the port name to follow the required
'protocol'[-suffix]
format, whereprotocol
is a valid protocol such ashttp
,https
,tcp
, etc.apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: example-namespace
spec:
ports:
- port: 80
name: http-web # Changed from 'web' to 'http-web' for HTTP protocol
- port: 443
name: https-frontend # Changed from 'frontend' to 'https-frontend' for HTTPS protocol
- port: 3306
name: mysql-db # Changed from 'database' to 'mysql-db' for MySQL protocolExplanation: The port names follow the
protocol[-suffix]
format, enabling proper protocol handling for all traffic types. This ensures proper behavior for traffic management and application policies.