Skip to content

staging: Deploy Arch lister & loader

Antoine R. Dumont requested to merge deploy-arch-stack into staging

Expectedly, this deploys the pods for arch lister and loader

make swh-helm-diff
[swh] Comparing changes between branches production and deploy-arch-stack (per environment)...
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment staging, namespace swh...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra-next-version...
[swh] Generate config in deploy-arch-stack branch for environment staging...
[swh] Generate config in deploy-arch-stack branch for environment staging...
[swh] Generate config in deploy-arch-stack branch for environment staging...
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment production, namespace swh...
[swh] Generate config in production branch for environment production, namespace swh-cassandra...
[swh] Generate config in production branch for environment production, namespace swh-cassandra-next-version...
[swh] Generate config in deploy-arch-stack branch for environment production...
[swh] Generate config in deploy-arch-stack branch for environment production...
[swh] Generate config in deploy-arch-stack branch for environment production...


------------- diff for environment staging namespace swh -------------

No differences


------------- diff for environment staging namespace swh-cassandra -------------

--- /tmp/swh-chart.swh.5OaWW6qA/staging-swh-cassandra.before    2023-11-10 15:41:24.319940035 +0100
+++ /tmp/swh-chart.swh.5OaWW6qA/staging-swh-cassandra.after     2023-11-10 15:41:24.975939046 +0100
@@ -690,20 +690,123 @@

     root:
       level: "INFO"
       handlers:
       - console
 ---
 # Source: swh/templates/loaders/configmap.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
+  name: loader-arch-template
+  namespace: swh-cassandra
+data:
+  config.yml.template: |
+    storage:
+      cls: pipeline
+      steps:
+      - cls: buffer
+        min_batch_size:
+          content: 100
+          content_bytes: 52428800
+          directory: 100
+          directory_entries: 500
+          extid: 100
+          release: 100
+          release_bytes: 52428800
+          revision: 100
+          revision_bytes: 52428800
+          revision_parents: 200
+      - cls: filter
+      - cls: retry
+      - cls: remote
+        url: http://storage:5002
+    celery:
+      task_broker: amqp://swhconsumer:${AMQP_PASSWORD}@scheduler0.internal.staging.swh.network:5672/%2f
+      task_acks_late: false
+      task_queues:
+      - swh.loader.package.arch.tasks.LoadArch
+
+      sentry_settings_for_celery_tasks:
+        __sentry-settings-for-celery-tasks__
+    metadata_fetcher_credentials:
+      __metadata-fetcher-credentials__
+  init-container-entrypoint.sh: |
+    #!/bin/bash
+
+    set -e
+
+    CONFIG_FILE=/etc/swh/config.yml
+    CONFIG_FILE_WIP=/tmp/wip-config.yml
+
+    # substitute environment variables when creating the default config.yml
+    eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \
+      > $CONFIG_FILE
+
+
+    SENTRY_SETTINGS_PATH=/etc/credentials/sentry-settings/sentry_settings_for_celery_tasks
+    if [ -f $SENTRY_SETTINGS_PATH ]; then
+      awk "/__sentry-settings-for-celery-tasks__/{system(\"sed 's/^/    /g' $SENTRY_SETTINGS_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__sentry-settings-for-celery-tasks__//g' $CONFIG_FILE
+    fi
+
+    CREDS_LISTER_PATH=/etc/credentials/metadata-fetcher/credentials
+    if [ -f $CREDS_LISTER_PATH ]; then
+      awk "/__metadata-fetcher-credentials__/{system(\"sed 's/^/  /g' $CREDS_LISTER_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__metadata-fetcher-credentials__//g' $CONFIG_FILE
+    fi
+
+    exit 0
+
+
+  logging-configuration.yml: |
+    version: 1
+
+    handlers:
+      console:
+        class: logging.StreamHandler
+        formatter: json
+        stream: ext://sys.stdout
+
+    formatters:
+      json:
+        class: pythonjsonlogger.jsonlogger.JsonFormatter
+        # python-json-logger parses the format argument to get the variables it actually expands into the json
+        format: "%(asctime)s:%(threadName)s:%(pathname)s:%(lineno)s:%(funcName)s:%(task_name)s:%(task_id)s:%(name)s:%(levelname)s:%(message)s"
+
+    loggers:
+      celery:
+        level: "INFO"
+      amqp:
+        level: WARNING
+      urllib3:
+        level: WARNING
+      azure.core.pipeline.policies.http_logging_policy:
+        level: WARNING
+      swh:
+        level: "INFO"
+      celery.task:
+        level: "INFO"
+
+    root:
+      level: "INFO"
+      handlers:
+      - console
+---
+# Source: swh/templates/loaders/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
   name: loader-archive-template
   namespace: swh-cassandra
 data:
   config.yml.template: |
     storage:
       cls: pipeline
       steps:
       - cls: buffer
         min_batch_size:
           content: 100
