From a1c5103f305e7006ba0e152057e76f3b0055cde3 Mon Sep 17 00:00:00 2001 From: Nick Kou Date: Thu, 18 Aug 2022 17:19:24 +1200 Subject: [PATCH] add index ingress --- charts/graphprotocol-node/Chart.yaml | 2 +- .../graphprotocol-node/templates/ingress.yaml | 38 +++++++++++++++++++ charts/graphprotocol-node/values.schema.json | 23 +++++++++++ charts/graphprotocol-node/values.yaml | 12 ++++++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/charts/graphprotocol-node/Chart.yaml b/charts/graphprotocol-node/Chart.yaml index 0d0c72d..d732c54 100644 --- a/charts/graphprotocol-node/Chart.yaml +++ b/charts/graphprotocol-node/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: graphprotocol-node description: A Helm chart for Graph Protocol Nodes type: application -version: 0.1.7 +version: 0.1.8 keywords: - graphprotocol - ethereum diff --git a/charts/graphprotocol-node/templates/ingress.yaml b/charts/graphprotocol-node/templates/ingress.yaml index 20b3c5e..054ba51 100644 --- a/charts/graphprotocol-node/templates/ingress.yaml +++ b/charts/graphprotocol-node/templates/ingress.yaml @@ -106,3 +106,41 @@ spec: servicePort: graphql-ws {{- end }} {{- end }} + +--- +{{- if .Values.ingressIndex.enabled -}} +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: {{ include "graphprotocol-node.fullname" . }}-index + labels: + {{- include "graphprotocol-node.labels" . | nindent 4 }} + {{- with .Values.ingressIndex.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingressIndex.tls }} + tls: + {{- range .Values.ingressIndex.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingressIndex.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "graphprotocol-node.fullname" $ }} + port: + number: 8030 + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/graphprotocol-node/values.schema.json b/charts/graphprotocol-node/values.schema.json index 6cb54fd..67dcea6 100644 --- a/charts/graphprotocol-node/values.schema.json +++ b/charts/graphprotocol-node/values.schema.json @@ -258,6 +258,29 @@ } } }, + "ingressIndex": { + "type": "object", + "required": [ + "enabled", + "annotations", + "hosts", + "tls" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "hosts": { + "type": "array" + }, + "tls": { + "type": "array" + } + } + }, "ingressWebsocket": { "type": "object", "required": [ diff --git a/charts/graphprotocol-node/values.yaml b/charts/graphprotocol-node/values.yaml index 7542b9c..f76931f 100644 --- a/charts/graphprotocol-node/values.yaml +++ b/charts/graphprotocol-node/values.yaml @@ -109,6 +109,18 @@ ingressRpc: # hosts: # - chart-example.local +ingressIndex: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + # - host: chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + ingressWebsocket: enabled: false annotations: {}