Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Borja Aranda committed Sep 20, 2022
1 parent 7222e98 commit 983a42a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
kernel*
linux*
linux*
./config.json
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run: build
@echo -e "\n# running skproxy"
${BIN_DIR}/${BIN_NAME} &
@echo -e "\n# wait until all listeners are ready"
@sleep 0.5
@sleep 2

test: run
@echo -e "\n# executing test-target.sh"
Expand All @@ -26,6 +26,10 @@ stop:
clean: stop
@echo -e "# clean skproxy"
@rm ${BIN_DIR}/${BIN_NAME}
@rm -rf /sys/fs/bpf/*-Frontend*

all: test clean
clean-ebpf:
@rm -rf /sys/fs/bpf/*-Frontend*

all: clean-ebpf test clean clean-ebpf
@echo -e "# all done"
20 changes: 10 additions & 10 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"Apps": [
{
"Name": "five-thousand",
"Name": "Frontend01",
"Ports": [
5001,
5200,
5300,
5400
],
"Targets": [
"tcp-echo.fly.dev:5001",
"tcp-echo.fly.dev:5002"
"echo.fbac.dev:5001",
"echo.fbac.dev:5002"
]
},
{
"Name": "six-thousand",
"Name": "Frontend02",
"Ports": [
6001,
6200,
6300,
6400
],
"Targets": [
"tcp-echo.fly.dev:6001",
"tcp-echo.fly.dev:6002",
"bad.target.for.testing:6003"
"echo.fbac.dev:6001",
"echo.fbac.dev:6002",
"unhealthy-backend:6003"
]
},
{
"Name": "seven-thousand",
"Name": "Frontend03",
"Ports": [
7001,
7200,
7300,
7400
],
"Targets": [
"tcp-echo.fly.dev:7001",
"tcp-echo.fly.dev:7002"
"echo.fbac.dev:7001",
"echo.fbac.dev:7002"
]
}
]
Expand Down
33 changes: 33 additions & 0 deletions config.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Apps": [
{
"Name": "Frontend-01",
"Ports": [
1025,
1026,
1027,
1028
],
"Targets": [
"backend-01:1010",
"backend-02:2020",
"backend-03:3030",
"backend-04:4040"
]
},
{
"Name": "Frontend-02",
"Ports": [
1029,
1030,
1031,
1032
],
"Targets": [
"backend-05:5050",
"unhealthy-backend:1111",
"unhealthy-backend:2222"
]
}
]
}
1 change: 0 additions & 1 deletion pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (pm ProxyMap) ReloadProxy(cfg config.Config) {}
// TODO this should be run in a context
func doProxy(app string, fe []int, be []string, ctx context.Context) {
lbalancer := lb.NewLB(be)
fmt.Println("created lb")
go proxy(app, fe, *lbalancer, ctx)
}

Expand Down

0 comments on commit 983a42a

Please sign in to comment.