From 5c52bdfb7f4c034280d543404a3912c99cce366c Mon Sep 17 00:00:00 2001 From: Duncan Dam Date: Mon, 22 Jul 2024 17:23:44 +0700 Subject: [PATCH] [BLOCK-2374] create ingress for testnet --- charts/firehose-antelope/Chart.yaml | 2 +- .../firehose-antelope/templates/ingress.yaml | 46 +++++++++++++++++++ .../templates/tls-secret.yaml | 18 ++++++++ charts/firehose-antelope/values.yaml | 7 +++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 charts/firehose-antelope/templates/ingress.yaml create mode 100644 charts/firehose-antelope/templates/tls-secret.yaml diff --git a/charts/firehose-antelope/Chart.yaml b/charts/firehose-antelope/Chart.yaml index 5302d39..eed46a3 100644 --- a/charts/firehose-antelope/Chart.yaml +++ b/charts/firehose-antelope/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.1.0 description: A Helm chart for firehose-antelope components name: firehose-antelope type: application -version: 1.1.0 +version: 1.1.1 dependencies: - name: reader-node diff --git a/charts/firehose-antelope/templates/ingress.yaml b/charts/firehose-antelope/templates/ingress.yaml new file mode 100644 index 0000000..247e96f --- /dev/null +++ b/charts/firehose-antelope/templates/ingress.yaml @@ -0,0 +1,46 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "firehose-antelope.fullname" . -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "firehose-antelope.labels" . | nindent 4 }} + annotations: + kubernetes.io/ingress.global-static-ip-name: ingress-{{ .Release.Namespace }} + cert-manager.io/cluster-issuer: letsencrypt-prod-dns + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ $fullName }}-{{ .secretName }} + {{- end }} + {{- end }} + {{- with .Values.ingress.url }} + rules: + - host: {{ .substreams }} + http: + paths: + - pathType: ImplementationSpecific + backend: + service: + name: substreams-tier1 + port: + number: 9000 + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/firehose-antelope/templates/tls-secret.yaml b/charts/firehose-antelope/templates/tls-secret.yaml new file mode 100644 index 0000000..ef3dd76 --- /dev/null +++ b/charts/firehose-antelope/templates/tls-secret.yaml @@ -0,0 +1,18 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "firehose-antelope.fullname" . -}} +{{- $labels := include "firehose-antelope.labels" . -}} + +{{- range .Values.ingress.tls }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $fullName }}-{{ .secretName }} + labels: + {{- $labels | nindent 4 }} +type: kubernetes.io/tls +stringData: + tls.key: "" + tls.crt: "" +--- +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/firehose-antelope/values.yaml b/charts/firehose-antelope/values.yaml index 9ac00ff..32b6024 100644 --- a/charts/firehose-antelope/values.yaml +++ b/charts/firehose-antelope/values.yaml @@ -21,5 +21,12 @@ serviceAccount: writerAnnotations: {} readerName: "" readerAnnotations: {} +ingress: + enabled: false + className: "" + annotations: {} + tls: [] + url: + substreams: # Only enable if testing locally persistentVolumeEnabled: false