From 623b1b666954ab2826ae1930ec32808164ccdfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20Vandot?= Date: Mon, 8 Jul 2024 16:24:00 +0200 Subject: [PATCH] chore: remove deprecated debug api endpoint (#209) * chore: remove deprecated debug api endpoint * chore: reverted bee version and removed debug ref from gateway-proxy * chore: bump gateway-proxy --- charts/bee/Chart.yaml | 4 +- charts/bee/templates/_helpers.tpl | 7 +- charts/bee/templates/ingress-debug.yaml | 70 ------------------- charts/bee/templates/service-debug.yaml | 31 -------- charts/bee/templates/service-headless.yaml | 6 -- charts/bee/templates/servicemonitor.yaml | 4 +- charts/bee/templates/statefulset.yaml | 20 ------ .../bee/templates/tests/test-connection.yaml | 2 +- charts/bee/values.yaml | 30 +------- 9 files changed, 7 insertions(+), 167 deletions(-) delete mode 100644 charts/bee/templates/ingress-debug.yaml delete mode 100644 charts/bee/templates/service-debug.yaml diff --git a/charts/bee/Chart.yaml b/charts/bee/Chart.yaml index db22fcf..727f37f 100644 --- a/charts/bee/Chart.yaml +++ b/charts/bee/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 -appVersion: 2.0.0 +appVersion: 2.1.0 name: bee -version: 0.15.0 +version: 0.16.0 kubeVersion: ">=1.19.0-0" description: Ethereum Swarm Bee Helm chart for Kubernetes home: https://www.ethswarm.org diff --git a/charts/bee/templates/_helpers.tpl b/charts/bee/templates/_helpers.tpl index af39a08..a121049 100644 --- a/charts/bee/templates/_helpers.tpl +++ b/charts/bee/templates/_helpers.tpl @@ -124,18 +124,13 @@ Return Bee password. {{- end -}} {{/* -Define config parameters api-addr, debug-api-addr, debug-api-enable, p2p-addr +Define config parameters api-addr, p2p-addr */}} {{- define "bee.config.api_port" -}} {{- $full_api_addr := index .Values.beeConfig "api-addr" -}} {{- $api_port := (split ":" $full_api_addr )._1 }} {{- printf "%s" $api_port -}} {{- end -}} -{{- define "bee.config.debug_api_port" -}} -{{- $full_debug_api_addr := index .Values.beeConfig "debug-api-addr" -}} -{{- $debug_api_port := (split ":" $full_debug_api_addr )._1 }} -{{- printf "%s" $debug_api_port -}} -{{- end -}} {{- define "bee.config.p2p_port" -}} {{- $full_p2p_addr := index .Values.beeConfig "p2p-addr" -}} {{- $p2p_port := (split ":" $full_p2p_addr )._1 }} diff --git a/charts/bee/templates/ingress-debug.yaml b/charts/bee/templates/ingress-debug.yaml deleted file mode 100644 index 1bc3459..0000000 --- a/charts/bee/templates/ingress-debug.yaml +++ /dev/null @@ -1,70 +0,0 @@ -{{- if and (index .Values.beeConfig "debug-api-enable") .Values.ingressDebug.enabled -}} - -{{- $root := . -}} -{{- $fullName := include "bee.fullname" $root -}} - -# PER POD INGRESS -{{- range $i, $e := until (int $root.Values.replicaCount) }} ---- -{{- if semverCompare ">=1.19-0" $root.Capabilities.KubeVersion.Version }} -apiVersion: networking.k8s.io/v1 -{{- else -}} -apiVersion: networking.k8s.io/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }}-{{ $i }}-debug - namespace: {{ $root.Release.Namespace }} - labels: - {{- include "bee.labels" $root | nindent 4 }} - {{- with $root.Values.ingressDebug.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if $root.Values.ingressDebug.tls }} - tls: - {{- range $root.Values.ingressDebug.hosts }} - - hosts: - {{- if .domain }} - - {{ $fullName }}-{{ $i }}-debug.{{ .domain }} - {{- else }} - - {{ $fullName }}-{{ $i }}-debug - {{- end }} - {{- if .tlsSecret }} - secretName: {{ .tlsSecret }} - {{- end }} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.18-0" $root.Capabilities.KubeVersion.Version }} - ingressClassName: {{ $root.Values.ingressDebug.ingressClassName }} -{{- end }} - rules: - {{- range $root.Values.ingressDebug.hosts }} - {{- if .domain }} - - host: {{ $fullName }}-{{ $i }}-debug.{{ .domain }} - {{- else }} - - host: {{ $fullName }}-{{ $i }}-debug - {{- end }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - {{- if semverCompare ">=1.18-0" $root.Capabilities.KubeVersion.Version }} - pathType: {{ $root.Values.ingressDebug.pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $root.Capabilities.KubeVersion.Version }} - service: - name: {{ $fullName }}-{{ $i }}-debug - port: - name: debug - {{- else }} - serviceName: {{ $fullName }}-{{ $i }}-debug - servicePort: debug - {{- end }} - {{- end }} - {{- end }} -{{- end }} - -{{- end -}} diff --git a/charts/bee/templates/service-debug.yaml b/charts/bee/templates/service-debug.yaml deleted file mode 100644 index 0a7fc34..0000000 --- a/charts/bee/templates/service-debug.yaml +++ /dev/null @@ -1,31 +0,0 @@ -{{- if index .Values.beeConfig "debug-api-enable" }} - -{{- $root := . -}} - -{{- range $i, $e := until (int $root.Values.replicaCount) }} - ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ include "bee.fullname" $root }}-{{ $i }}-debug - namespace: {{ $root.Release.Namespace }} - labels: - {{- include "bee.labels" $root | nindent 4 }} - pod: {{ include "bee.fullname" $root }}-{{ $i }} - endpoint: debug - app: {{ include "bee.name" $root }} - release: {{ $root.Release.Name }} -spec: - type: ClusterIP - ports: - - name: debug - port: {{ int (include "bee.config.debug_api_port" $root) }} - protocol: TCP - targetPort: debug - selector: - {{- include "bee.selectorLabels" $root | nindent 4 }} - statefulset.kubernetes.io/pod-name: {{ include "bee.fullname" $root }}-{{ $i }} - -{{- end }} -{{- end -}} diff --git a/charts/bee/templates/service-headless.yaml b/charts/bee/templates/service-headless.yaml index a87fc95..7617b0c 100644 --- a/charts/bee/templates/service-headless.yaml +++ b/charts/bee/templates/service-headless.yaml @@ -21,12 +21,6 @@ spec: port: {{ int (include "bee.config.p2p_port" .) }} protocol: TCP targetPort: p2p - {{- if index .Values.beeConfig "debug-api-enable" }} - - name: debug - port: {{ int (include "bee.config.debug_api_port" .) }} - protocol: TCP - targetPort: debug - {{- end }} selector: {{- include "bee.selectorLabels" . | nindent 4 }} type: {{ .Values.service.type }} diff --git a/charts/bee/templates/servicemonitor.yaml b/charts/bee/templates/servicemonitor.yaml index 989a92d..eccf8da 100644 --- a/charts/bee/templates/servicemonitor.yaml +++ b/charts/bee/templates/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.serviceMonitor.enabled (index .Values.beeConfig "debug-api-enable") -}} +{{- if .Values.serviceMonitor.enabled -}} --- apiVersion: monitoring.coreos.com/v1 @@ -18,7 +18,7 @@ metadata: {{- end }} spec: endpoints: - - port: debug + - port: api path: /metrics {{- if .Values.serviceMonitor.scrapeInterval }} interval: {{ .Values.serviceMonitor.scrapeInterval }} diff --git a/charts/bee/templates/statefulset.yaml b/charts/bee/templates/statefulset.yaml index 4d78bff..a5985be 100644 --- a/charts/bee/templates/statefulset.yaml +++ b/charts/bee/templates/statefulset.yaml @@ -191,21 +191,6 @@ spec: name: p2p-udp protocol: UDP {{- if .Values.probesEnable }} - {{- if index .Values.beeConfig "debug-api-enable" }} - - containerPort: {{ int (include "bee.config.debug_api_port" .) }} - name: debug - protocol: TCP - livenessProbe: - httpGet: - path: /health - port: debug - initialDelaySeconds: 20 - readinessProbe: - httpGet: - path: /readiness - port: debug - initialDelaySeconds: 20 - {{- else }} livenessProbe: httpGet: path: / @@ -217,7 +202,6 @@ spec: port: api initialDelaySeconds: 20 {{- end }} - {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} securityContext: @@ -257,10 +241,6 @@ spec: value: "8633" - name: BEE_API_URL value: "http://localhost:1633" - {{- if .Values.gatewayProxy.autobuy.enabled }} - - name: BEE_DEBUG_API_URL - value: "http://localhost:1635" - {{- end }} {{- with .Values.gatewayProxy.envs }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/bee/templates/tests/test-connection.yaml b/charts/bee/templates/tests/test-connection.yaml index e03d0a1..9536323 100644 --- a/charts/bee/templates/tests/test-connection.yaml +++ b/charts/bee/templates/tests/test-connection.yaml @@ -13,5 +13,5 @@ spec: - name: wget image: busybox command: ['echo'] - args: ['{{ include "bee.fullname" . }}:{{ int (include "bee.config.debug_api_port" $root) }}/addresses'] + args: ['{{ include "bee.fullname" . }}:{{ int (include "bee.config.api_port" $root) }}/addresses'] restartPolicy: Never diff --git a/charts/bee/values.yaml b/charts/bee/values.yaml index 370903f..6d7dddf 100644 --- a/charts/bee/values.yaml +++ b/charts/bee/values.yaml @@ -80,25 +80,6 @@ ingress: tlsSecret: "" tls: false -## If enabled and beeConfig.debug-api-enable is enabled, creates ingress for debug api -## Creates one ingress per pod -## Total number of created ingress objects is: replicaCount -## Hostname for 'per pod ingresses' is: -debug-, or -debug-. if domain is specified -## tls.secretName won't be specified if tlsSecret is "", tls must be set to true -ingressDebug: - enabled: false - ## Used if cluster version is >= 1.19-0 - pathType: ImplementationSpecific - # ingressClassName: ingress-nginx - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - domain: "" - paths: [] - tlsSecret: "" - tls: false - replicaCount: 1 updateStrategy: @@ -156,7 +137,6 @@ persistence: # existingClaim: ## Enable this if you're using https://github.com/coreos/prometheus-operator -## and beeConfig.debug-api-enable is enabled serviceMonitor: enabled: false additionalLabels: {} @@ -190,7 +170,6 @@ probesEnable: true podLabels: {} podAnnotations: {} ## Add this annotations if you're using https://github.com/prometheus/prometheus -## and beeConfig.debug-api-enable is enabled # prometheus.io/scrape: "true" # prometheus.io/port: "1635" @@ -211,10 +190,6 @@ beeConfig: api-addr: :1633 ## P2P listen address p2p-addr: :1634 - ## Debug HTTP API listen address - debug-api-addr: :1635 - ## Enable debug HTTP API - debug-api-enable: true ## Set the run mode - light by default full-node: true ## ID of the Swarm network - 10 by default @@ -232,7 +207,6 @@ password: ## You can specify all options except for usePasswordFile, existingSecret and existingSecretPasswordKey beeEnv: [] # api_addr: :1633 -# debug_api_addr: :1635 # p2p_addr: :1634 @@ -276,7 +250,7 @@ gatewayProxy: enabled: false image: repository: ethersphere/gateway-proxy - tag: 0.4.0 + tag: 0.15.0 # digest: sha256:508a6bc1d3f45acaf98b746d521ee2cb11a895d8334446d2205fe4053b9e3667 pullPolicy: IfNotPresent ## If enabled, creates ingress for HTTP @@ -297,8 +271,6 @@ gatewayProxy: paths: [] tlsSecret: "" tls: false - ## If enabled it will configure bee debug api endpoint BEE_DEBUG_API_URL - ## that is needed for autobuy to work ## If enabled set POSTAGE_DEPTH and POSTAGE_AMOUNT autobuy: enabled: false