Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev-bridge

server PC의 로컬 포트를 client PC의 localhost:<port>로 연결하는 개발용 bridge입니다.

지원 mode:

  • ssh: OpenSSH remote/local forwarding을 사용합니다. 성능 우선 모드입니다.
  • kubernetes / k8s: K8s frps relay pod와 Kubernetes API port-forward를 사용합니다.

SSH config

mode: ssh
ssh:
  host: dev-bastion        # ~/.ssh/config Host alias 또는 hostname
  user: evan               # optional, ssh config에 있으면 생략 가능
  configFile: ~/.ssh/config # optional
  identity: ~/.ssh/id_ed25519 # optional
  passwordCommand: op read item/dev/password # optional, requires sshpass
  remoteBind: 127.0.0.1    # optional, SSH 서버에서 열 bind address
  localBind: 127.0.0.1     # optional, client PC에서 열 bind address
ports:
  - name: frontend
    localPort: 5173
    remotePort: 5173       # optional, 생략하면 localPort와 동일
localIP: 127.0.0.1

SSH mode 흐름:

server PC: bridge server config.yaml
  -> ssh -R remotePort:localIP:localPort

client PC: bridge client config.yaml
  -> ssh -L localPort:remoteBind:remotePort

Kubernetes config

mode: kubernetes
namespace: dev-bridge-demo
ports:
  - name: vite
    localPort: 5173
  - name: hello
    localPort: 54321
kubeconfig: ""
controlPort: 7000
localIP: 127.0.0.1

Kubernetes mode 흐름:

server/client -> Kubernetes API port-forward -> frps pod

Run

go build -o bridge ./cmd/bridge
./bridge server config.yaml

다른 머신에서 같은 config로 client를 실행합니다.

./bridge client config.yaml

Kubernetes mode에서 server를 Ctrl-C로 종료하면 생성한 namespace를 삭제합니다.

Requirements

  • SSH mode: ssh executable, 접근 가능한 SSH host
  • Kubernetes mode: K8s API 접근 가능한 kubeconfig

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages