-
Notifications
You must be signed in to change notification settings - Fork 8
Initial changes for KEDA - Pod Autoscaling #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
adde143
9e5d2ae
e289f25
9efd86e
63308b9
dfa3dc1
871f2eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| {{- if .Values.models }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we add a |
||
| {{- $fullname := include "pecan.fullname" . }} | ||
| {{- range $key, $val := .Values.models }} | ||
| {{- if .enabled }} | ||
| --- | ||
| apiVersion: keda.sh/v1alpha1 | ||
| kind: ScaledObject | ||
| metadata: | ||
| name: "{{ $fullname }}-model-{{ $key }}-scaledobject" | ||
| namespace: default | ||
| spec: | ||
| scaleTargetRef: | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: {{ $fullname }}-model-{{ $key }} | ||
| envSourceContainerName: {{ $.Chart.Name }}-model-{{ $key }} | ||
| minReplicaCount: {{ .minReplicaCount }} | ||
| maxReplicaCount: {{ .maxReplicaCount }} | ||
| triggers: | ||
| - type: rabbitmq | ||
| metadata: | ||
| protocol: http | ||
| queueName: "{{ .queuename }}" | ||
| mode: MessageRate | ||
| value: "10" | ||
| vhostName: / | ||
| authenticationRef: | ||
| name: {{ $.Values.keda.rabbitmq.name }}-triger-auth | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ .Values.keda.rabbitmq.name }}-secret | ||
| data: | ||
| host: {{ .Values.keda.rabbitmq.host }} # base64 encoded value of connection string | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we can use: |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: keda.sh/v1alpha1 | ||
| kind: TriggerAuthentication | ||
| metadata: | ||
| name: {{ .Values.keda.rabbitmq.name }}-triger-auth | ||
| namespace: default | ||
| spec: | ||
| secretTargetRef: | ||
| - parameter: host | ||
| name: {{ .Values.keda.rabbitmq.name }}-secret | ||
| key: host |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,22 +56,37 @@ models: | |
| enabled: true | ||
| image: model-biocro-0.95 | ||
| replicaCount: 1 | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 5 | ||
| queuename: BIOCRO_0.95 | ||
| ed2-2-2-0: | ||
| enabled: true | ||
| image: model-ed2-2.2.0 | ||
| replicaCount: 1 | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 5 | ||
| queuename: ED2_2.2.0 | ||
| maespa-git: | ||
| enabled: true | ||
| image: model-maespa-git | ||
| replicaCount: 1 | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 5 | ||
| queuename: MAESPA_git | ||
| sipnet-git: | ||
| enabled: true | ||
| image: model-sipnet-git | ||
| replicaCount: 1 | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 5 | ||
| queuename: SIPNET_git | ||
| sipnet-136: | ||
| enabled: true | ||
| image: model-sipnet-r136 | ||
| replicaCount: 1 | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 5 | ||
| queuename: SIPNET_r136 | ||
|
|
||
| ## ------------------------------------------------------------------------------- | ||
| ## BETYDB APPLICATION | ||
|
|
@@ -346,3 +361,15 @@ affinity: {} | |
| ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity | ||
| hooks: | ||
| affinity: {} | ||
|
|
||
| ## ------------------------------------------------------------------------------- | ||
| ## KEDA RabbitMQ Configuration | ||
| ## ------------------------------------------------------------------------------- | ||
|
|
||
| keda: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add an enabled here (default false), so we can use that to add the keda pieces. |
||
| rabbitmq: | ||
| name: "rabbitmq" | ||
| ## Base64 rabbitmq host path in the form of PROTOCOL://<RABBITMQ_USER>:RABBITMQ_PASSWORD@RABBITMQ_HOST/vhost | ||
| ## e.g. echo -n 'http://guest:guest@pecan-rabbitmq.default:15672//' | base64 | ||
| host: aHR0cDovL2d1ZXN0Omd1ZXN0QHBlY2FuLXJhYmJpdG1xLmRlZmF1bHQ6MTU2NzIvLw== | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of hardcoding it in the url, can we compute this in the secret? |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we create a subsection and for auto-scaling. And explain that for this to work they need to install keda first, and enable it in the pecan helm chart as well.