-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp-http.yaml
115 lines (112 loc) · 2.09 KB
/
app-http.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
107
108
109
110
111
112
113
114
115
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nginx
spec:
selector:
matchLabels:
run: test-nginx
replicas: 1
template:
metadata:
labels:
run: test-nginx
spec:
containers:
- name: test-nginx
image: nginx
ports:
- containerPort: 8080
volumeMounts:
- name: test-nginx-config
mountPath: /etc/nginx
readOnly: true
- name: test-nginx-cert
mountPath: /etc/nginx-server-certs
readOnly: true
volumes:
- name: test-nginx-config
configMap:
name: test-nginx-configmap
- name: test-nginx-cert
secret:
secretName: test-nginx-cert
---
apiVersion: v1
kind: ConfigMap
metadata:
name: test-nginx-configmap
data:
nginx.conf: |
events {
}
http {
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
server {
listen 8080;
root /usr/share/nginx/html;
index index.html;
}
}
---
apiVersion: v1
kind: Service
metadata:
name: test-nginx
labels:
run: test-nginx
spec:
ports:
- port: 8080
protocol: TCP
selector:
run: test-nginx
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test-nginx
spec:
hosts:
- test.i.foltz.io
gateways:
- test-nginx
http:
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 8080
host: test-nginx
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: test-nginx
spec:
selector:
tier: internal
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- test.i.foltz.io
tls:
httpsRedirect: true
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- test.i.foltz.io
tls:
mode: SIMPLE
credentialName: test-nginx-cert