The SFTP server is inaccessible when exposed using a LoadBalancer Service,
Below is the deployment file for SFTP in AWS EKS using the atmoz/sftp Dockerfile.
apiVersion: apps/v1
kind: Deployment
metadata:
name: sftp-server
spec:
replicas: 1
selector:
matchLabels:
app: sftp
template:
metadata:
labels:
app: sftp
spec:
containers:
- name: sftp
image: atmoz/sftp
ports:
- containerPort: 22
volumeMounts:
- name: persistent-storage
mountPath: /upload
- name: config-volume
mountPath: /etc/sftp/
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: {pvc-name}
- configMap:
items:
- key: users.conf
path: users.conf
name: user-config
name: config-volume
My service is like
apiVersion: v1
kind: Service
metadata:
name: sftp-service
spec:
type: LoadBalancer
selector:
app: sftp
ports:
- protocol: TCP
port: 22
targetPort: 22
I’ve checked user(name: test) created correctly through configmap, and loadbalancer also created
If I tried to access through sftp sftp test@{Loadbalancer IP}
, it returns connection timeout
Is there other configuration do I need to fix?
I’ve allowed 22 port on the security group of node instances but still had same error,
also checked loadbalancer’s security group but it already allowed 22 port.
FYI: With above yml files, aws created application-loadbalancer (Do I need to specify loadbalancer type?)