使用kubernetes的ftp服务器无法正常工作

bsteve

我有几个星期的ftps-filezilla和Kubernetes问题。

语境

我有一个使用Kubernetes和ftps的学校项目。我需要在端口21的kubernetes中创建一个ftps服务器,并且它需要在高山linux上运行。因此,我使用docker容器创建了ftps-alpine服务器的映像。我对其进行测试(如果它自己可以正常运行):使用docker run --name test-alpine -itp 21:21 test_alpine我在filezilla中具有以下输出:

    Status: Connecting to 192.168.99.100:21…
    Status: Connection established, waiting for welcome message…
    Status: Initializing TLS…
    Status: Verifying certificate…
    Status: TLS connection established.
    Status: Logged in
    Status: Retrieving directory listing…
    Status: Calculating timezone offset of server…
    Status: Timezone offset of server is 0 seconds.
    Status: Directory listing of “/” successful

它工作成功,filezilla看到了我现在对我的ftps目录中的文件好(在活动模式下工作)。

问题

所以我想要的是在kubernetes集群中使用我的图像(我使用Minikube)。当我将docker映像连接到kubernetes中的ingress-service-deployment时,我有:

    Status: Connecting to 192.168.99.100:30894…
    Status: Connection established, waiting for welcome message…
    Status: Initializing TLS…
    Status: Verifying certificate…
    Status: TLS connection established.
    Status: Logged in
    Status: Retrieving directory listing…
    Command:    PWD
    Response:   257 “/” is the current directory
    Command:    TYPE I
    Response:   200 Switching to Binary mode.
    Command:    PORT 192,168,99,1,227,247
    Response:   500 Illegal PORT command.
    Command:    PASV
    Response:   227 Entering Passive Mode (172,17,0,5,117,69).
    Command:    LIST
    Error:  The data connection could not be established: EHOSTUNREACH - No route to host
    Error:  Connection timed out after 20 seconds of inactivity
    Error:  Failed to retrieve directory listing

设置


ingress.yaml :

    kind: Ingress
    metadata:
    annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    namespace: default
    name: ingress-controller
    spec:
    backend:
    serviceName: my-nginx
    servicePort: 80
    backend:
    serviceName: ftps-alpine
    servicePort: 21

ftps-alpine.yml :

    apiVersion: v1
    kind: Service
    metadata:
    name: ftps-alpine
    labels:
    run: ftps-alpine
    spec:
    type: NodePort
    ports:

    port: 21
    targetPort: 21
    protocol: TCP
    name: ftp21
    port: 20
    targetPort: 20
    protocol: TCP
    name: ftp20
    selector:
    run: ftps-alpine
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: ftps-alpine
    spec:
    selector:
    matchLabels:
    run: ftps-alpine
    replicas: 1
    template:
    metadata:
    labels:
    run: ftps-alpine
    spec:
    - name: ftps-alpine
    image: test_alpine
    imagePullPolicy: Never
    ports:
    - containerPort: 21
    - containerPort: 20

我尝试了什么

  • 当我看到错误消息:错误:无法建立数据连接:EHOSTUNREACH-主机没有路由google它,我看到此消息:FTP处于被动模式:EHOSTUNREACH-主机没有路由而且我已经在主动模式下运行我的ftps服务器。
  • 更改vsftpd.conf文件和我的服务:
vsftpd.conf :

    seccomp_sandbox=NO
    pasv_promiscuous=NO
    listen=NO
    listen_ipv6=YES
    anonymous_enable=NO
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    use_localtime=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    chroot_local_user=YES
    #secure_chroot_dir=/vsftpd/empty
    pam_service_name=vsftpd
    pasv_enable=YES
    pasv_min_port=30020
    pasv_max_port=30021
    user_sub_token=$USER
    local_root=/home/$USER/ftp
    userlist_enable=YES
    userlist_file=/etc/vsftpd.userlist
    userlist_deny=NO
    rsa_cert_file=/etc/ssl/private/vsftpd.pem
    rsa_private_key_file=/etc/ssl/private/vsftpd.pem
    ssl_enable=YES
    allow_anon_ssl=NO
    force_local_data_ssl=YES
    force_local_logins_ssl=YES
    ssl_tlsv1=YES
    ssl_sslv2=NO
    ssl_sslv3=NO
    allow_writeable_chroot=YES
    #listen_port=21

我确实将我的kubernetes的节点端口更改为30020和30021,并将它们添加到了容器端口。我更改了pasv最小端口和最大端口。我添加了我的minikube ip的pasv_adress。没事。

问题

除了kubernetes集群外,如何获得成功的第一条消息?

如果您有任何疑问要澄清,那就没问题。

更新

多亏了coderanger,我已经进步了,这里有这个问题:

Status: Connecting to 192.168.99.100:30894...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory
Command:    TYPE I
Response:   200 Switching to Binary mode.
Command:    PASV
Response:   227 Entering Passive Mode (192,168,99,100,178,35).
Command:    LIST
Error:  The data connection could not be established: ECONNREFUSED - Connection refused by server
bsteve

它适用于以下更改:

apiVersion: v1
    kind: Service
    metadata:
      name: ftps-alpine
      labels:
        run: ftps-alpine
    spec:
      type: NodePort
      ports:
      - port: 21
        targetPort: 21
        nodePort: 30025
        protocol: TCP
        name: ftp21
      - port: 20
        targetPort: 20
        protocol: TCP
        nodePort: 30026
        name: ftp20
      - port: 30020
        targetPort: 30020
        nodePort: 30020
        protocol: TCP
        name: ftp30020
      - port: 30021
        targetPort: 30021
        nodePort: 30021
        protocol: TCP
        name: ftp30021
      selector:
        run: ftps-alpine
    ---

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: ftps-alpine
    spec:
      selector:
        matchLabels:
          run: ftps-alpine
      replicas: 1
      template:
        metadata:
          labels:
            run: ftps-alpine
        spec:
          containers:
          - name: ftps-alpine
            image: test_alpine
            imagePullPolicy: Never
            ports:
            - containerPort: 21
            - containerPort: 20
            - containerPort: 30020
            - containerPort: 30021

对于vsftpd.conf:

seccomp_sandbox=NO
pasv_promiscuous=NO
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
#secure_chroot_dir=/vsftpd/empty
pam_service_name=vsftpd
pasv_enable=YES
pasv_min_port=30020
pasv_max_port=30021
user_sub_token=$USER
local_root=/home/$USER/ftp
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
allow_writeable_chroot=YES
#listen_port=21
pasv_address=#minikube_ip#

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

palapa Web服务器中的phpMyAdmin无法正常工作

来自分类Dev

WAMP服务器,本地主机无法正常工作

来自分类Dev

闪亮服务器上的rpivotTable无法正常工作

来自分类Dev

Java Web服务器src无法正常工作

来自分类Dev

PHP自助服务器无法正常工作

来自分类Dev

字体很棒,服务器无法正常工作

来自分类Dev

WAMP服务器在Windows 10上无法正常工作

来自分类Dev

Thymeleaf服务器相对URL无法正常工作

来自分类Dev

Java HTTP服务器无法正常工作

来自分类Dev

SSH服务器无法正常工作(重生直到停止)

来自分类Dev

DHCP3-服务器无法正常工作

来自分类Dev

Cronjob无法正常工作的Ubuntu服务器

来自分类Dev

服务器上的Laravel 4安装无法正常工作

来自分类Dev

简单的Java服务器无法正常工作

来自分类Dev

闪亮服务器上的rpivotTable无法正常工作

来自分类Dev

Python服务器守护程序无法正常工作

来自分类Dev

简单的网络服务器无法正常工作

来自分类Dev

Ubuntu上的pptpd服务器-Netflix无法正常工作

来自分类Dev

Rails服务器无法正常工作的Rails 4.2.6

来自分类Dev

PHP(Web服务器)调用Java无法正常工作

来自分类Dev

WebSocket服务器由于某些原因无法正常工作

来自分类Dev

无法注册到文本安全服务器正常工作

来自分类Dev

nginx代理无法正常工作的服务器块

来自分类Dev

php exec()在Linux服务器上无法正常工作

来自分类Dev

Android & NodeMCU,从服务器接收响应无法正常工作?

来自分类Dev

使用 volley 将数据发布到服务器时,JobService 无法正常工作

来自分类Dev

jsfiddle与活动服务器上的代码(活动服务器上的代码无法正常工作)

来自分类Dev

无法解决/的WAMP服务器索引(服务器工作正常,只是布局)

来自分类Dev

phpmailer在本地主机上工作正常,但在服务器上无法正常工作

Related 相关文章

  1. 1

    palapa Web服务器中的phpMyAdmin无法正常工作

  2. 2

    WAMP服务器,本地主机无法正常工作

  3. 3

    闪亮服务器上的rpivotTable无法正常工作

  4. 4

    Java Web服务器src无法正常工作

  5. 5

    PHP自助服务器无法正常工作

  6. 6

    字体很棒,服务器无法正常工作

  7. 7

    WAMP服务器在Windows 10上无法正常工作

  8. 8

    Thymeleaf服务器相对URL无法正常工作

  9. 9

    Java HTTP服务器无法正常工作

  10. 10

    SSH服务器无法正常工作(重生直到停止)

  11. 11

    DHCP3-服务器无法正常工作

  12. 12

    Cronjob无法正常工作的Ubuntu服务器

  13. 13

    服务器上的Laravel 4安装无法正常工作

  14. 14

    简单的Java服务器无法正常工作

  15. 15

    闪亮服务器上的rpivotTable无法正常工作

  16. 16

    Python服务器守护程序无法正常工作

  17. 17

    简单的网络服务器无法正常工作

  18. 18

    Ubuntu上的pptpd服务器-Netflix无法正常工作

  19. 19

    Rails服务器无法正常工作的Rails 4.2.6

  20. 20

    PHP(Web服务器)调用Java无法正常工作

  21. 21

    WebSocket服务器由于某些原因无法正常工作

  22. 22

    无法注册到文本安全服务器正常工作

  23. 23

    nginx代理无法正常工作的服务器块

  24. 24

    php exec()在Linux服务器上无法正常工作

  25. 25

    Android & NodeMCU,从服务器接收响应无法正常工作?

  26. 26

    使用 volley 将数据发布到服务器时,JobService 无法正常工作

  27. 27

    jsfiddle与活动服务器上的代码(活动服务器上的代码无法正常工作)

  28. 28

    无法解决/的WAMP服务器索引(服务器工作正常,只是布局)

  29. 29

    phpmailer在本地主机上工作正常,但在服务器上无法正常工作

热门标签

归档