-
Notifications
You must be signed in to change notification settings - Fork 2
/
ingress.yaml
106 lines (106 loc) · 2.61 KB
/
ingress.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# The ingress block is used to route requests using path prefix strings. The downstream
# example uses the protoc file package name and then followed by the name of the service
# from the same protoc file with a dot seperator, a gRPC standard. The trailing /.* is Istio
# version specific to 0.7.1 and is being changed on a regular basis, it indicates prefix based
# matching but will change in the future to using a Gateway approach, please read
# https://istio.io/docs/tasks/traffic-management/ingress.html
#
# URL paths for formed in gRPC using '[package].[service]/[method]'. gRPC documentation
# on the topic can be found at, https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
#
# The empty prefix is used to allow the default route to the experiment service
# so that reflection, and health checking is defaulted to it.
#
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: ingress-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
tls:
httpsRedirect: true
- port:
number: 443
name: grpc
protocol: HTTPS
hosts:
- "*"
tls:
mode: SIMPLE
credentialName: "platform-services-tls-cert"
---
apiVersion: security.istio.io/v1beta1
kind: RequestAuthentication
metadata:
name: experiment-auth-policy
namespace: istio-system
spec:
selector:
matchLabels:
istio: ingressgateway
jwtRules:
- issuer: "https://cognizant-ai.auth0.com/"
jwksUri: "https://cognizant-ai.auth0.com/.well-known/jwks.json"
audiences:
- "http://api.cognizant-ai.dev/experimentsrv"
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: require-jwt
spec:
selector:
matchLabels:
app: experiment
action: ALLOW
rules:
- from:
- source:
requestPrincipals: ["https://cognizant-ai.auth0.com//auth0|5dd5df076288170d281d4a09"]
---
apiVersion: "security.istio.io/v1beta1"
kind: "PeerAuthentication"
metadata:
name: "default"
spec:
mtls:
mode: STRICT
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: auth0-egress
spec:
hosts:
- "cognizant-ai.auth0.com"
ports:
- number: 443
name: https
protocol: HTTPS
- number: 80
name: http
protocol: HTTP
resolution: DNS
location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: honeycomb-egress
spec:
hosts:
- "api.honeycomb.io"
ports:
- number: 443
name: https
protocol: HTTPS
resolution: DNS
location: MESH_EXTERNAL