Skip to content

Commit 5fa2976

Browse files
committed
refactor: move hardcoded ingress configuration to values.yaml
1 parent 8acf5c5 commit 5fa2976

11 files changed

Lines changed: 759 additions & 486 deletions

File tree

charts/incubator/hyperswitch-app/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: 1.16.0
33
description: Hyperswitch is a community-led, open payments switch designed to empower digital businesses by providing fast, reliable, and affordable access to the best payments infrastructure.
44
name: hyperswitch-app
55
type: application
6-
version: 0.3.0-beta.3
6+
version: 0.3.1-beta.1
77
dependencies:
88
- name: redis
99
version: 18.6.1

charts/incubator/hyperswitch-app/README.md

Lines changed: 556 additions & 429 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,61 @@
11
{{- if and .Values.services.router.enabled .Values.server.ingress.enabled}}
2+
{{- $name := include "hyperswitch-server.name" . -}}
3+
{{- $svcPort := .Values.server.service.ports.http -}}
4+
{{- if and .Values.server.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.server.ingress.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.server.ingress.annotations "kubernetes.io/ingress.class" .Values.server.ingress.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
210
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
316
kind: Ingress
417
metadata:
5-
name: hyperswitch-alb-ingress
6-
namespace: {{ .Release.Namespace }}
18+
name: {{ $name }}
19+
labels:
20+
{{- include "hyperswitch.labels" . | nindent 4 }}
21+
{{- with .Values.server.ingress.annotations }}
722
annotations:
8-
alb.ingress.kubernetes.io/backend-protocol: HTTP
9-
alb.ingress.kubernetes.io/backend-protocol-version: HTTP1
10-
alb.ingress.kubernetes.io/group.name: hyperswitch-alb-ingress-group
11-
alb.ingress.kubernetes.io/healthcheck-interval-seconds: "5"
12-
alb.ingress.kubernetes.io/healthcheck-path: /health
13-
alb.ingress.kubernetes.io/healthcheck-port: "8080"
14-
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
15-
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "2"
16-
alb.ingress.kubernetes.io/healthy-threshold-count: "5"
17-
alb.ingress.kubernetes.io/ip-address-type: ipv4
18-
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
19-
alb.ingress.kubernetes.io/load-balancer-name: hyperswitch
20-
alb.ingress.kubernetes.io/scheme: internet-facing
21-
alb.ingress.kubernetes.io/security-groups: {{ .Values.loadBalancer.targetSecurityGroup }}
22-
alb.ingress.kubernetes.io/tags: stack=hyperswitch-lb
23-
alb.ingress.kubernetes.io/target-type: ip
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
2425
spec:
25-
ingressClassName: alb
26+
{{- if and .Values.server.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.server.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.server.ingress.tls }}
30+
tls:
31+
{{- range .Values.server.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
2639
rules:
27-
- http:
40+
{{- range .Values.server.ingress.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
2843
paths:
29-
- path: /
30-
pathType: Prefix
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
3149
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
3251
service:
33-
name: {{ include "hyperswitch-server.name" . }}
52+
name: {{ $name }}
3453
port:
35-
number: 80
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $name }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
3661
{{- end }}

charts/incubator/hyperswitch-app/templates/router/service.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ spec:
1111
ipFamilyPolicy: SingleStack
1212
ports:
1313
- name: http
14-
port: 80
14+
port: {{ .Values.server.service.ports.http }}
1515
protocol: TCP
1616
targetPort: 8080
1717
- name: https
18-
port: 443
18+
port: {{ .Values.server.service.ports.https }}
1919
protocol: TCP
2020
targetPort: 8080
2121
selector:
2222
app: {{ include "hyperswitch-server.name" . }}
2323
app.kubernetes.io/instance: {{ .Release.Name }}
2424
sessionAffinity: None
25-
type: ClusterIP
25+
type: {{ .Values.server.service.type }}
2626
{{- end }}

charts/incubator/hyperswitch-app/values.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,45 @@ _references:
129129
server:
130130
# -- Number of replicas to be used for the application
131131
replicas: 1
132-
# Ingress Configurations for hyperswitch router
132+
# -- Ingress configuration
133+
# @section -- hyperswitch router
133134
ingress:
135+
# -- Enable ingress controller resource
136+
# @section -- hyperswitch router
134137
enabled: false
138+
# -- IngressClass that will be used to implement the Ingress
139+
# @section -- hyperswitch router
140+
className: ""
141+
# -- Additional annotations for the Ingress resource
142+
# @section -- hyperswitch router
143+
annotations:
144+
{}
145+
# kubernetes.io/ingress.class: nginx
146+
# kubernetes.io/tls-acme: "true"
147+
# -- An array with hostname(s) to be covered with the ingress record
148+
# @section -- hyperswitch router
149+
hosts:
150+
- host: hyperswitch-server.local
151+
paths:
152+
- path: /
153+
pathType: ImplementationSpecific
154+
# -- TLS configuration for hostname(s) to be covered with this ingress record
155+
# @section -- hyperswitch router
156+
tls: []
157+
# - secretName: chart-example-tls
158+
# hosts:
159+
# - chart-example.local
160+
161+
# -- Service configuration
162+
# @section -- hyperswitch router
163+
service:
164+
# -- service type
165+
type: ClusterIP
166+
# -- service ports
167+
ports:
168+
http: 80
169+
https: 443
170+
135171
# Wait time allowed for the deployment before the deployment is marked as failed
136172
progressDeadlineSeconds: 600
137173
# The strategy that can be used to replace the old pods by new ones

charts/incubator/hyperswitch-control-center/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ After deployment, verify the Control Center is working:
133133
| config.default.endpoints.logo_url | string | `""` | |
134134
| config.default.endpoints.mixpanel_token | string | `"dd4da7f62941557e716fbc0a19f9cc7e"` | |
135135
| config.default.endpoints.recon_iframe_url | string | `""` | |
136-
| config.default.features.audit_trail | string | `"false"` | |
137136
| config.default.features.authentication_analytics | string | `"false"` | |
138137
| config.default.features.branding | string | `"false"` | |
139138
| config.default.features.compliance_certificate | string | `"true"` | |
@@ -197,8 +196,9 @@ After deployment, verify the Control Center is working:
197196
| config.default.theme.sidebar_secondary | string | `"#FFFFFF"` | |
198197
| config.default.theme.sidebar_secondary_text_color | string | `"#525866"` | |
199198
| config.mixpanelToken | string | `"dd4da7f62941557e716fbc0a19f9cc7e"` | |
200-
| dependencies.clickhouse.enabled | string | `"false"` | |
199+
| dependencies.clickhouse.enabled | bool | `false` | |
201200
| dependencies.router.host | string | `"http://localhost:8080"` | |
201+
| dependencies.sdk.fullUrlOverride | string | `""` | |
202202
| dependencies.sdk.host | string | `"http://localhost:9050"` | |
203203
| dependencies.sdk.subversion | string | `"v1"` | |
204204
| dependencies.sdk.version | string | `"0.126.0"` | |
@@ -208,7 +208,7 @@ After deployment, verify the Control Center is working:
208208
| image.pullPolicy | string | `"IfNotPresent"` | |
209209
| image.registry | string | `"docker.juspay.io"` | |
210210
| image.repository | string | `"juspaydotin/hyperswitch-control-center"` | |
211-
| image.tag | string | `""` | |
211+
| image.tag | string | `"v1.37.4"` | |
212212
| imagePullSecrets | list | `[]` | |
213213
| ingress.annotations | object | `{}` | |
214214
| ingress.className | string | `""` | |

charts/incubator/hyperswitch-web/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ description: |-
1212
assets
1313
1414
type: application
15-
version: 0.2.14
15+
version: 0.2.15
1616
appVersion: "0.126.0"

charts/incubator/hyperswitch-web/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# hyperswitch-web
22

3-
![Version: 0.2.14](https://img.shields.io/badge/Version-0.2.14-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.126.0](https://img.shields.io/badge/AppVersion-0.126.0-informational?style=flat-square)
3+
![Version: 0.2.15](https://img.shields.io/badge/Version-0.2.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.126.0](https://img.shields.io/badge/AppVersion-0.126.0-informational?style=flat-square)
44

55
Helm chart for Hyperswitch SDK static Server. This chart allow end user to deploy standalone
66
[SDK](https://github.com/juspay/hyperswitch-web) with different way:
@@ -13,6 +13,20 @@ assets
1313

1414
## Values
1515

16+
### hyperswitch sdkDemo
17+
18+
| Key | Type | Default | Description |
19+
|-----|------|---------|-------------|
20+
| sdkDemo.ingress | object | `{"annotations":{},"className":"","enabled":true,"hosts":[{"host":"hyperswitch-sdk-demo.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | Ingress configuration |
21+
| sdkDemo.ingress.annotations | object | `{}` | Additional annotations for the Ingress resource |
22+
| sdkDemo.ingress.className | string | `""` | IngressClass that will be used to implement the Ingress |
23+
| sdkDemo.ingress.enabled | bool | `true` | Enable ingress controller resource |
24+
| sdkDemo.ingress.hosts | list | `[{"host":"hyperswitch-sdk-demo.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | An array with hostname(s) to be covered with the ingress record |
25+
| sdkDemo.ingress.tls | list | `[]` | TLS configuration for hostname(s) to be covered with this ingress record |
26+
| sdkDemo.service | object | `{"ports":{"http":80,"https":443},"type":"ClusterIP"}` | Service configuration |
27+
28+
### Other Values
29+
1630
| Key | Type | Default | Description |
1731
|-----|------|---------|-------------|
1832
| autoBuild.buildParam.disableCSP | string | `"false"` | |
@@ -59,6 +73,8 @@ assets
5973
| sdkDemo.podAnnotations.traffic_sidecar_istio_io_excludeOutboundIPRanges | string | `"10.23.6.12/32"` | |
6074
| sdkDemo.progressDeadlineSeconds | int | `600` | |
6175
| sdkDemo.replicas | int | `1` | |
76+
| sdkDemo.service.ports | object | `{"http":80,"https":443}` | service ports |
77+
| sdkDemo.service.type | string | `"ClusterIP"` | service type |
6278
| sdkDemo.serviceAccountAnnotations."eks.amazonaws.com/role-arn" | string | `nil` | |
6379
| sdkDemo.strategy.rollingUpdate.maxSurge | int | `1` | |
6480
| sdkDemo.strategy.rollingUpdate.maxUnavailable | int | `0` | |
Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,61 @@
1-
{{- if .Values.sdkDemo.enabled }}
1+
{{- if and .Values.sdkDemo.enabled .Values.sdkDemo.ingress.enabled}}
2+
{{- $fullName := .Values.sdkDemo.labels.app -}}
3+
{{- $svcPort := .Values.sdkDemo.service.ports.http -}}
4+
{{- if and .Values.sdkDemo.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.sdkDemo.ingress.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.sdkDemo.ingress.annotations "kubernetes.io/ingress.class" .Values.sdkDemo.ingress.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
210
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
316
kind: Ingress
417
metadata:
5-
name: "{{ .Values.sdkDemo.labels.app }}-ingress"
6-
namespace: hyperswitch
18+
name: {{ $fullName }}
19+
labels:
20+
{{- include "sdk.labels" . | nindent 4 }}
21+
{{- with .Values.sdkDemo.ingress.annotations }}
722
annotations:
8-
alb.ingress.kubernetes.io/backend-protocol: HTTP
9-
alb.ingress.kubernetes.io/backend-protocol-version: HTTP1
10-
alb.ingress.kubernetes.io/group.name: "{{ .Values.sdkDemo.labels.app }}-alb-ingress-group"
11-
alb.ingress.kubernetes.io/ip-address-type: ipv4
12-
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
13-
alb.ingress.kubernetes.io/load-balancer-name: {{ .Values.sdkDemo.labels.app }}
14-
alb.ingress.kubernetes.io/scheme: internet-facing
15-
alb.ingress.kubernetes.io/security-groups: {{ .Values.loadBalancer.targetSecurityGroup }}
16-
alb.ingress.kubernetes.io/tags: stack=hyperswitch-lb
17-
alb.ingress.kubernetes.io/target-type: ip
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
1825
spec:
19-
ingressClassName: alb
26+
{{- if and .Values.sdkDemo.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.sdkDemo.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.sdkDemo.ingress.tls }}
30+
tls:
31+
{{- range .Values.sdkDemo.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
2039
rules:
21-
- http:
40+
{{- range .Values.sdkDemo.ingress.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
2243
paths:
23-
- path: /
24-
pathType: Prefix
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
2549
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
2651
service:
27-
name: {{ .Values.sdkDemo.labels.app }}
52+
name: {{ $fullName }}
2853
port:
29-
number: 80
30-
{{- end }}
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $fullName }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}

charts/incubator/hyperswitch-web/templates/sdk-demo-app/service.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ spec:
1111
ipFamilyPolicy: SingleStack
1212
ports:
1313
- name: http
14-
port: 80
14+
port: {{ .Values.sdkDemo.service.ports.http }}
1515
protocol: TCP
1616
targetPort: 5252
1717
- name: https
18-
port: 443
18+
port: {{ .Values.sdkDemo.service.ports.https }}
1919
protocol: TCP
2020
targetPort: 5252
2121
selector:
2222
app: {{ .Values.sdkDemo.labels.app }}
2323
sessionAffinity: None
2424
type: ClusterIP
25-
{{- end }}
25+
{{- end }}

0 commit comments

Comments
 (0)