Skip to content

Commit

Permalink
chore: add support to allow tolerations for pods (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagan-jaya authored Jan 24, 2025
1 parent b8f5d7f commit bd0a1cd
Show file tree
Hide file tree
Showing 29 changed files with 1,139 additions and 816 deletions.
2 changes: 1 addition & 1 deletion charts/incubator/hyperswitch-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 1.16.0
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.
name: hyperswitch-app
type: application
version: 0.2.0
version: 0.2.1
dependencies:
- name: redis
version: 18.6.1
Expand Down
746 changes: 395 additions & 351 deletions charts/incubator/hyperswitch-app/README.md

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ spec:
app: {{ .Values.application.consumer.labels.app }}
version: consumer-v1o112o0
spec:
{{- with (default .Values.application.global.tolerations .Values.application.consumer.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.affinity .Values.application.consumer.affinity) }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
{{- with (default .Values.application.global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution .Values.application.consumer.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution) }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.nodeSelector .Values.application.consumer.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- include "postgresql.initContainer.check.ready" . | nindent 8 }}
{{- if .Values.redisMiscConfig.checkRedisIsUp.initContainer.enable }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ spec:
app: {{ .Values.application.controlCenter.labels.app }}
version: v1o34o2
spec:
{{- with (default .Values.application.global.tolerations .Values.application.controlCenter.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.affinity .Values.application.controlCenter.affinity) }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
{{- with (default .Values.application.global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution .Values.application.controlCenter.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution) }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.nodeSelector .Values.application.controlCenter.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: hyperswitch-control-center
image: {{ .Values.services.controlCenter.image }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ spec:
template:
spec:
restartPolicy: OnFailure
{{- with (default .Values.application.global.tolerations .Values.application.server.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.affinity .Values.application.server.affinity) }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.nodeSelector .Values.application.server.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- include "postgresql.initContainer.check.ready" . | nindent 8 }}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ spec:
checksum/producer-secret: {{ include (print $.Template.BasePath "/producer/secret.yaml") . | sha256sum }}
checksum/misc-secrets: {{ include (print $.Template.BasePath "/misc/secrets.yaml") . | sha256sum }}
spec:
{{- with (default .Values.application.global.tolerations .Values.application.producer.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.affinity .Values.application.producer.affinity) }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
{{- with (default .Values.application.global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution .Values.application.producer.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution) }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.nodeSelector .Values.application.producer.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- include "postgresql.initContainer.check.ready" . | nindent 8 }}
{{- if .Values.redisMiscConfig.checkRedisIsUp.initContainer.enable }}
Expand Down
16 changes: 11 additions & 5 deletions charts/incubator/hyperswitch-app/templates/router/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ spec:
app: {{ .Values.application.server.labels.app }}
version: v1o112o0
spec:
{{- with (default .Values.application.global.tolerations .Values.application.server.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.affinity .Values.application.server.affinity) }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
{{- with (default .Values.application.global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution .Values.application.server.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution) }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.application.global.nodeSelector .Values.application.server.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- include "postgresql.initContainer.check.ready" . | nindent 8 }}
{{- if .Values.redisMiscConfig.checkRedisIsUp.initContainer.enable }}
Expand Down
106 changes: 64 additions & 42 deletions charts/incubator/hyperswitch-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@ application:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
# tolerations to be used by the application
tolerations: []
# Specify affinity for nodes to which the pods should start on
# @ignored
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
# nodeSelector to be used by the application
nodeSelector: {}
# -- The time kubernetes will wait after sending the termination signal to the pods
terminationGracePeriodSeconds: 30
# -- Annotations that are to be added to the pods
Expand Down Expand Up @@ -123,14 +128,15 @@ application:
timeoutSeconds: 1
# Specify affinity for nodes to which the pods should start on
# @ignored
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
# -- The time kubernetes will wait after sending the termination signal to the pods
terminationGracePeriodSeconds: 30
# -- Annotations that are to be added to the pods (extends global configuration)
Expand Down Expand Up @@ -607,14 +613,15 @@ application:
type: RollingUpdate
# Specify affinity for nodes to which the pods should start on
# @ignored
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
# -- The time kubernetes will wait after sending the termination signal to the pods
# @ignored
terminationGracePeriodSeconds: 30
Expand Down Expand Up @@ -651,14 +658,15 @@ application:
type: RollingUpdate
# -- Specify affinity for nodes to which the pods should start on
# @ignored
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
# -- The time kubernetes will wait after sending the termination signal to the pods
terminationGracePeriodSeconds: 30
# -- Annotations that are to be added to the pods (extends global configuration)
Expand Down Expand Up @@ -692,14 +700,15 @@ application:
type: RollingUpdate
# -- Specify affinity for nodes to which the pods should start on
# @ignored
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- generic-compute
# -- The time kubernetes will wait after sending the termination signal to the pods
# @ignored
terminationGracePeriodSeconds: 30
Expand Down Expand Up @@ -816,6 +825,8 @@ application:
default__features__compliance_certificate: "false"
default__features__performance_monitor: "false"
default__features__pm_authentication_processor: "false"

# https://artifacthub.io/packages/helm/bitnami/redis
redis:
# -- - enable Bitnami redis sub-chart helm installation
# @section -- Dependencies configuration
Expand Down Expand Up @@ -863,6 +874,7 @@ redisMiscConfig:
image: docker.io/bitnami/redis:7.2.3-debian-11-r2
maxAttempt: 60

# https://artifacthub.io/packages/helm/bitnami/postgresql
postgresql:
# -- enable Bitnami postgresql sub-chart helm installation
# @section -- Dependencies configuration
Expand Down Expand Up @@ -972,10 +984,16 @@ autoscaling:

hyperswitch-card-vault:
enabled: true
global:
tolerations: []
postgresql:
primary:
tolerations: []
initDB:
checkPGisUp:
image: docker.io/bitnami/postgresql:16.1.0-debian-11-r18

# https://artifacthub.io/packages/helm/bitnami/kafka
kafka:
# -- Enable Bitnami Kafka sub-chart helm installation
# @section -- Dependencies configuration
Expand Down Expand Up @@ -1032,7 +1050,8 @@ kafka:
extraConfig: |
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
# https://github.com/bitnami/charts/blob/main/bitnami/clickhouse/values.yaml
clickhouse:
# -- Enable Bitnami Clickhouse sub-chart helm installation
# @section -- Dependencies configuration
Expand Down Expand Up @@ -1071,7 +1090,7 @@ clickhouse:
initContainers:
- name: clone-sql-scripts
image: alpine/git
command: ['sh', '-c', 'git clone --depth 1 --branch 2024.12.19.0 https://github.com/juspay/hyperswitch.git /scripts && cp /scripts/crates/analytics/docs/clickhouse/scripts/*.sql /docker-entrypoint-initdb.d/']
command: ['sh', '-c', 'git clone --depth 1 --branch main https://github.com/juspay/hyperswitch.git /scripts && cp /scripts/crates/analytics/docs/clickhouse/scripts/*.sql /docker-entrypoint-initdb.d/']
volumeMounts:
- name: initdb-scripts
mountPath: /docker-entrypoint-initdb.d
Expand All @@ -1084,6 +1103,7 @@ clickhouse:
- name: initdb-scripts
emptyDir: {}

# https://artifacthub.io/packages/helm/codecentric/mailhog
mailhog:
# -- Enable Bitnami Mailhog sub-chart helm installation for email testing
# @section -- Dependencies configuration
Expand All @@ -1092,6 +1112,7 @@ mailhog:
# @section -- Dependencies configuration
fullnameOverride: "mailhog"

# https://github.com/grafana/helm-charts/tree/main/charts/loki-stack
loki-stack:
loki:
# -- Enable Bitnami Loki sub-chart helm installation
Expand Down Expand Up @@ -1125,6 +1146,7 @@ loki-stack:
# @section -- Dependencies configuration
tag: 10.0.1

# https://artifacthub.io/packages/helm/vector/vector
vector:
# -- Enable Bitnami Vector sub-chart helm installation
# @section -- Dependencies configuration
Expand Down
10 changes: 8 additions & 2 deletions charts/incubator/hyperswitch-card-vault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ A Helm chart for creating Hyperswitch Card Vault
| external.postgresql.config.port | string | `nil` | |
| external.postgresql.config.username | string | `nil` | |
| external.postgresql.enabled | bool | `false` | |
| global.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"node-type"` | |
| global.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
| global.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"generic-compute"` | |
| global.annotations | object | `{}` | |
| global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution | list | `[]` | |
| global.tolerations | list | `[]` | |
| initDB.checkPGisUp.image | string | `"postgres:16-alpine3.19"` | |
| initDB.checkPGisUp.maxAttempt | int | `30` | |
| initDB.enable | bool | `true` | |
Expand All @@ -34,10 +37,13 @@ A Helm chart for creating Hyperswitch Card Vault
| postgresql.nameOverride | string | `"locker-db"` | |
| postgresql.primary.name | string | `""` | |
| postgresql.primary.resources.requests.cpu | string | `"100m"` | |
| postgresql.primary.tolerations | list | `[]` | |
| server.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key | string | `"node-type"` | |
| server.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator | string | `"In"` | |
| server.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0] | string | `"generic-compute"` | |
| server.annotations | object | `{}` | |
| server.extra.env | object | `{}` | |
| server.image | string | `"juspaydotin/hyperswitch-card-vault:v0.4.0"` | |
| server.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution | list | `[]` | |
| server.pod.annotations | object | `{}` | |
| server.secrets.locker_private_key | string | "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----" | To create this key pairs, follow the instructions provided here: </br> # Generating the private keys <pre>openssl genrsa -out locker-private-key.pem 2048</pre> <pre>openssl genrsa -out tenant-private-key.pem 2048</pre> # Generating the public keys </br> <pre>openssl rsa -in locker-private-key.pem -pubout -out locker-public-key.pem</pre> <pre>openssl rsa -in tenant-private-key.pem -pubout -out tenant-public-key.pem</pre> The private key for the locker from locker-private-key.pem |
| server.secrets.master_key | string | "master_key" | Optionally, you can run </br> <pre>cargo install --git https://github.com/juspay/hyperswitch-card-vault --root . && ./bin/utils master-key && rm ./bin/utils && rmdir ./bin</pre> |
Expand Down
18 changes: 12 additions & 6 deletions charts/incubator/hyperswitch-card-vault/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ spec:
labels:
app: hyperswitch-card-vault
spec:
{{- with (default .Values.global.tolerations .Values.server.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.global.affinity .Values.server.affinity) }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
{{- with (default .Values.global.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution .Values.server.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution) }}
nodeSelectorTerms:
{{- toYaml . | nindent 18 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with (default .Values.global.nodeSelector .Values.server.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}

containers:
- env:
- name: LOCKER__LOG__CONSOLE__ENABLED
Expand Down
Loading

0 comments on commit bd0a1cd

Please sign in to comment.