apiVersion: v1
kind: Pod
metadata:
  name: "{{ include "agent-monitor.fullname" . }}-test-connection"
  labels:
    {{- include "agent-monitor.labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": test
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
  restartPolicy: Never
  securityContext:
    runAsNonRoot: true
    runAsUser: 65534
    runAsGroup: 65534
    seccompProfile:
      type: RuntimeDefault
  containers:
    - name: wget
      image: busybox:1.36
      command: ['wget']
      args:
        - '--timeout=10'
        - '--tries=3'
        - '-qO-'
        - 'http://{{ include "agent-monitor.fullname" . }}:{{ .Values.service.port }}/api/health'
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
        readOnlyRootFilesystem: true
        allowPrivilegeEscalation: false
        capabilities:
          drop:
            - ALL
