Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-merge-queue[bot] committed Apr 4, 2024
1 parent 6d967fe commit 1cdca8e
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/sequencer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.11.1
version: 0.11.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
90 changes: 83 additions & 7 deletions charts/sequencer/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $ingressSupportsIngressClassName := eq (include "sequencer.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "sequencer.ingress.supportsPathType" .) "true" -}}

{{- range $service, $ingress := .Values.ingress }}
{{- $ingress := .Values.ingress.rpc -}}
{{- if $ingress.enabled -}}
{{- $servicePort := $ingress.service.port -}}
{{- $serviceName := $ingress.service.name -}}
Expand All @@ -12,8 +12,8 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $.Values.config.moniker }}-sequencer-{{ $service }}-ingress
namespace: {{ include "sequencer.namespace" $ }}
name: {{ .Values.config.moniker }}-sequencer-rpc-ingress
namespace: {{ include "sequencer.namespace" . }}
labels:
{{- with $ingress.labels }}
{{- toYaml . | nindent 4 }}
Expand Down Expand Up @@ -65,17 +65,93 @@ spec:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- else if $ingress.hostname }}
- host: {{ $service }}.{{ $ingress.hostname }}
- host: rpc.{{ $ingress.hostname }}
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: {{ $.Values.config.moniker }}-sequencer-{{ $service }}-service
name: {{ $.Values.config.moniker }}-sequencer-rpc-service
port:
name: cometbft-{{ $service }}
{{- end -}}
name: cometbft-rpc
{{- end }}
---
{{- end }}
{{- $ingress := .Values.ingress.grpc }}
{{- if $ingress.enabled -}}
{{- $servicePort := $ingress.service.port -}}
{{- $serviceName := $ingress.service.name -}}
{{- $ingressPath := $ingress.path -}}
{{- $ingressPathType := $ingress.pathType -}}
{{- $extraPaths := $ingress.extraPaths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.config.moniker }}-sequencer-grpc-ingress
namespace: {{ include "sequencer.namespace" . }}
labels:
{{- with $ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
{{- if $ingress.annotations }}
{{- with $ingress.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
{{- else }}
kubernetes.io/ingress.class: nginx
{{- end }}
spec:
{{- if and $ingressSupportsIngressClassName $ingress.ingressClassName }}
ingressClassName: {{ $ingress.ingressClassName }}
{{- end -}}
{{- with $ingress.defaultBackend }}
defaultBackend:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
{{- if $ingress.hosts }}
{{- range $ingress.hosts }}
- host: {{ tpl . $ }}
http:
paths:
{{- with $extraPaths }}
{{- toYaml . | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
{{- if $ingressSupportsPathType }}
pathType: {{ $ingressPathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- else }}
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
{{- with $ingress.tls }}
tls:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- else if $ingress.hostname }}
- host: grpc.{{ $ingress.hostname }}
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: {{ .Values.config.moniker }}-sequencer-grpc-service
port:
name: sequencer-grpc
{{- end }}
---
{{- end }}
2 changes: 1 addition & 1 deletion charts/sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ ingress:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
p2p:
grpc:
enabled: false
hostname: sequencer.localdev.me
ingressClassName: nginx
Expand Down

0 comments on commit 1cdca8e

Please sign in to comment.