Skip to content

Commit

Permalink
BC-5170 - add scaled object
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenWaysDP committed Oct 13, 2023
1 parent 1c63d61 commit c827105
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ansible/roles/schulcloud-server-core/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,9 @@
namespace: "{{ NAMESPACE }}"
template: preview-generator-onepassword.yml.j2
when: ONEPASSWORD_OPERATOR is defined and ONEPASSWORD_OPERATOR|bool

- name: PreviewGeneratorScaledObject
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: preview-generator-scaled-object.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: keda-secret
namespace: {{ NAMESPACE }}
labels:
app: keda
spec:
itemPath: "vaults/{{ ONEPASSWORD_OPERATOR_VAULT }}/items/keda"
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-rabbitmq-conn
namespace: {{ NAMESPACE }}
spec:
secretTargetRef:
- parameter: host
name: keda-secret
key: amqp-url
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: rabbitmq-scaledobject
namespace: {{ NAMESPACE }}
spec:
scaleTargetRef:
name: preview-generator-deployment
pollingInterval: 1
cooldownPeriod: 300
idleReplicaCount: 0
minReplicaCount: 0
maxReplicaCount: 1
triggers:
- type: rabbitmq
metadata:
protocol: amqp
queueName: generate-preview
mode: QueueLength
value: "1"
authenticationRef:
name: keda-trigger-auth-rabbitmq-conn

0 comments on commit c827105

Please sign in to comment.