-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yml
170 lines (160 loc) · 4.02 KB
/
deployment.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
kind: ConfigMap
apiVersion: v1
metadata:
name: httpsftp-config
namespace: namespace-name
data:
default.conf: |
log_format vhost '$http_x_forwarded_for - $remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent"';
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
access_log /var/log/nginx/access.log vhost;
real_ip_header X-Forwarded-For;
location ~* \.php$ {
try_files $uri =404;
fastcgi_intercept_errors on;
fastcgi_pass site-php:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: httpsftp
namespace: namespace-name
spec:
selector:
matchLabels:
service: httpsftp
replicas: 1
template:
metadata:
labels:
service: httpsftp
spec:
containers:
- name: httpsftp
image: nginx:latest
ports:
- name: "main"
containerPort: 80
volumeMounts:
- name: httpsftp-config
mountPath: "/etc/nginx/conf.d/default.conf"
subPath: default.conf
- name: httpsftp-data
mountPath: "/usr/share/nginx/html"
volumes:
- name: httpsftp-config
configMap:
name: httpsftp-config
- name: httpsftp-data
hostPath:
path: "/cluster/storage/namespace-name/httpsftp/data/namespace-name/httpsftp"
type: "DirectoryOrCreate"
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: httpsftp-ftp
namespace: namespace-name
spec:
selector:
matchLabels:
service: httpsftp-ftp
replicas: 1
template:
metadata:
labels:
service: httpsftp-ftp
spec:
containers:
- name: httpsftp-ftp
image: atmoz/sftp:alpine
volumeMounts:
- name: httpsftp-ftp-data
mountPath: "/home"
- name: httpsftp-ftp-users
mountPath: "/etc/sftp/users.conf"
readOnly: true
- name: httpsftp-ftp-key-ed25519
mountPath: "/etc/ssh/ssh_host_ed25519_key"
readOnly: true
- name: httpsftp-ftp-key-rsa
mountPath: "/etc/ssh/ssh_host_rsa_key"
readOnly: true
volumes:
- name: httpsftp-ftp-data
hostPath:
path: "/cluster/storage/namespace-name/httpsftp/data"
type: "DirectoryOrCreate"
- name: httpsftp-ftp-users
hostPath:
path: "/cluster/namespace-name/httpsftp/config/users.conf"
type: "File"
- name: httpsftp-ftp-key-ed25519
hostPath:
path: "/cluster/namespace-name/httpsftp/config/keys/ssh_host_ed25519_key"
type: "File"
- name: httpsftp-ftp-key-rsa
hostPath:
path: "/cluster/namespace-name/httpsftp/config/keys/ssh_host_rsa_key"
type: "File"
---
kind: Service
apiVersion: v1
metadata:
name: httpsftp
namespace: namespace-name
spec:
selector:
service: httpsftp
ports:
- name: "main"
protocol: TCP
port: 80
---
kind: Service
apiVersion: v1
metadata:
name: httpsftp-ftp
namespace: namespace-name
spec:
type: NodePort
selector:
service: httpsftp-ftp
ports:
- name: "main"
port: 22
targetPort: 22
nodePort: 35063
protocol: TCP
---
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
name: httpsftp
namespace: namespace-name
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.passHostHeader: "true"
spec:
rules:
- host: httpsftp.namespace-name.domain.tld
http:
paths:
- path: /
backend:
serviceName: httpsftp
servicePort: main