@@ -14971,20 +15074,186 @@
           secretName: sentry-settings-for-celery-tasks
           optional: true
 # if defined at the "typed" loader level
 # otherwise use the global image is defined First this needs to replace - in
 # $loader_type with "" to find the proper image name.
 ---
 # Source: swh/templates/loaders/deployment.yaml
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  name: loader-arch
+  namespace: swh-cassandra
+  labels:
+    app: loader-arch
+spec:
+  revisionHistoryLimit: 2
+  selector:
+    matchLabels:
+      app: loader-arch
+  strategy:
+    type: RollingUpdate
+    rollingUpdate:
+      maxSurge: 1
+  template:
+    metadata:
+      labels:
+        app: loader-arch
+      annotations:
+        # Force a rollout upgrade if the configuration changes
+        checksum/config: ba6f9b7d08a2034d03c34836ffafb9e3678d46c44144c1d92081d0677503826b
+    spec:
+      affinity:
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+            - matchExpressions:
+              - key: swh/loader
+                operator: In
+                values:
+                - "true"
+      priorityClassName: swh-cassandra-normal-workload
+
+      terminationGracePeriodSeconds: 3600
+      initContainers:
+        - name: prepare-configuration
+          image: debian:bullseye
+          imagePullPolicy: IfNotPresent
+          env:
+
+          - name: AMQP_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: amqp-secrets
+                key: swhconsumer-password
+                # 'name' secret must exist & include that ^ key
+                optional: false
+
+          command:
+            - /entrypoint.sh
+          volumeMounts:
+          - name: configuration-template
+            mountPath: /entrypoint.sh
+            subPath: "init-container-entrypoint.sh"
+            readOnly: true
+          - name: configuration
+            mountPath: /etc/swh
+          - name: configuration-template
+            mountPath: /etc/swh/configuration-template
+          - name: metadata-fetcher-credentials
+            mountPath: /etc/credentials/metadata-fetcher
+            readOnly: true
+
+          - name: sentry-settings-for-celery-tasks
+            mountPath: /etc/credentials/sentry-settings
+            readOnly: true
+      containers:
+      - name: loaders
+        image: container-registry.softwareheritage.org/swh/infra/swh-apps/loader_package:20231107.1
+
+        imagePullPolicy: IfNotPresent
+        command:
+          - /opt/swh/entrypoint.sh
+        resources:
+          requests:
+            memory: 512Mi
+            cpu: 500m
+        lifecycle:
+          preStop:
+            exec:
+              command: ["/pre-stop.sh"]
+        env:
+        - name: STATSD_HOST
+          value: prometheus-statsd-exporter
+        - name: STATSD_PORT
+          value: "9125"
+        - name: MAX_TASKS_PER_CHILD
+          value: "10"
+        - name: LOGLEVEL
+          value: "INFO"
+        - name: SWH_CONFIG_FILENAME
+          value: /etc/swh/config.yml
+        - name: SWH_LOG_CONFIG
+          value: /etc/swh/logging-configuration.yml
+
+
+        - name: SWH_SENTRY_ENVIRONMENT
+          value: staging
+        - name: SWH_SENTRY_DISABLE_LOGGING_EVENTS
+          value: "yes"
+        volumeMounts:
+          - name: loader-utils
+            mountPath: /pre-stop.sh
+            subPath: "pre-stop.sh"
+          - name: configuration
+            mountPath: /etc/swh
+          - name: localstorage
+            mountPath: /tmp
+
+          - name: configuration-template
+            mountPath: /etc/swh/logging-configuration.yml
+            subPath: "logging-configuration.yml"
+            readOnly: true
+
+      volumes:
+      - name: localstorage
+        ephemeral:
+          volumeClaimTemplate:
+            metadata:
+              labels:
+                type: ephemeral-volume
+            spec:
+              accessModes:
+              - ReadWriteOnce
+              resources:
+                requests:
+                  storage: 100Gi
+              storageClassName: local-path
+      - name: configuration
+        emptyDir: {}
+      - name: configuration-template
+        configMap:
+          name: loader-arch-template
+          defaultMode: 0777
+          items:
+          - key: "config.yml.template"
+            path: "config.yml.template"
+          - key: "init-container-entrypoint.sh"
+            path: "init-container-entrypoint.sh"
+
+          - key: "logging-configuration.yml"
+            path: "logging-configuration.yml"
+
+      - name: loader-utils
+        configMap:
+          name: loader-utils
+          defaultMode: 0777
+          items:
+          - key: "pre-stop-idempotent.sh"
+            path: "pre-stop.sh"
+      - name: metadata-fetcher-credentials
+        secret:
+          secretName: metadata-fetcher-credentials
+          optional: true
+
+      - name: sentry-settings-for-celery-tasks
+        secret:
+          secretName: sentry-settings-for-celery-tasks
+          optional: true
+# if defined at the "typed" loader level
+# otherwise use the global image is defined First this needs to replace - in
+# $loader_type with "" to find the proper image name.
+---
+# Source: swh/templates/loaders/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
   name: loader-archive
   namespace: swh-cassandra
   labels:
     app: loader-archive
 spec:
   revisionHistoryLimit: 2
   selector:
     matchLabels:
       app: loader-archive
   strategy:
