-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s.yml
130 lines (117 loc) · 3.08 KB
/
k8s.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
kind: ConfigMap
apiVersion: v1
metadata:
name: awtrix
data:
default.conf: |
upstream awtrix {
server 127.0.0.1:7000;
}
server {
listen 80;
server_name _;
gzip on;
auth_basic "Restricted";
auth_basic_user_file conf.d/.htpasswd;
location / {
proxy_redirect off;
proxy_pass http://awtrix;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
.htpasswd: |
admin:YAf9KBvtmzUh6
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: awtrix
spec:
selector:
matchLabels:
app: awtrix
template:
metadata:
labels:
app: awtrix
spec:
terminationGracePeriodSeconds: 5
containers:
- name: awtrix
image: registry.cn-hangzhou.aliyuncs.com/l1b0k/awtrix
imagePullPolicy: IfNotPresent
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: date
mountPath: /etc/localtime
readOnly: true
- name: nginx
image: nginx:1.19.7
imagePullPolicy: IfNotPresent
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: configvolume
mountPath: /etc/nginx/conf.d/
readOnly: true
volumes:
- name: configvolume
configMap:
name: awtrix
items:
- key: default.conf
path: default.conf
- key: .htpasswd
path: .htpasswd
- name: date
hostPath:
path: /etc/localtime
type: File
---
apiVersion: v1
kind: Service
metadata:
name: awtrix
spec:
selector:
app: awtrix
type: LoadBalancer
ports:
- name: port80
protocol: TCP
port: 80
targetPort: 80
- name: port7001
protocol: TCP
port: 7001
targetPort: 7001