To do an experiment, just use virtual service without binding to gateway
Access only between internal services
Through the following yaml file configuration, it was found that virtual service did not take effect at the time of access
Kubernetes Version 1.14.0
Istio Version 1.2.6
Access within the service is: curl nginx.test.svc.cluster.local:9090 Output page with nginx content
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-v1
namespace: test
labels:
version: v1
app: nginx
spec:
selector:
matchLabels:
app: nginx
version: v1
replicas: 1
template:
metadata:
labels:
app: nginx
version: v1
spec:
containers:
- name: nginx
image: nginx:v4
ports:
- containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: nginx
namespace: test
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 9090
targetPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx
namespace: test
spec:
hosts:
- nginx.test.svc.cluster.local
http:
- match:
- port: 9090
route:
- destination:
host: nginx.test.svc.cluster.local
port:
number: 9090
fault:
abort:
httpStatus: 204
percent: 100