Skip to content

Commit

Permalink
feat: add service definitions for HAProxy and Envoy with support for …
Browse files Browse the repository at this point in the history
…both ClusterIP and LoadBalancer configurations (#268)

Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon authored Aug 15, 2023
1 parent 8598481 commit 8563e16
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/hedera-network/config-files/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static_resources:
- name: envoy.filters.http.cors
- name: envoy.filters.http.router
clusters:
- name: echo_service
- name: non_tls_grpc_cluster
connect_timeout: 0.25s
type: logical_dns
http2_protocol_options: {}
Expand Down
21 changes: 21 additions & 0 deletions charts/hedera-network/templates/services/envoy-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ range $index, $node := ($.Values.hedera.nodes) }}
{{- $envoyProxy := $node.envoyProxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $envoyProxy.enable | eq "true" }}
---
apiVersion: v1
kind: Service
metadata:
name: envoy-proxy-{{ $node.name }}-svc
spec:
{{- if default $defaults.loadBalancerEnabled $envoyProxy.loadBalancerEnabled | eq "true" }}
type: LoadBalancer
{{- end }}
selector:
app: envoy-proxy-{{ $node.name }}
ports:
- port: 8080
targetPort: 8080
{{- end }}
{{- end }}

25 changes: 25 additions & 0 deletions charts/hedera-network/templates/services/haproxy-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- range $index, $node := ($.Values.hedera.nodes) }}
{{- $haproxy := $node.haproxy | default dict -}}
{{- $defaults := $.Values.defaults.haproxy }}
{{- if default $defaults.enable $haproxy.enable | eq "true" }}
---
apiVersion: v1
kind: Service
metadata:
name: haproxy-{{ $node.name }}-svc
spec:
{{- if default $defaults.loadBalancerEnabled $haproxy.loadBalancerEnabled | eq "true" }}
type: LoadBalancer
{{- end }}
selector:
app: haproxy-{{ $node.name }}
ports:
- name: non-tls-grpc-client-port
port: 50211
targetPort: 50211
- name: tls-grpc-client-port
port: 50212
targetPort: 50212
{{- end }}
{{- end }}

2 changes: 2 additions & 0 deletions charts/hedera-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ defaults:
pullPolicy: "IfNotPresent"
replica: 1
resources: {}
loadBalancerEnabled: "false"
envoyProxy:
enable: "true"
nameOverride: "envoy-proxy"
Expand All @@ -59,6 +60,7 @@ defaults:
pullPolicy: "IfNotPresent"
replica: 1
resources: {}
loadBalancerEnabled: "false"
sidecars:
recordStreamUploader:
enable: "true"
Expand Down

0 comments on commit 8563e16

Please sign in to comment.