-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-tcp.yaml
71 lines (71 loc) · 1.37 KB
/
nginx-tcp.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
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx-config: |-
error_log stderr notice;
worker_processes auto;
events {
multi_accept on;
use epoll;
worker_connections 10240;
}
stream {
upstream kube_apiserver {
least_conn;
server 10.230.248.225:6443;
}
server {
listen 0.0.0.0:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 5s;
proxy_buffer_size 64k;
}
}
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: my-nginx
labels:
name: my-nginx
spec:
replicas: 1
selector:
matchLabels:
name: my-nginx
template:
metadata:
labels:
name: my-nginx
spec:
containers:
- image: nginx:1.12.2-alpine
name: my-nginx
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx
volumes:
- name: nginx-config
configMap:
name: nginx-config
items:
- key: nginx-config
path: nginx.conf
---
kind: Service
apiVersion: v1
metadata:
name: my-nginx-service
spec:
selector:
name: my-nginx
ports:
- protocol: TCP
port: 16443
targetPort: 6443
nodePort: 20001
type: NodePort