From a273ce9a2c8dc64684c6e2d226eea3b35b9e2cc0 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 15 Apr 2024 13:58:33 +0200 Subject: [PATCH] feat: add nodeport config to blutgang --- charts/blutgang/Chart.yaml | 2 +- charts/blutgang/README.md | 11 ++++++-- .../blutgang/templates/service.nodeport.yaml | 23 +++++++++++++++ charts/blutgang/templates/service.yaml | 2 +- charts/blutgang/values.yaml | 28 +++++++++++++++++-- 5 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 charts/blutgang/templates/service.nodeport.yaml diff --git a/charts/blutgang/Chart.yaml b/charts/blutgang/Chart.yaml index 3ab353c1..4152abb4 100644 --- a/charts/blutgang/Chart.yaml +++ b/charts/blutgang/Chart.yaml @@ -7,7 +7,7 @@ icon: https://github.com/rainshowerLabs/blutgang/assets/55022497/ec668c7a-5f56-4 sources: - https://github.com/rainshowerLabs/blutgang type: application -version: 0.0.6 +version: 0.0.7 maintainers: - name: barnabasbusa email: busa.barnabas@gmail.com diff --git a/charts/blutgang/README.md b/charts/blutgang/README.md index 9badeb16..8795c08d 100644 --- a/charts/blutgang/README.md +++ b/charts/blutgang/README.md @@ -1,7 +1,7 @@ # blutgang -![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Blutgang is a blazing fast, caching, minimalistic load balancer designed with Ethereum's JSON-RPC in mind. Historical RPC queries are cached in a local database, bypassing the need for slow, repeating calls to your node. @@ -15,6 +15,14 @@ Blutgang is a blazing fast, caching, minimalistic load balancer designed with Et | Key | Type | Default | Description | |-----|------|---------|-------------| +| NodePort.enabled | bool | `false` | Expose P2P port via NodePort | +| NodePort.initContainer.image.pullPolicy | string | `"IfNotPresent"` | Container pull policy | +| NodePort.initContainer.image.repository | string | `"lachlanevenson/k8s-kubectl"` | Container image to fetch nodeport information | +| NodePort.initContainer.image.tag | string | `"v1.25.4"` | Container tag | +| NodePort.port | int | `31000` | NodePort to be used | +| NodePort.portForwardContainer.image.pullPolicy | string | `"IfNotPresent"` | Container pull policy | +| NodePort.portForwardContainer.image.repository | string | `"alpine/socat"` | Container image for the port forwarder | +| NodePort.portForwardContainer.image.tag | string | `"latest"` | Container tag | | adminNamespace | object | See `values.yaml` | Admin Namespace | | affinity | object | `{}` | Affinity configuration for pods | | annotations | object | `{}` | Annotations for the StatefulSet | @@ -61,7 +69,6 @@ Blutgang is a blazing fast, caching, minimalistic load balancer designed with Et | rpcList | list | `[]` | RPC list for the blutgang container CSV list of rpcs [default: ] | | secretEnv | object | `{}` | Additional env variables injected via a created secret | | securityContext | object | See `values.yaml` | The security context for pods | -| service.type | string | `"ClusterIP"` | Service type | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | diff --git a/charts/blutgang/templates/service.nodeport.yaml b/charts/blutgang/templates/service.nodeport.yaml new file mode 100644 index 00000000..9befb4ba --- /dev/null +++ b/charts/blutgang/templates/service.nodeport.yaml @@ -0,0 +1,23 @@ +{{- if .Values.NodePort.enabled -}} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "blutgang.fullname" $ }}-nodeport-0 + labels: + {{- include "blutgang.labels" $ | nindent 4 }} + pod: {{ include "blutgang.fullname" $ }}-0 + type: nodeport +spec: + type: NodePort + externalTrafficPolicy: Local + ports: + - name: nodeport-tcp + port: {{ .Values.httpPort }} + protocol: TCP + targetPort: http + nodePort: {{ .Values.NodePort.port }} + selector: + {{- include "blutgang.selectorLabels" $ | nindent 4 }} + statefulset.kubernetes.io/pod-name: "{{ include "blutgang.fullname" $ }}-0" +{{- end }} diff --git a/charts/blutgang/templates/service.yaml b/charts/blutgang/templates/service.yaml index 1cac61e5..ab875df4 100644 --- a/charts/blutgang/templates/service.yaml +++ b/charts/blutgang/templates/service.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "blutgang.labels" . | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: ClusterIP ports: - port: {{ .Values.httpPort }} targetPort: http diff --git a/charts/blutgang/values.yaml b/charts/blutgang/values.yaml index b990f73d..67c97628 100644 --- a/charts/blutgang/values.yaml +++ b/charts/blutgang/values.yaml @@ -151,9 +151,31 @@ ingress: # hosts: # - chart-example.local -service: - # -- Service type - type: ClusterIP +# When NodePort is enabled, your P2P port will be exposed via service type NodePort. +# This is useful if you want to expose and announce your node to the Internet. +# Limitation: You can only one have one replica when exposing via NodePort. +# Check the chart README.md for more details +NodePort: + # -- Expose P2P port via NodePort + enabled: false + # -- NodePort to be used + port: 31000 + initContainer: + image: + # -- Container image to fetch nodeport information + repository: lachlanevenson/k8s-kubectl + # -- Container tag + tag: v1.25.4 + # -- Container pull policy + pullPolicy: IfNotPresent + portForwardContainer: + image: + # -- Container image for the port forwarder + repository: alpine/socat + # -- Container tag + tag: latest + # -- Container pull policy + pullPolicy: IfNotPresent # -- Affinity configuration for pods affinity: {}