# $ oc process -p DEBUG="" -f dns-lookup.yaml -o yaml | oc create -f -
#   or
# $ oc process -p DEBUG="" -f dns-lookup.yaml -o yaml | oc create -f -
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
  name: dnslookup
parameters:
- name: NAME
  value: "_grpc._tcp.prometheus-operated.openshift-monitoring.svc.cluster.local"
- name: DEBUG
  value: "-debug"
- name: INTERVAL
  value: "6"
objects:
- kind: Pod
  apiVersion: v1
  metadata:
    name: dnslookup
    labels:
      app: dnslookup
  spec:
    containers:
    - name: debug
      image: quay.io/openshift/origin-hello-openshift
      imagePullPolicy: IfNotPresent
      command:
        - /bin/bash
        - -c
      args:
        - trap "exit 0" INT TERM; while :; do echo -n "$(date)"; echo " LOOKUP '${NAME}'"; nslookup ${DEBUG} ${NAME}; echo "nslookup status $?"; sleep ${INTERVAL}; done
      securityContext:
        allowPrivilegeEscalation: false
        runAsNonRoot: true
        capabilities:
          drop:
            - ALL
        seccompProfile:
          type: RuntimeDefault
      terminationGracePeriodSeconds: 0s
