Skip to content

staging/webhooks: Deploy

Guillaume Samson requested to merge staging_deploy_webhooks into production

Related to swh/infra/sysadm-environment#5165 (closed)

Helm diff
./swh/helm-diff.sh
[swh] Comparing changes between branches production and staging_deploy_webhooks (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...
Your branch is up to date with 'origin/staging_deploy_webhooks'.
[swh] Generate config in staging_deploy_webhooks branch for environment staging...
[swh] Generate config in staging_deploy_webhooks branch for environment staging...
[swh] Generate config in staging_deploy_webhooks 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...
Your branch is up to date with 'origin/staging_deploy_webhooks'.
[swh] Generate config in staging_deploy_webhooks branch for environment production...
[swh] Generate config in staging_deploy_webhooks branch for environment production...
[swh] Generate config in staging_deploy_webhooks branch for environment production...


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

No differences


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

--- /tmp/swh-chart.swh.oyBboFqi/staging-swh-cassandra.before	2023-12-01 16:40:52.891615614 +0100
+++ /tmp/swh-chart.swh.oyBboFqi/staging-swh-cassandra.after	2023-12-01 16:40:53.315622473 +0100
@@ -4501,20 +4501,41 @@
     - swh.web.banners
     - swh.web.deposit
     - swh.web.inbound_email
     - swh.web.jslicenses
     - swh.web.mailmap
     - swh.web.metrics
     - swh.web.save_code_now
     - swh.web.save_origin_webhooks
     - swh.web.vault
 ---
+# Source: swh/templates/webhooks/configmap.yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  namespace: swh-cassandra
+  name: webhooks-origin-visit-status-template
+data:
+  config.yml.template: |
+    webhooks:
+      svix:
+        auth_token: ${SVIX_AUTH_TOKEN}
+        server_url: https://svix.internal.staging.swh.network
+    journal:
+      brokers:
+        - journal1.internal.staging.swh.network
+        - journal2.internal.staging.swh.network
+      auto_offset_reset: latest
+      group_id: swh-archive-stg-test-webhooks
+      object_types:
+      - origin_visit_status
+---
 # Source: swh/templates/deposit/service.yaml
 apiVersion: v1
 kind: Service
 metadata:
   name: deposit
   namespace: swh-cassandra
 spec:
   type: ClusterIP
   selector:
     app: deposit
@@ -12844,20 +12865,129 @@
         emptyDir: {}
       - name: configuration-template
         configMap:
          name: web-configuration-template
          items:
          - key: "config.yml.template"
            path: "config.yml.template"
       - name: static
         emptyDir: {}
 ---
+# Source: swh/templates/webhooks/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: webhooks-origin-visit-status
+  namespace: swh-cassandra
+  labels:
+    app: webhooks-origin-visit-status
+spec:
+  revisionHistoryLimit: 2
+  replicas: 1
+  selector:
+    matchLabels:
+      app: webhooks-origin-visit-status
+  strategy:
+    type: RollingUpdate
+    rollingUpdate:
+      maxSurge: 1
+  template:
+    metadata:
+      labels:
+        app: webhooks-origin-visit-status
+      annotations:
+        # Force a rollout upgrade if the configuration changes
+        checksum/config: bd5bafecc2705122d4c69c9f2955d42ff57b03255ade4d1b9df6d26c1d66af41
+    spec:
+      affinity:
+        
+        nodeAffinity:
+          requiredDuringSchedulingIgnoredDuringExecution:
+            nodeSelectorTerms:
+            - matchExpressions:
+              - key: swh/webhooks
+                operator: In
+                values:
+                - "true"
+      priorityClassName: swh-cassandra-frontend-rpc-workload
+      
+      initContainers:
+        - name: prepare-configuration
+          image: debian:bullseye
+          imagePullPolicy: IfNotPresent
+          env:
+          
+          - name: SVIX_AUTH_TOKEN
+            valueFrom:
+              secretKeyRef:
+                name: common-secrets
+                key: svix-token
+                # 'name' secret must exist & include that ^ key
+                optional: false
+          
+          command:
+          - /bin/bash
+          args:
+          - -c
+          - eval echo "\"$(</etc/swh/configuration-template/config.yml.template)\"" > /etc/swh/config.yml
+          volumeMounts:
+          - name: configuration
+            mountPath: /etc/swh
+          - name: configuration-template
+            mountPath: /etc/swh/configuration-template
+      containers:
+      - name: webhooks
+        resources:
+          requests:
+            memory: 100Mi
+            cpu: 100m
+        image: container-registry.softwareheritage.org/swh/infra/swh-apps/webhooks:20231129.1
+        imagePullPolicy: IfNotPresent
+        command:
+          - /opt/swh/entrypoint.sh
+        env:
+        - name: STATSD_HOST
+          value: prometheus-statsd-exporter
+        - name: STATSD_PORT
+          value: "9125"
+        - name: MAX_TASKS_PER_CHILD
+          value: "1"
+        - name: LOGLEVEL
+          value: "INFO"
+        - name: SWH_CONFIG_FILENAME
+          value: /etc/swh/config.yml
+        - name: SWH_SENTRY_ENVIRONMENT
+          value: staging
+        - name: SWH_MAIN_PACKAGE
+          value: swh.webhooks
+        - name: SWH_SENTRY_DSN
+          valueFrom:
+            secretKeyRef:
+              name: common-secrets
+              key: webhooks-sentry-dsn
+              # 'name' secret must exist & include key "host"
+              optional: false
+        
+        volumeMounts:
+          - name: configuration
+            mountPath: /etc/swh
+      volumes:
+      - name: configuration
+        emptyDir: {}
+      - name: configuration-template
+        configMap:
+          name: webhooks-origin-visit-status-template
+          defaultMode: 0777
+          items:
+          - key: "config.yml.template"
+            path: "config.yml.template"
+---
 # Source: swh/templates/deposit/autoscaling.yaml
 apiVersion: autoscaling/v2
 kind: HorizontalPodAutoscaler
 metadata:
   namespace: swh-cassandra
   name: deposit
   labels:
     app: deposit
 spec:
   scaleTargetRef:


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

No differences


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

No differences


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

No differences
Edited by Guillaume Samson

Merge request reports