-
Notifications
You must be signed in to change notification settings - Fork 0
/
ftp.yaml
96 lines (94 loc) · 2.11 KB
/
ftp.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: ftp
namespace: middleware
spec:
replicas: 1
selector:
matchLabels:
app: ftp
template:
metadata:
labels:
app: ftp
spec:
volumes:
- name: ftp-data
hostPath:
path: /data/ftp/
containers:
- name: ftp-container
image: fauria/vsftpd
ports:
- containerPort: 31110
protocol: TCP
- containerPort: 31111
protocol: TCP
- containerPort: 31112
protocol: TCP
- containerPort: 31113
protocol: TCP
- containerPort: 31114
protocol: TCP
- containerPort: 31115
protocol: TCP
- containerPort: 21
protocol: TCP
volumeMounts:
- mountPath: "/home/vsftpd"
name: ftp-data
env:
- name: FTP_USER
value: "ftpuser"
- name: FTP_PASS
value: "W9pM7%#6K!Yb"
# 随机最大端口与最小端口,要与上面设置的匹配
- name: PASV_MIN_PORT
value: "31110"
- name: PASV_MAX_PORT
value: "31115"
- name: PASV_ENABLE
value: "yes"
# 服务器传回的IP地址,一般为对外公网地址,即客户端连接ftp所用的地址。
- name: PASV_ADDRESS
value: "172.20.50.81"
#- name: PASV_ADDRESS
# valueFrom:
# fieldRef:
# fieldPath: status.hostIP
---
apiVersion: v1
kind: Service
metadata:
name: ftp-service
labels:
app: ftp-service
namespace: middleware
spec:
type: NodePort
# 除21端口映射外,其他端口需保持一致
ports:
- name: ftp-21
nodePort: 30021
port: 21
- name: ftp-31110
nodePort: 31110
port: 31110
- name: ftp-31111
nodePort: 31111
port: 31111
- name: ftp-31112
nodePort: 31112
port: 31112
- name: ftp-31113
nodePort: 31113
port: 31113
- name: ftp-31114
nodePort: 31114
port: 31114
- name: ftp-31115
nodePort: 31115
port: 31115
selector:
app: ftp