Kubernetes引擎FTP服务器

Kubernetes引擎FTP服务器

本文介绍了如何通过FileZilla访问Google Kubernetes引擎FTP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个gcePresistentDisk并制作了一个集群并将其挂载.这是yaml文件,由 https://github.com/aledv/kubernetes-ftp :

I created a gcePresistentDisk and made a cluster and mount it.here is the yaml file, which is reference by https://github.com/aledv/kubernetes-ftp :

apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
  name: my-ftp
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: my-ftp
    spec:
      volumes:
      - name: task-pv-storage
        gcePersistentDisk:
          pdName: my-disk
          fsType: ext4
      containers:
      - name: my-ftp-container
        image: fauria/vsftpd
        ports:
        - containerPort: 21
          protocol: TCP
          name: "ftp-server"
        volumeMounts:
        - mountPath: "/home/vsftpd"
          name: task-pv-storage
        env:
        - name: FTP_USER
          value: "user"
        - name: FTP_PASS
          value: "password"

Service.yaml

apiVersion: v1
kind: Service
metadata:
  name: my-ftp-service
  labels:
    app: my-ftp
spec:
  type: LoadBalancer
  ports:
    - port: 21
      nodePort: 30080
  selector:
    app: my-ftp

Ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ftp-ftp-ingress
spec:
  backend:
    serviceName: ftp-ftp-service
    servicePort: 21

,我全部创建了它们.我尝试过

and I created them all.I tried

$kubectl get service rushbit-ftp-service --watch

要获取IP并使用FileZilla,请使用用户名和密码连接IP.我也尝试使用端口30080,但仍然超时.

to get ip and use FileZilla connect the ip with username and password.I also tried port 30080, but still timeout.

我错过了什么吗?

推荐答案

对于遇到此问题的人,您可以尝试以下操作:

For those who encounter the issue,you can try the following:

在Deployment.yaml中,指定被动模式的最小和最大端口范围.

In the deployment.yaml, specify the passive mode min and max port range.

 env:
  - name: PASV_ADDRESS
    value: "127.0.0.1"
  - name: PASV_MIN_PORT
    value: "31100"
  - name: PASV_MAX_PORT
    value: "31101"

然后,在service.yaml中,从Deployment.yaml中指定端口.

Then, in the service.yaml, specify the ports from the deployment.yaml.

ports:
 - name: port1
   port: 21
   nodePort: 30080
 - name: port2
   port: 31100
   nodePort: 31100
 - name: port3
   port: 31101
   nodePort: 31101

通过这种方式,您的FTP客户端应该可以在客户端模式下工作.

In such way, your FTP client should be able to work in client mode.

这篇关于如何通过FileZilla访问Google Kubernetes引擎FTP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 12:58