@@ -21522,20 +21791,56 @@
       excludeUnacknowledged: "false" # QueueLength should include unacked messages
                                      # Implies "http" protocol is used
       value: "1"
       queueName: add_forge_now_slow:swh.loader.git.tasks.UpdateGitRepository
       vhostName: /                   # Vhost to use for the connection
 ---
 # Source: swh/templates/loaders/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
 kind: ScaledObject
 metadata:
+  name: loader-arch-operators
+  namespace: swh-cassandra
+spec:
+  scaleTargetRef:
+    apiVersion:    apps/v1     # Optional. Default: apps/v1
+    kind:          Deployment  # Optional. Default: Deployment
+    # Mandatory. Must be in same namespace as ScaledObject
+    name:          loader-arch
+    # envSourceContainerName: {container-name} # Optional. Default:
+                                               # .spec.template.spec.containers[0]
+  pollingInterval:  30                         # Optional. Default: 30 seconds
+  cooldownPeriod:   300                        # Optional. Default: 300 seconds
+  idleReplicaCount: 0                          # Set to 0 to stop all the workers when there is
+                                               # no activity on the queue
+  minReplicaCount:  0
+  maxReplicaCount:  1
+  triggers:
+  - type: rabbitmq
+    authenticationRef:
+      name: amqp-authentication-loader-arch
+    metadata:
+      protocol: auto                 # Optional. Specifies protocol to use,
+                                     # either amqp or http, or auto to
+                                     # autodetect based on the `host` value.
+                                     # Default value is auto.
+      mode: QueueLength              # QueueLength to trigger on number of msgs in queue
+      excludeUnacknowledged: "false" # QueueLength should include unacked messages
+                                     # Implies "http" protocol is used
+      value: "10"
+      queueName: swh.loader.package.arch.tasks.LoadArch
+      vhostName: /                   # Vhost to use for the connection
+---
+# Source: swh/templates/loaders/keda-autoscaling.yaml
+apiVersion: keda.sh/v1alpha1
+kind: ScaledObject
+metadata:
   name: loader-archive-operators
   namespace: swh-cassandra
 spec:
   scaleTargetRef:
     apiVersion:    apps/v1     # Optional. Default: apps/v1
     kind:          Deployment  # Optional. Default: Deployment
     # Mandatory. Must be in same namespace as ScaledObject
     name:          loader-archive
     # envSourceContainerName: {container-name} # Optional. Default:
                                                # .spec.template.spec.containers[0]
@@ -22958,20 +23263,32 @@
   namespace: swh-cassandra
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml
 apiVersion: keda.sh/v1alpha1
 kind: TriggerAuthentication
+metadata:
+  name: amqp-authentication-loader-arch
+  namespace: swh-cassandra
+spec:
+  secretTargetRef:
+  - parameter: host            # "host" is required by the scalerObject trigger metadata
+    name: common-secrets
+    key: rabbitmq-http-host
+---
+# Source: swh/templates/loaders/keda-authentication.yaml
+apiVersion: keda.sh/v1alpha1
+kind: TriggerAuthentication
 metadata:
   name: amqp-authentication-loader-archive
   namespace: swh-cassandra
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml


