| # If port is unnamed or port name doesn't follow <protocol>[-<suffix>], the analyzer will report warning. |
| # If the service is in system namespace, i.e., kube-system, dubbo-system, kube-public, the check will be skipped. |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: my-service1 |
| namespace: kube-system # Skipped because it's in a kube system namespace |
| spec: |
| selector: |
| app: my-service1 |
| ports: |
| - protocol: TCP |
| port: 8080 |
| targetPort: 8080 |
| - protocol: TCP |
| port: 8081 |
| targetPort: 8081 |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: my-service2 # Skipped because it has an istio: label |
| namespace: dubbo-system |
| labels: |
| istio: xxx |
| spec: |
| selector: |
| app: my-service2 |
| ports: |
| - name: foo |
| protocol: TCP |
| port: 8080 |
| targetPort: 8080 |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: my-service3 # Skipped because it's in a kube system namespace |
| namespace: kube-public |
| spec: |
| selector: |
| app: my-service3 |
| ports: |
| - name: bar |
| protocol: TCP |
| port: 8080 |
| targetPort: 8080 |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: my-service4 # Skipped because of the release:istio label |
| namespace: dubbo-system |
| labels: |
| release: istio |
| spec: |
| selector: |
| app: my-service4 |
| ports: |
| - name: foo |
| protocol: TCP |
| port: 8080 |
| targetPort: 8080 |