samayly.com is live. Hosted plans open soon. Join the waitlist →
yaml36 linescopy and edit

k8s/digest-ping-test.yaml

Copy this file into your setup and edit the marked values. Do not use it as-is.

k8s/digest-ping-test.yaml
# One-off connectivity test for the digest CronJob. Sends a "ping" event that is only logged by the
# bot: nothing is posted to WhatsApp. Run:  kubectl apply -f k8s/digest-ping-test.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: ts03-ping-test
  namespace: waha
spec:
  backoffLimit: 0
  activeDeadlineSeconds: 120
  ttlSecondsAfterFinished: 3600
  template:
    spec:
      restartPolicy: Never
      hostAliases:                      # pin the Mac: CoreDNS lost host.k3d.internal
        - ip: "192.168.5.2"
          hostnames: ["host.k3d.internal"]
      containers:
        - name: ping
          image: curlimages/curl:latest
          imagePullPolicy: IfNotPresent
          env:
            - name: HOOK_SECRET
              valueFrom:
                secretKeyRef:
                  name: waha-secrets
                  key: HOOK_SECRET
          command: ["sh", "-c"]
          args:
            - >-
              curl -sS --fail --max-time 20 -X POST
              -H 'Content-Type: application/json'
              -d '{"event":"ts03.ping"}'
              -w 'HTTP %{http_code}\n'
              "http://host.k3d.internal:5055/hook/${HOOK_SECRET}"

Questions or corrections: [email protected]