------------- diff for environment staging namespace swh-cassandra-next-version -------------

--- /tmp/swh-chart.swh.5OaWW6qA/staging-swh-cassandra-next-version.before       2023-11-10 15:41:24.531939715 +0100
+++ /tmp/swh-chart.swh.5OaWW6qA/staging-swh-cassandra-next-version.after        2023-11-10 15:41:25.187938727 +0100
@@ -484,20 +484,123 @@

     if [ ! -e $WITNESS_FILE ]; then
       touch $WITNESS_FILE
       kill 1
     fi
 ---
 # Source: swh/templates/loaders/configmap.yaml
 apiVersion: v1
 kind: ConfigMap
 metadata:
+  name: loader-arch-template
+  namespace: swh-cassandra-next-version
+data:
+  config.yml.template: |
+    storage:
+      cls: pipeline
+      steps:
+      - cls: buffer
+        min_batch_size:
+          content: 100
+          content_bytes: 52428800
+          directory: 100
+          directory_entries: 500
+          extid: 100
+          release: 100
+          release_bytes: 52428800
+          revision: 100
+          revision_bytes: 52428800
+          revision_parents: 200
+      - cls: filter
+      - cls: retry
+      - cls: remote
+        url: http://storage:5002
+    celery:
+      task_broker: amqp://swhconsumer:${AMQP_PASSWORD}@scheduler0.internal.staging.swh.network:5672/%2f
+      task_acks_late: false
+      task_queues:
+      - swh.loader.package.arch.tasks.LoadArch
+
+      sentry_settings_for_celery_tasks:
+        __sentry-settings-for-celery-tasks__
+    metadata_fetcher_credentials:
+      __metadata-fetcher-credentials__
+  init-container-entrypoint.sh: |
+    #!/bin/bash
+
+    set -e
+
+    CONFIG_FILE=/etc/swh/config.yml
+    CONFIG_FILE_WIP=/tmp/wip-config.yml
+
+    # substitute environment variables when creating the default config.yml
+    eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \
+      > $CONFIG_FILE
+
+
+    SENTRY_SETTINGS_PATH=/etc/credentials/sentry-settings/sentry_settings_for_celery_tasks
+    if [ -f $SENTRY_SETTINGS_PATH ]; then
+      awk "/__sentry-settings-for-celery-tasks__/{system(\"sed 's/^/    /g' $SENTRY_SETTINGS_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__sentry-settings-for-celery-tasks__//g' $CONFIG_FILE
+    fi
+
+    CREDS_LISTER_PATH=/etc/credentials/metadata-fetcher/credentials
+    if [ -f $CREDS_LISTER_PATH ]; then
+      awk "/__metadata-fetcher-credentials__/{system(\"sed 's/^/  /g' $CREDS_LISTER_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
+      mv $CONFIG_FILE_WIP $CONFIG_FILE
+    else
+      sed -i 's/__metadata-fetcher-credentials__//g' $CONFIG_FILE
+    fi
+
+    exit 0
+
+
+  logging-configuration.yml: |
+    version: 1
+
+    handlers:
+      console:
+        class: logging.StreamHandler
+        formatter: json
+        stream: ext://sys.stdout
+
+    formatters:
+      json:
+        class: pythonjsonlogger.jsonlogger.JsonFormatter
+        # python-json-logger parses the format argument to get the variables it actually expands into the json
+        format: "%(asctime)s:%(threadName)s:%(pathname)s:%(lineno)s:%(funcName)s:%(task_name)s:%(task_id)s:%(name)s:%(levelname)s:%(message)s"
+
+    loggers:
+      celery:
+        level: "INFO"
+      amqp:
+        level: WARNING
+      urllib3:
+        level: WARNING
+      azure.core.pipeline.policies.http_logging_policy:
+        level: WARNING
+      swh:
+        level: "INFO"
+      celery.task:
+        level: "INFO"
+
+    root:
+      level: "INFO"
+      handlers:
+      - console
+---
+# Source: swh/templates/loaders/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
   name: loader-archive-template
   namespace: swh-cassandra-next-version
 data:
   config.yml.template: |
     storage:
       cls: pipeline
       steps:
       - cls: buffer
         min_batch_size:
           content: 100
