109 lines
1.8 KiB
YAML
109 lines
1.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: testapp-api
|
|
labels:
|
|
app: testapp-api
|
|
version: v1
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: testapp-api
|
|
version: v1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: testapp-api
|
|
version: v1
|
|
spec:
|
|
containers:
|
|
- name: testapp-api
|
|
image: 127.0.0.1:5000/testapp/api:v1
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: testapp-api
|
|
labels:
|
|
app: testapp-api
|
|
spec:
|
|
ports:
|
|
- port: 8080
|
|
name: http
|
|
selector:
|
|
app: testapp-api
|
|
---
|
|
apiVersion: networking.istio.io/v1alpha3
|
|
kind: ServiceEntry
|
|
metadata:
|
|
name: httpbin
|
|
spec:
|
|
hosts:
|
|
- httpbin.org
|
|
ports:
|
|
- number: 80
|
|
name: http-port
|
|
protocol: HTTP
|
|
resolution: DNS
|
|
location: MESH_EXTERNAL
|
|
---
|
|
apiVersion: networking.istio.io/v1alpha3
|
|
kind: Gateway
|
|
metadata:
|
|
name: httpbin
|
|
spec:
|
|
selector:
|
|
istio: egressgateway
|
|
servers:
|
|
- port:
|
|
number: 80
|
|
name: http
|
|
protocol: HTTP
|
|
hosts:
|
|
- httpbin.org
|
|
---
|
|
apiVersion: networking.istio.io/v1alpha3
|
|
kind: DestinationRule
|
|
metadata:
|
|
name: httpbin
|
|
spec:
|
|
host: istio-egressgateway.istio-system.svc.cluster.local
|
|
subsets:
|
|
- name: httpbin
|
|
---
|
|
apiVersion: networking.istio.io/v1alpha3
|
|
kind: VirtualService
|
|
metadata:
|
|
name: httpbin-egress
|
|
spec:
|
|
hosts:
|
|
- httpbin.org
|
|
gateways:
|
|
- httpbin
|
|
- mesh
|
|
http:
|
|
- match:
|
|
- gateways:
|
|
- mesh
|
|
port: 80
|
|
route:
|
|
- destination:
|
|
host: istio-egressgateway.istio-system.svc.cluster.local
|
|
subset: httpbin
|
|
port:
|
|
number: 80
|
|
weight: 100
|
|
- match:
|
|
- gateways:
|
|
- httpbin
|
|
port: 80
|
|
route:
|
|
- destination:
|
|
host: httpbin.org
|
|
port:
|
|
number: 80
|
|
weight: 100
|