IMLC.ME
Search…
en-US
How to install frp client in Kubernetes
frp is a common tool that used to set up HTTP or TCP tunnel between 2 networks. A usual use case is set up a tunnel between home server and public server so that you can access your internal service on the Internet.
This page assumes that: 1. Your frp server is openning at "frps.example.com" 2. You have a Kubernetes Service names "demo-service", you can access it via "demo-service:8080" inside the cluster

Create frpc.ini

1
[common]
2
server_addr = frps.example.com
3
server_port = 7000
4
5
[demo-service]
6
type = tcp
7
local_ip = demo-service
8
local_port = 8080
9
remote_port = 8080
Copied!

Create Kubernetes Secret

1
kubectl create secret generic frpc-config --from-file=./frpc.ini
Copied!

Deploy frpc Container

1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: frpc
5
labels:
6
app: frpc
7
spec:
8
replicas: 1
9
selector:
10
matchLabels:
11
app: frpc
12
template:
13
metadata:
14
labels:
15
app: frpc
16
spec:
17
containers:
18
- name: frpc
19
image: snowdreamtech/frpc
20
volumeMounts:
21
- name: config
22
mountPath: "/etc/frp"
23
readOnly: true
24
volumes:
25
- name: config
26
secret:
27
secretName: frpc-config
Copied!
  1. 1.
    snowdreamtech/frpc loads frpc configuration file in /etc/frp/frpc.ini by default
  2. 2.
    We save frpc.ini as a secret becase generally we put authentication token in it
Last modified 1yr ago