@@ -14433,20 +14536,186 @@
             path: "pre-stop.sh"
       - name: metadata-fetcher-credentials
         secret:
           secretName: metadata-fetcher-credentials
           optional: true
 ---
 # Source: swh/templates/loaders/deployment.yaml
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  name: loader-arch
+  namespace: swh-cassandra-next-version
+  labels:
+    app: loader-arch
+spec:
+  revisionHistoryLimit: 2
+  selector:
+    matchLabels:
+      app: loader-arch
+  strategy:
+    type: RollingUpdate
+    rollingUpdate:
+      maxSurge: 1
+  template:
+    metadata:
+      labels:
+        app: loader-arch
+      annotations:
+        # Force a rollout upgrade if the configuration changes
+        checksum/config: 1a501ff20c697287a876afa4fbe6f3f26a8c8821ae415b928ac3ad7f40f06509
+    spec:
+      affinity:
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+            - matchExpressions:
+              - key: swh/loader
+                operator: In
+                values:
+                - "true"
+      priorityClassName: swh-cassandra-next-version-normal-workload
+
+      terminationGracePeriodSeconds: 60
+      initContainers:
+        - name: prepare-configuration
+          image: debian:bullseye
+          imagePullPolicy: IfNotPresent
+          env:
+
+          - name: AMQP_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: amqp-secrets
+                key: swhconsumer-password
+                # 'name' secret must exist & include that ^ key
+                optional: false
+
+          command:
+            - /entrypoint.sh
+          volumeMounts:
+          - name: configuration-template
+            mountPath: /entrypoint.sh
+            subPath: "init-container-entrypoint.sh"
+            readOnly: true
+          - name: configuration
+            mountPath: /etc/swh
+          - name: configuration-template
+            mountPath: /etc/swh/configuration-template
+          - name: metadata-fetcher-credentials
+            mountPath: /etc/credentials/metadata-fetcher
+            readOnly: true
+
+          - name: sentry-settings-for-celery-tasks
+            mountPath: /etc/credentials/sentry-settings
+            readOnly: true
+      containers:
+      - name: loaders
+        image: container-registry.softwareheritage.org/swh/infra/swh-apps/loader_package:20231107.1
+
+        imagePullPolicy: IfNotPresent
+        command:
+          - /opt/swh/entrypoint.sh
+        resources:
+          requests:
+            memory: 512Mi
+            cpu: 500m
+        lifecycle:
+          preStop:
+            exec:
+              command: ["/pre-stop.sh"]
+        env:
+        - name: STATSD_HOST
+          value: prometheus-statsd-exporter
+        - name: STATSD_PORT
+          value: "9125"
+        - name: MAX_TASKS_PER_CHILD
+          value: "10"
+        - name: LOGLEVEL
+          value: "INFO"
+        - name: SWH_CONFIG_FILENAME
+          value: /etc/swh/config.yml
+        - name: SWH_LOG_CONFIG
+          value: /etc/swh/logging-configuration.yml
+
+
+        - name: SWH_SENTRY_ENVIRONMENT
+          value: staging
+        - name: SWH_SENTRY_DISABLE_LOGGING_EVENTS
+          value: "yes"
+        volumeMounts:
+          - name: loader-utils
+            mountPath: /pre-stop.sh
+            subPath: "pre-stop.sh"
+          - name: configuration
+            mountPath: /etc/swh
+          - name: localstorage
+            mountPath: /tmp
+
+          - name: configuration-template
+            mountPath: /etc/swh/logging-configuration.yml
+            subPath: "logging-configuration.yml"
+            readOnly: true
+
+      volumes:
+      - name: localstorage
+        ephemeral:
+          volumeClaimTemplate:
+            metadata:
+              labels:
+                type: ephemeral-volume
+            spec:
+              accessModes:
+              - ReadWriteOnce
+              resources:
+                requests:
+                  storage: 100Gi
+              storageClassName: local-path
+      - name: configuration
+        emptyDir: {}
+      - name: configuration-template
+        configMap:
+          name: loader-arch-template
+          defaultMode: 0777
+          items:
+          - key: "config.yml.template"
+            path: "config.yml.template"
+          - key: "init-container-entrypoint.sh"
+            path: "init-container-entrypoint.sh"
+
+          - key: "logging-configuration.yml"
+            path: "logging-configuration.yml"
+
+      - name: loader-utils
+        configMap:
+          name: loader-utils
+          defaultMode: 0777
+          items:
+          - key: "pre-stop-idempotent.sh"
+            path: "pre-stop.sh"
+      - name: metadata-fetcher-credentials
+        secret:
+          secretName: metadata-fetcher-credentials
+          optional: true
+
+      - name: sentry-settings-for-celery-tasks
+        secret:
+          secretName: sentry-settings-for-celery-tasks
+          optional: true
+# if defined at the "typed" loader level
+# otherwise use the global image is defined First this needs to replace - in
+# $loader_type with "" to find the proper image name.
+---
+# Source: swh/templates/loaders/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
   name: loader-archive
   namespace: swh-cassandra-next-version
   labels:
     app: loader-archive
 spec:
   revisionHistoryLimit: 2
   selector:
     matchLabels:
       app: loader-archive
   strategy:
