Closed Faker523 closed 2 months ago
git clone xxx
# select your kubernetes version
# this step must be installed go
bash hack/mod.sh 1.28.12
# build image
docker build -t my-running-haproxy:x .
change haproxy.cfg
change your password here, this is haproxy dataplane need.
userlist haproxy-dataplaneapi
user admin insecure-password 1fc917c7ad66487470e466c0ad40ddd45b9f7730a4b43e1b2542627f0596bbdc
Note the start paramter
/apps/pod-proxier-gateway
--v 5
--jprofiler-port-name=test
# this is map port, you can throght this port access to pod port
--default-map-port=8848
# pod name , just this configration (in deployment spec port name) can be work
--jprofiler-port-name=jprofiler
--resync-time=60
this example is pod mapping, pls change deployment ports section.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: portest
name: portest
namespace: kube-system
spec:
selector:
matchLabels:
app: portest
template:
metadata:
labels:
app: portest
spec:
containers:
- image: nginx:latest
imagePullPolicy: Always
name: nginx
ports:
- containerPort: 8080
name: web
protocol: TCP
- containerPort: 8085
name: jprofiler # only this can be mapping.
protocol: TCP
curl host:3343/api/v1/mapping?pod_name=xxx
this example is mapping pod in 600s, exceed 600s, expired.
curl -XPOST host:3343/api/v1/mapping?pod_name={ns_name}/{podname}&time=600
curl -XPOST host:3343/api/v1/mapping?pod_name=kube-system/portest&time=600
curl pod-proxier:8848 == curl portest:8085
Noted: pod-proxier can worked in-cluser on out-cluster, if run out-cluster, you need provide kubeconfig
ok tks, i will try it,
can you speak clearly how to use this tool? tks