Skip to content

Commit

Permalink
add default ingress rule
Browse files Browse the repository at this point in the history
  • Loading branch information
BulatSaif committed Jun 4, 2024
1 parent 8f17629 commit 29b803f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: node
description: A Helm chart to deploy Substrate/Polkadot nodes
type: application
version: 5.8.0
version: 5.9.0
maintainers:
- name: Parity
url: https://github.com/paritytech/helm-charts
Expand Down
7 changes: 4 additions & 3 deletions charts/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch

# Substrate/Polkadot node Helm chart

![Version: 5.8.0](https://img.shields.io/badge/Version-5.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 5.9.0](https://img.shields.io/badge/Version-5.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## Maintainers

Expand Down Expand Up @@ -302,10 +302,11 @@ If you're running a collator node:
| image.repository | string | `"parity/polkadot"` | Image repository |
| image.tag | string | `"latest"` | Image tag |
| imagePullSecrets | list | `[]` | Reference to one or more secrets to be used when pulling images. ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ |
| ingress | object | `{"annotations":{},"enabled":false,"rules":[],"tls":[]}` | Creates an ingress resource |
| ingress | object | `{"annotations":{},"enabled":false,"host":"chart-example.local","rules":[],"tls":[]}` | Creates an ingress resource |
| ingress.annotations | object | `{}` | Annotations to add to the Ingress |
| ingress.enabled | bool | `false` | Enable creation of Ingress |
| ingress.rules | list | `[]` | Ingress rules configuration |
| ingress.host | string | `"chart-example.local"` | hostname used for default rpc ingress rule, if .Values.ingress.rules is set host is not used. |
| ingress.rules | list | `[]` | Ingress rules configuration, empty = default rpc rule (send all requests to rps port) |
| ingress.tls | list | `[]` | Ingress TLS configuration |
| initContainers | object | `{"downloadChainSnapshot":{"cmdArgs":"","debug":false,"extraEnvVars":[],"image":{"repository":"docker.io/rclone/rclone","tag":"latest"},"resources":{}},"downloadChainspec":{"debug":false,"image":{"repository":"docker.io/alpine","tag":"latest"},"resources":{}},"downloadRuntime":{"debug":false,"image":{"repository":"paritytech/kubetools-kubectl","tag":"latest"},"resources":{}},"injectKeys":{"debug":false,"resources":{}},"persistGeneratedNodeKey":{"debug":false,"resources":{}},"retrieveServiceInfo":{"debug":false,"image":{"repository":"paritytech/kubetools-kubectl","tag":"latest"},"resources":{}}}` | Additional init containers |
| initContainers.downloadChainSnapshot.cmdArgs | string | `""` | Flags to add to the CLI command. We rely on rclone for downloading snapshots so make sure the flags are compatible. |
Expand Down
17 changes: 15 additions & 2 deletions charts/node/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,21 @@ metadata:
spec:
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
rules:
{{- with .Values.ingress.rules }}
{{- toYaml . | nindent 6 }}
{{- if .Values.ingress.rules }}
{{- with .Values.ingress.rules }}
{{- (tpl (toYaml .) $) | nindent 6 }}
{{- end }}
{{- else }}
- host: "{{ .Values.ingress.host }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ .Values.node.perNodeServices.apiService.rpcPort }}
{{- end }}
tls:
{{- with .Values.ingress.tls }}
Expand Down
4 changes: 3 additions & 1 deletion charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ ingress:
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# -- Ingress rules configuration
# -- hostname used for default rpc ingress rule, if .Values.ingress.rules is set host is not used.
host: chart-example.local
# -- Ingress rules configuration, empty = default rpc rule (send all requests to rps port)
rules: []
# - host: chart-example.local
# paths:
Expand Down

0 comments on commit 29b803f

Please sign in to comment.