apiVersion: apps/v1
kind: Deployment
metadata:
  name: probe
spec:
  selector:
    matchLabels:
      name: probe
  replicas: 5
  template:
    metadata:
      labels:
        name: probe
    spec:
      containers:
      - name: probe-container
        image: docker.io/cilium/json-mock
        livenessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - echo.default.svc.cluster.local
        readinessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - echo.default.svc.cluster.local
---
apiVersion: v1
kind: Service
metadata:
  name: echo
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    name: echo
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: echo
spec:
  selector:
    matchLabels:
      name: echo
  replicas: 5
  template:
    metadata:
      labels:
        name: echo
    spec:
      containers:
      - name: echo-container
        image: docker.io/cilium/json-mock
        livenessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - localhost
        readinessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - localhost

apiVersion: apps/v1
kind: Deployment
metadata:
  name: probe
spec:
  selector:
    matchLabels:
      name: probe
  replicas: 5
  template:
    metadata:
      labels:
        name: probe
    spec:
      containers:
      - name: probe-container
        image: docker.io/cilium/json-mock
        livenessProbe:
          exec:
            command:
            - curl
            - "-4"
            - -sS
            - -o
            - /dev/null
            - echo.default.svc.cluster.local
        readinessProbe:
          exec:
            command:
            - curl
            - "-4"
            - -sS
            - -o
            - /dev/null
            - echo.default.svc.cluster.local
---
apiVersion: v1
kind: Service
metadata:
  name: echo
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    name: echo
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: echo
spec:
  selector:
    matchLabels:
      name: echo
  replicas: 5
  template:
    metadata:
      labels:
        name: echo
    spec:
      containers:
      - name: echo-container
        image: docker.io/cilium/json-mock
        livenessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - localhost
        readinessProbe:
          exec:
            command:
            - curl
            - -sS
            - -o
            - /dev/null
            - localhost

Fix connectivity test example probes
Fix connectivity test example probes

curl probe has the potential to fail when IPv6 is not available. curl will call
getaddrinfo, which on newer glibcs will send 2 DNS requests in parallel (one
for IPv4 and IPv6). IPv6 will get dropped, causing the request to timeout after
5s which is the threshold for the healtcheck. This can lead to failed
probes. By specifying -4, curl will only do IPv4.

See https://github.com/curl/curl/issues/593 for more info.

Signed-off-by: Boran Car <a68647cfa621096cab8383b334856d6c068445c5@gmail.com>
