Skip to content

Commit

Permalink
feat(#3): support setting replicas and memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Feb 2, 2024
1 parent 906f509 commit 7431b9b
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/eurofurence-registration-system/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: eurofurence-registration-system
version: 0.0.23
version: 0.0.24
description: A helm chart that can deploy the Eurofurence Registration System.
type: application
home: https://github.com/eurofurence/reg-helm-chart
4 changes: 2 additions & 2 deletions charts/eurofurence-registration-system/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ metadata:
{{- $mergedLabels := merge .component.labels .all.system.labels }}
{{- $mergedLabels | toYaml | nindent 4 }}
spec:
replicas: 1
replicas: {{ .component.replicas }}
revisionHistoryLimit: 3
selector:
matchLabels:
Expand Down Expand Up @@ -69,7 +69,7 @@ spec:
timeoutSeconds: 1
resources:
limits:
memory: 512Mi
memory: {{ .component.limits.memory }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ tests:
enable: true
regsys_classic:
enable: true
docker:
tag: v0.1
replicas: 2
limits:
memory: 4444Mi
frontend:
enable: true
asserts:
Expand Down Expand Up @@ -511,7 +516,7 @@ tests:
- equal:
path: spec
value:
replicas: 1
replicas: 2
revisionHistoryLimit: 3
selector:
matchLabels:
Expand All @@ -525,7 +530,7 @@ tests:
spec:
containers:
- name: application
image: 'ghcr.io/eurofurence/reg-regsys-classic:latest'
image: 'ghcr.io/eurofurence/reg-regsys-classic:v0.1'
ports:
- containerPort: 8080
name: primary
Expand All @@ -539,7 +544,7 @@ tests:
timeoutSeconds: 1
resources:
limits:
memory: 512Mi
memory: 4444Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
131 changes: 131 additions & 0 deletions charts/eurofurence-registration-system/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,24 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"description": "number of replicas to start",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -390,6 +408,25 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"maxValue": 1,
"description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -464,6 +501,24 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"description": "number of replicas to start",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -546,6 +601,25 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"maxValue": 1,
"description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -613,6 +687,25 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"maxValue": 1,
"description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -688,6 +781,25 @@
"description": "the prefix to use in the suggested subject (followed by nickname and badge number)"
}
}
},
"replicas": {
"type": "integer",
"minValue": 1,
"maxValue": 1,
"description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
},
Expand Down Expand Up @@ -726,6 +838,25 @@
"labels": {
"type": "object",
"additionalProperties": true
},
"replicas": {
"type": "integer",
"minValue": 1,
"maxValue": 1,
"description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment",
"default": 1
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory": {
"type": "string",
"description": "amount of maximum memory before getting OOM-killed",
"example": "512Mi",
"default": "512Mi"
}
}
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions charts/eurofurence-registration-system/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ system:
tag: latest
labels:
service: attendee-service
replicas: 1
limits:
memory: 512Mi

auth_service:
enable: true
Expand All @@ -54,6 +57,9 @@ system:
tag: latest
labels:
service: auth-service
replicas: 1 # do NOT increase before adding redis for in-memory flow cache
limits:
memory: 512Mi

mail_service:
enable: true
Expand All @@ -66,6 +72,9 @@ system:
tag: latest
labels:
service: mail-service
replicas: 1
limits:
memory: 512Mi

payment_cncrd_adapter:
enable: false
Expand All @@ -78,6 +87,9 @@ system:
tag: latest
labels:
service: payment-cncrd-adapter
replicas: 1
limits:
memory: 512Mi

payment_service:
enable: true
Expand All @@ -88,6 +100,9 @@ system:
tag: latest
labels:
service: payment-service
replicas: 1
limits:
memory: 512Mi

regsys_classic:
enable: true
Expand All @@ -98,6 +113,9 @@ system:
tag: latest
labels:
service: regsys-classic
replicas: 1
limits:
memory: 512Mi

frontend:
enable: true
Expand All @@ -107,6 +125,9 @@ system:
tag: latest
labels:
service: frontend
replicas: 1
limits:
memory: 512Mi

database:
use: 'inmemory'
Expand Down

0 comments on commit 7431b9b

Please sign in to comment.