apiVersion: v1
kind: Pod
metadata:
  name: pod-curl-client
  labels:
    app: curl_client 
spec:
  containers:
    - name: cntr-centos
      image: centos
      command: ["/bin/bash", "-c"]
      args:
        - |
          # the following is to add the kubernete's root ca cert as a trusted cert. 
          # the root ca crt is already present inside the container thanks to the default service account. 
          cp /run/secrets/kubernetes.io/serviceaccount/ca.crt /etc/pki/ca-trust/source/anchors/
          update-ca-trust   # ubuntu approach: https://kubernetes.io/docs/concepts/cluster-administration/certificates/#distributing-self-signed-ca-certificate
          update-ca-trust extract
          while true ; do
            echo "################################"
            date
            curl -s https://svc-clusterip-httpd.default.svc.cluster.local
            sleep 10
          done