-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature:
ingress
directive in config file (#401)
* add ingress in config file * add ingress rule for hermes relayer * fix typo in if condition
- Loading branch information
Showing
7 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.ingress.enabled }} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ .Values.ingress.certManager.issuer }} | ||
spec: | ||
acme: | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
email: [email protected] | ||
privateKeySecretRef: | ||
name: {{ .Values.ingress.certManager.issuer }} | ||
solvers: | ||
## todo: move to DNS01 solver for wildcard dns | ||
## https://stackoverflow.com/questions/66051624/generate-wildcard-certificate-on-kubernetes-cluster-with-digitalocean-for-my-ngi | ||
- http01: | ||
ingress: | ||
class: {{ .Values.ingress.type }} | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{{- if .Values.ingress.enabled }} | ||
{{ $host := $.Values.ingress.host | replace "*." "" }} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ .Values.ingress.type }}-ingress | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1 | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
cert-manager.io/issuer: "{{ .Values.ingress.certManager.issuer }}" | ||
spec: | ||
ingressClassName: {{ .Values.ingress.type }} | ||
tls: | ||
## todo: use DNS01 issuer for wildcard certs, else this list will keep growing with number of validators and chains | ||
## https://stackoverflow.com/questions/66051624/generate-wildcard-certificate-on-kubernetes-cluster-with-digitalocean-for-my-ngi | ||
{{- if .Values.explorer.enabled }} | ||
- hosts: | ||
- "explorer.{{ $host }}" | ||
secretName: explorer.{{ .Values.ingress.type }}-ingress-tls | ||
{{- end }} | ||
{{- if .Values.registry.enabled }} | ||
- hosts: | ||
- "registry.{{ $host }}" | ||
secretName: registry.{{ .Values.ingress.type }}-ingress-tls | ||
{{- end }} | ||
{{- range $chain := .Values.chains }} | ||
- hosts: | ||
- "rest.{{ $chain.name }}-genesis.{{ $host }}" | ||
secretName: rest.{{ $chain.name }}-genesis.{{ .Values.ingress.type }}-ingress-tls | ||
- hosts: | ||
- "rpc.{{ $chain.name }}-genesis.{{ $host }}" | ||
secretName: rpc.{{ $chain.name }}-genesis.{{ .Values.ingress.type }}-ingress-tls | ||
{{- end }} | ||
rules: | ||
{{- if .Values.explorer.enabled }} | ||
- host: "explorer.{{ $host }}" | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
path: "/(.*)" | ||
backend: | ||
service: | ||
name: explorer | ||
port: | ||
name: http | ||
{{- end }} | ||
{{- if .Values.registry.enabled }} | ||
- host: "registry.{{ $host }}" | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
path: "/(.*)" | ||
backend: | ||
service: | ||
name: registry | ||
port: | ||
name: http | ||
{{- end }} | ||
{{- range $chain := .Values.chains }} | ||
- host: "rest.{{ $chain.name }}-genesis.{{ $host }}" | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
path: "/(.*)" | ||
backend: | ||
service: | ||
name: {{ $chain.name }}-genesis | ||
port: | ||
name: rest | ||
- pathType: ImplementationSpecific | ||
path: "/faucet/(.*)" | ||
backend: | ||
service: | ||
name: {{ $chain.name }}-genesis | ||
port: | ||
name: faucet | ||
- pathType: ImplementationSpecific | ||
path: "/exposer/(.*)" | ||
backend: | ||
service: | ||
name: {{ $chain.name }}-genesis | ||
port: | ||
name: exposer | ||
- host: "rpc.{{ $chain.name }}-genesis.{{ $host }}" | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
path: "/(.*)" | ||
backend: | ||
service: | ||
name: {{ $chain.name }}-genesis | ||
port: | ||
name: rpc | ||
{{- end }} | ||
{{- range $relayer := .Values.relayers }} | ||
{{- if eq $relayer.type "hermes" }} | ||
- host: "rest.{{ $relayer.type }}-{{ $relayer.name }}.{{ $host }}" | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
path: "/(.*)" | ||
backend: | ||
service: | ||
name: {{ $relayer.type }}-{{ $relayer.name }} | ||
port: | ||
name: rest | ||
- pathType: ImplementationSpecific | ||
path: "/exposer/(.*)" | ||
backend: | ||
service: | ||
name: {{ $relayer.type }}-{{ $relayer.name }} | ||
port: | ||
name: exposer | ||
{{- end }} | ||
{{- end }} | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters