kops icon indicating copy to clipboard operation
kops copied to clipboard

FTP

Open anupam4881 opened this issue 8 years ago • 7 comments

Dear All,

looking for your help to fix this bug.

From containers we are able to login remote FTP server however listing & others command is not working, same is working from the base machine where these containers are running.

From base machine : yes FTP command are working From containers running on base machine : only login but ftp commands not working

1. What kops version are you running? The command kops version, will display this information. [root@ip-10-226-0-178 ~]# kops version Version 1.7.1 (git-c69b811) [root@ip-10-226-0-178 ~]#

2. What Kubernetes version are you running? kubectl version will print the version if a cluster is running or provide the Kubernetes version specified as a kops flag.

[root@ip-10-226-0-178 ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:48:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:30:51Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} [root@ip-10-226-0-178 ~]#

3. What cloud provider are you using?

AWS 4. What commands did you run? What is the simplest way to reproduce this issue? From container : ftp 10.226.0.173 ( FTP server on )

5. What happened after the commands executed? ls command is not showing any list of files & folders 6. What did you expect to happen?

It should list all files & folder of FTP server same as it is showing from base machine on which these containers running.

7. Please provide your cluster manifest. Execute kops get --name my.example.com -o yaml to display your cluster manifest. You may want to remove your cluster name and other sensitive information. [root@ip-10-226-0-178 ~]# kops get --name altcluster.k8s.local -o yaml apiVersion: kops/v1alpha2 kind: Cluster metadata: creationTimestamp: 2017-11-07T12:02:05Z name: altcluster.k8s.local spec: api: loadBalancer: type: Public authorization: alwaysAllow: {} channel: stable cloudProvider: aws configBase: s3://kops-kubernetes-cluster-state/altcluster.k8s.local etcdClusters:

  • etcdMembers:
    • instanceGroup: master-ap-south-1a-1 name: a-1
    • instanceGroup: master-ap-south-1b-1 name: b-1
    • instanceGroup: master-ap-south-1a-2 name: a-2 name: main
  • etcdMembers:
    • instanceGroup: master-ap-south-1a-1 name: a-1
    • instanceGroup: master-ap-south-1b-1 name: b-1
    • instanceGroup: master-ap-south-1a-2 name: a-2 name: events kubernetesApiAccess:
  • 0.0.0.0/0 kubernetesVersion: 1.7.4 masterPublicName: api.altcluster.k8s.local networkCIDR: 172.20.0.0/16 networking: weave: mtu: 8912 nonMasqueradeCIDR: 100.64.0.0/10 sshAccess:
  • 0.0.0.0/0 subnets:
  • cidr: 172.20.32.0/19 name: ap-south-1a type: Private zone: ap-south-1a
  • cidr: 172.20.64.0/19 name: ap-south-1b type: Private zone: ap-south-1b
  • cidr: 172.20.0.0/22 name: utility-ap-south-1a type: Utility zone: ap-south-1a
  • cidr: 172.20.4.0/22 name: utility-ap-south-1b type: Utility zone: ap-south-1b topology: dns: type: Public masters: private nodes: private

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-09-27T11:24:45Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altcommon spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: r4.2xlarge maxSize: 6 minSize: 1 nodeLabels: common: MC2 name: altcommon role: Node subnets:

  • ap-south-1a
  • ap-south-1b

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-09-21T07:04:36Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altmobile spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: r4.2xlarge maxSize: 6 minSize: 1 nodeLabels: common: MC1 name: altmobile role: Node subnets:

  • ap-south-1a
  • ap-south-1b

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-06-29T09:23:16Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altrecruit spec: cloudLabels: team: me image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: t2.small maxSize: 6 minSize: 1 nodeLabels: name: altrecruit role: Node subnets:

  • ap-south-1a
  • ap-south-1b

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-07-27T11:51:15Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altworklife spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: t2.small maxSize: 6 minSize: 1 nodeLabels: name: altworklife role: Node subnets:

  • ap-south-1a
  • ap-south-1b

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2017-11-07T12:02:05Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: master-ap-south-1a-1 spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2017-07-28 machineType: m4.xlarge maxSize: 1 minSize: 1 role: Master subnets:

  • ap-south-1a

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2017-11-07T12:02:05Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: master-ap-south-1a-2 spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2017-07-28 machineType: m4.xlarge maxSize: 1 minSize: 1 role: Master subnets:

  • ap-south-1a

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2017-11-07T12:02:05Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: master-ap-south-1b-1 spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2017-07-28 machineType: m4.xlarge maxSize: 1 minSize: 1 role: Master subnets:

  • ap-south-1b

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2017-11-07T12:02:05Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: nodes spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2017-07-28 machineType: t2.large maxSize: 5 minSize: 3 role: Node subnets:

  • ap-south-1a
  • ap-south-1b

8. Please run the commands with most verbose logging by adding the -v 10 flag. Paste the logs into this report, or in a gist and provide the gist link here.

9. Anything else do we need to know?

FTP server is on another VPC.

Regards Anupam Narayan

anupam4881 avatar Oct 01 '18 09:10 anupam4881

So you're trying to FTP from within a pod in your cluster to a FTP server outside the cluster?

huang-jy avatar Oct 03 '18 08:10 huang-jy

Yes : trying to FTP from within a pod in your cluster to a FTP server outside the cluster

anupam4881 avatar Oct 04 '18 03:10 anupam4881

Are you using PASV (Passive Mode FTP)?

huang-jy avatar Oct 04 '18 09:10 huang-jy

Case-1": From container

it seems enter in passive mode log as below & listing not coming

[root@alt-mobile-3616774890-vppqb jboss]# ftp 10.226.0.X 21 Connected to 10.226.0.X (10.226.0.X). 220-FileZilla Server 0.9.56 beta 220-written by Tim Kosse ([email protected]) 220 Please visit https://filezilla-project.org/ Name (10.226.0.X:root): FTPUSER 331 Password required for FTPUSER Password: XYZ 230 Logged on Remote system type is UNIX. ftp> ls 227 Entering Passive Mode (10,226,0,173,186,67) ftp: connect: Connection timed out ftp>

Case-2": From same base machine where container runs --Successful

root@ip-172-20-90-83:~# ftp 10.226.0.X 21 Connected to 10.226.0.X. 220-FileZilla Server 0.9.56 beta 220-written by Tim Kosse ([email protected]) 220 Please visit https://filezilla-project.org/ Name (10.226.0.X:admin): FTPUSER 331 Password required for FTPUSER Password: XYZ 230 Logged on Remote system type is UNIX. ftp> ls 200 Port command successful 150 Opening data channel for directory listing of "/" drwxr-xr-x 1 ftp ftp 0 Oct 01 12:32 data drwxr-xr-x 1 ftp ftp 0 Oct 28 2017 implement 226 Successfully transferred "/" ftp>

anupam4881 avatar Oct 04 '18 09:10 anupam4881

227 Entering Passive Mode (10,226,0,173,186,67)

This implies your pod is attempting to connect to 10.226.0.173:47683

Since this looks like your FTP server is local to your network, you need to check that server is allowing traffic from your pod.

Also, your local case isn't using passive it seems, as there's no "Entering Passive Mode" line.

huang-jy avatar Oct 04 '18 09:10 huang-jy

After getting idea from your last comment we allow all port from VPC for this IP and now it is working file.

Thanks a lot

anupam4881 avatar Oct 05 '18 05:10 anupam4881

@anupam4881 no problem :+1:

huang-jy avatar Oct 05 '18 06:10 huang-jy