Skip to content

Commit

Permalink
chore: remove debug
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Apr 17, 2024
1 parent 1571b1c commit 9abbd31
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 210 deletions.
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 @@ -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
admin-password: test
funding:
eth: 0.1
Expand Down Expand Up @@ -78,7 +75,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 @@ -115,8 +111,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
3 changes: 0 additions & 3 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
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
2 changes: 0 additions & 2 deletions pkg/config/bee.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ type BeeConfig struct {
DbBlockCacheCapacity *int `yaml:"db-block-cache-capacity"`
DbWriteBufferSize *int `yaml:"db-write-buffer-size"`
DbDisableSeeksCompaction *bool `yaml:"db-disable-seeks-compaction"`
DebugAPIAddr *string `yaml:"debug-api-addr"`
DebugAPIEnable *bool `yaml:"debug-api-enable"`
FullNode *bool `yaml:"full-node"`
NATAddr *string `yaml:"nat-addr"`
Mainnet *bool `yaml:"mainnet"`
Expand Down
21 changes: 9 additions & 12 deletions pkg/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ type Cluster struct {
// parent to inherit settings from
*Inherit `yaml:",inline"`
// Cluster configuration
Name *string `yaml:"name"`
Namespace *string `yaml:"namespace"`
DisableNamespace *bool `yaml:"disable-namespace"`
APIDomain *string `yaml:"api-domain"`
APIInsecureTLS *bool `yaml:"api-insecure-tls"`
APIScheme *string `yaml:"api-scheme"`
DebugAPIDomain *string `yaml:"debug-api-domain"`
DebugAPIInsecureTLS *bool `yaml:"debug-api-insecure-tls"`
DebugAPIScheme *string `yaml:"debug-api-scheme"`
Funding *Funding `yaml:"funding"`
NodeGroups *map[string]ClusterNodeGroup `yaml:"node-groups"`
AdminPassword *string `yaml:"admin-password"`
Name *string `yaml:"name"`
Namespace *string `yaml:"namespace"`
DisableNamespace *bool `yaml:"disable-namespace"`
APIDomain *string `yaml:"api-domain"`
APIInsecureTLS *bool `yaml:"api-insecure-tls"`
APIScheme *string `yaml:"api-scheme"`
Funding *Funding `yaml:"funding"`
NodeGroups *map[string]ClusterNodeGroup `yaml:"node-groups"`
AdminPassword *string `yaml:"admin-password"`
}

// ClusterNodeGroup represents node group in the cluster
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type NodeGroup struct {
ImagePullSecrets *[]string `yaml:"image-pull-secrets"`
IngressAnnotations *map[string]string `yaml:"ingress-annotations"`
IngressClass *string `yaml:"ingress-class"`
IngressDebugAnnotations *map[string]string `yaml:"ingress-debug-annotations"`
IngressDebugClass *string `yaml:"ingress-debug-class"`
Labels *map[string]string `yaml:"labels"`
NodeSelector *map[string]string `yaml:"node-selector"`
PersistenceEnabled *bool `yaml:"persistence-enabled"`
Expand Down
8 changes: 4 additions & 4 deletions pkg/k8s/customresource/ingressroute/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func (c *Client) Delete(ctx context.Context, name, namespace string) (err error)
return
}

// ListDebugNodesHosts list Ingresses that are nodes
func (c *Client) ListDebugNodesHosts(ctx context.Context, namespace string) (nodes []ingress.NodeInfo, err error) {
// ListAPINodesHosts list Ingresses that are nodes
func (c *Client) ListAPINodesHosts(ctx context.Context, namespace string) (nodes []ingress.NodeInfo, err error) {
ingressRoutes, err := c.clientset.IngressRoutes(namespace).List(ctx, metav1.ListOptions{
LabelSelector: "app.kubernetes.io/name=bee",
})
Expand All @@ -96,12 +96,12 @@ func (c *Client) ListDebugNodesHosts(ctx context.Context, namespace string) (nod

if ingressRoutes != nil {
for _, ingressRoute := range ingressRoutes.Items {
if strings.HasSuffix(ingressRoute.Name, "-debug") {
if strings.HasSuffix(ingressRoute.Name, "-api") {
for _, route := range ingressRoute.Spec.Routes {
host := route.GetHost()
if host != "" {
nodes = append(nodes, ingress.NodeInfo{
Name: strings.TrimSuffix(ingressRoute.Name, "-debug"),
Name: strings.TrimSuffix(ingressRoute.Name, "-api"),
Host: host,
})
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/k8s/ingress/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (c *Client) Delete(ctx context.Context, name, namespace string) (err error)
return
}

// ListDebugNodesHosts list Ingresses that are nodes
func (c *Client) ListDebugNodesHosts(ctx context.Context, namespace string) (nodes []NodeInfo, err error) {
// ListAPINodesHosts list Ingresses that are nodes
func (c *Client) ListAPINodesHosts(ctx context.Context, namespace string) (nodes []NodeInfo, err error) {
ingreses, err := c.clientset.NetworkingV1().Ingresses(namespace).List(ctx, metav1.ListOptions{
LabelSelector: "app.kubernetes.io/name=bee",
})
Expand All @@ -89,11 +89,11 @@ func (c *Client) ListDebugNodesHosts(ctx context.Context, namespace string) (nod
}

for _, ingress := range ingreses.Items {
if strings.HasSuffix(ingress.Name, "-debug") {
if strings.HasSuffix(ingress.Name, "-api") {
for _, rule := range ingress.Spec.Rules {
if rule.Host != "" {
nodes = append(nodes, NodeInfo{
Name: strings.TrimSuffix(ingress.Name, "-debug"),
Name: strings.TrimSuffix(ingress.Name, "-api"),
Host: rule.Host,
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (c *Client) processPodIP(ctx context.Context, podIp string) (bee.Addresses,
// bee.Addresses is struct that represents response with field Ethereum string
url := &url.URL{
Scheme: "http",
Host: podIp + ":1635", // it is possible to extract debug port from service
Host: podIp + ":1633", // it is possible to extract port from service
Path: "/addresses",
}

Expand Down
23 changes: 10 additions & 13 deletions pkg/orchestration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,16 @@ type Cluster interface {

// ClusterOptions represents Bee cluster options
type ClusterOptions struct {
Annotations map[string]string
APIDomain string
APIInsecureTLS bool
APIScheme string
DebugAPIDomain string
DebugAPIInsecureTLS bool
DebugAPIScheme string
K8SClient *k8s.Client
SwapClient swap.Client
Labels map[string]string
Namespace string
DisableNamespace bool
AdminPassword string
Annotations map[string]string
APIDomain string
APIInsecureTLS bool
APIScheme string
K8SClient *k8s.Client
SwapClient swap.Client
Labels map[string]string
Namespace string
DisableNamespace bool
AdminPassword string
}

// ClusterAddresses represents addresses of all nodes in the cluster
Expand Down
8 changes: 0 additions & 8 deletions pkg/orchestration/k8s/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ db-open-files-limit: {{.DbOpenFilesLimit}}
db-block-cache-capacity: {{.DbBlockCacheCapacity}}
db-write-buffer-size: {{.DbWriteBufferSize}}
db-disable-seeks-compaction: {{.DbDisableSeeksCompaction}}
debug-api-addr: {{.DebugAPIAddr}}
debug-api-enable: {{.DebugAPIEnable}}
full-node: {{.FullNode}}
mainnet: {{.Mainnet}}
nat-addr: {{.NATAddr}}
Expand Down Expand Up @@ -110,7 +108,6 @@ type setContainersOptions struct {
Image string
ImagePullPolicy string
PortAPI int32
PortDebug int32
PortP2P int32
PersistenceEnabled bool
ResourcesLimitCPU string
Expand Down Expand Up @@ -138,11 +135,6 @@ func setContainers(o setContainersOptions) (c containers.Containers) {
ContainerPort: o.PortAPI,
Protocol: "TCP",
},
{
Name: "debug",
ContainerPort: o.PortDebug,
Protocol: "TCP",
},
{
Name: "p2p",
ContainerPort: o.PortP2P,
Expand Down
Loading

0 comments on commit 9abbd31

Please sign in to comment.