@@ -20914,20 +21183,56 @@
       consumerGroup: swh-archive-stg-loader_metadata.journal_client
       lagThreshold: "1000"
       offsetResetPolicy: earliest
     authenticationRef:
       name: keda-loader-metadata-trigger-authentication
 ---
 # Source: swh/templates/loaders/keda-autoscaling.yaml
 apiVersion: keda.sh/v1alpha1
 kind: ScaledObject
 metadata:
+  name: loader-arch-operators
+  namespace: swh-cassandra-next-version
+spec:
+  scaleTargetRef:
+    apiVersion:    apps/v1     # Optional. Default: apps/v1
+    kind:          Deployment  # Optional. Default: Deployment
+    # Mandatory. Must be in same namespace as ScaledObject
+    name:          loader-arch
+    # envSourceContainerName: {container-name} # Optional. Default:
+                                               # .spec.template.spec.containers[0]
+  pollingInterval:  30                         # Optional. Default: 30 seconds
+  cooldownPeriod:   300                        # Optional. Default: 300 seconds
+  idleReplicaCount: 0                          # Set to 0 to stop all the workers when there is
+                                               # no activity on the queue
+  minReplicaCount:  0
+  maxReplicaCount:  1
+  triggers:
+  - type: rabbitmq
+    authenticationRef:
+      name: amqp-authentication-loader-arch
+    metadata:
+      protocol: auto                 # Optional. Specifies protocol to use,
+                                     # either amqp or http, or auto to
+                                     # autodetect based on the `host` value.
+                                     # Default value is auto.
+      mode: QueueLength              # QueueLength to trigger on number of msgs in queue
+      excludeUnacknowledged: "false" # QueueLength should include unacked messages
+                                     # Implies "http" protocol is used
+      value: "10"
+      queueName: swh.loader.package.arch.tasks.LoadArch
+      vhostName: /                   # Vhost to use for the connection
+---
+# Source: swh/templates/loaders/keda-autoscaling.yaml
+apiVersion: keda.sh/v1alpha1
+kind: ScaledObject
+metadata:
   name: loader-archive-operators
   namespace: swh-cassandra-next-version
 spec:
   scaleTargetRef:
     apiVersion:    apps/v1     # Optional. Default: apps/v1
     kind:          Deployment  # Optional. Default: Deployment
     # Mandatory. Must be in same namespace as ScaledObject
     name:          loader-archive
     # envSourceContainerName: {container-name} # Optional. Default:
                                                # .spec.template.spec.containers[0]
@@ -22291,20 +22596,32 @@
     name: keda-loader-metadata-kafka-secrets
     key: tls
   - parameter: password
     name: swh-archive-broker-secret
     key: BROKER_USER_PASSWORD
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml
 apiVersion: keda.sh/v1alpha1
 kind: TriggerAuthentication
 metadata:
+  name: amqp-authentication-loader-arch
+  namespace: swh-cassandra-next-version
+spec:
+  secretTargetRef:
+  - parameter: host            # "host" is required by the scalerObject trigger metadata
+    name: common-secrets
+    key: rabbitmq-http-host
+---
+# Source: swh/templates/loaders/keda-authentication.yaml
+apiVersion: keda.sh/v1alpha1
+kind: TriggerAuthentication
+metadata:
   name: amqp-authentication-loader-archive
   namespace: swh-cassandra-next-version
 spec:
   secretTargetRef:
   - parameter: host            # "host" is required by the scalerObject trigger metadata
     name: common-secrets
     key: rabbitmq-http-host
 ---
 # Source: swh/templates/loaders/keda-authentication.yaml
 apiVersion: keda.sh/v1alpha1


------------- diff for environment production namespace swh -------------

No differences


------------- diff for environment production namespace swh-cassandra -------------

No differences

Refs. swh/infra/sysadm-environment#5148 (closed)

Merge request reports

Loading