Skip to content

Commit

Permalink
chore: disable debug api (#395)
Browse files Browse the repository at this point in the history
* chore: disable debug api

* chore: remove debug-api flags

* chore: move readiness and liveness to api port

* chore: wip

* chore: remove debug

* chore: remove debug

* fix: lint

---------

Co-authored-by: Acha Bill <[email protected]>
  • Loading branch information
Иван Vandot and acha-bill authored May 29, 2024
1 parent 6781b34 commit c86d398
Show file tree
Hide file tree
Showing 33 changed files with 120 additions and 737 deletions.
2 changes: 1 addition & 1 deletion cmd/beekeeper/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func setupNodes(ctx context.Context, clusterConfig config.Cluster, cfg *config.C

if clusterConfig.IsUsingStaticEndpoints() {
for nodeName, endpoint := range v.GetEndpoints() {
beeOpt := orchestration.WithURLs(endpoint.APIURL, endpoint.DebugAPIURL)
beeOpt := orchestration.WithURL(endpoint.APIURL)
nodeCount++
go setupOrAddNode(ctx, false, ng, nodeName, orchestration.NodeOptions{
Config: &bConfig,
Expand Down
8 changes: 4 additions & 4 deletions cmd/beekeeper/cmd/node_funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ func (nf *nodeLister) List(ctx context.Context, namespace string) (nodes []funde
return nil, fmt.Errorf("namespace not provided")
}

ingressHosts, err := nf.k8sClient.Ingress.ListDebugNodesHosts(ctx, namespace)
ingressHosts, err := nf.k8sClient.Ingress.ListAPINodesHosts(ctx, namespace)
if err != nil {
return nil, fmt.Errorf("list ingress debug nodes hosts: %s", err.Error())
return nil, fmt.Errorf("list ingress api nodes hosts: %s", err.Error())
}

ingressRouteHosts, err := nf.k8sClient.IngressRoute.ListDebugNodesHosts(ctx, namespace)
ingressRouteHosts, err := nf.k8sClient.IngressRoute.ListAPINodesHosts(ctx, namespace)
if err != nil {
return nil, fmt.Errorf("list ingress route debug nodes hosts: %s", err.Error())
return nil, fmt.Errorf("list ingress route api nodes hosts: %s", err.Error())
}

ingressHosts = append(ingressHosts, ingressRouteHosts...)
Expand Down
6 changes: 0 additions & 6 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
admin-password: test
funding:
eth: 0.1
Expand Down Expand Up @@ -103,7 +100,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -140,8 +136,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
nat-addr: ""
mainnet: false
Expand Down
3 changes: 0 additions & 3 deletions config/helm-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
node-groups:
bee:
bee-config: default
Expand Down
5 changes: 0 additions & 5 deletions config/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ clusters:
disable-namespace: true
api-domain: localhost
api-scheme: http
debug-api-domain: localhost
debug-api-scheme: http
admin-password: test
funding:
eth: 0.1
Expand Down Expand Up @@ -119,7 +117,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "traefik"
ingress-debug-class: "traefik"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -163,8 +160,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
mainnet: false
nat-addr: ""
Expand Down
3 changes: 0 additions & 3 deletions config/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: gateway.ethswarm.org
api-insecure-tls: true
api-scheme: https
debug-api-domain: bee-gateway.mainnet.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down
3 changes: 0 additions & 3 deletions config/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.ethswarm.org
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down
6 changes: 0 additions & 6 deletions config/testnet-giant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down Expand Up @@ -51,7 +48,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -88,8 +84,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
mainnet: false
nat-addr: ""
Expand Down
6 changes: 0 additions & 6 deletions config/testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ clusters:
api-domain: staging.internal
api-insecure-tls: true
api-scheme: https
debug-api-domain: staging.internal
debug-api-insecure-tls: true
debug-api-scheme: https
funding:
eth: 0.1
gbzz: 2.0
Expand Down Expand Up @@ -48,7 +45,6 @@ node-groups:
nginx.ingress.kubernetes.io/session-cookie-path: "default"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
ingress-class: "nginx-internal"
ingress-debug-class: "nginx-internal"
labels:
app.kubernetes.io/component: "node"
app.kubernetes.io/name: "bee"
Expand Down Expand Up @@ -90,8 +86,6 @@ bee-configs:
db-block-cache-capacity: 33554432
db-write-buffer-size: 33554432
db-disable-seeks-compaction: false
debug-api-addr: ":1635"
debug-api-enable: true
full-node: true
nat-addr: ""
mainnet: false
Expand Down
9 changes: 9 additions & 0 deletions pkg/bee/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ type Client struct {
SOC *SOCService
Stewardship *StewardshipService
Auth *AuthService

Node *NodeService
PingPong *PingPongService
Postage *PostageService
Stake *StakingService
}

// ClientOptions holds optional parameters for the Client.
Expand Down Expand Up @@ -82,6 +87,10 @@ func newClient(httpClient *http.Client) (c *Client) {
c.SOC = (*SOCService)(&c.service)
c.Stewardship = (*StewardshipService)(&c.service)
c.Auth = (*AuthService)(&c.service)
c.Node = (*NodeService)(&c.service)
c.PingPong = (*PingPongService)(&c.service)
c.Postage = (*PostageService)(&c.service)
c.Stake = (*StakingService)(&c.service)
return c
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package debugapi
package api

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/bee/debugapi/node.go → pkg/bee/api/node.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package debugapi
package api

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/bee/debugapi/pingpong.go → pkg/bee/api/pingpong.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package debugapi
package api

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/bee/debugapi/postage.go → pkg/bee/api/postage.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package debugapi
package api

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/bee/debugapi/stake.go → pkg/bee/api/stake.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package debugapi
package api

import (
"context"
Expand Down
Loading

0 comments on commit c86d398

Please sign in to comment.