Launching Kubernetes Pods to Access DataTaps

This section provides a sample YAML file called demo.yaml that includes an HDFS client. Note the DataTap label, as described in Accessing DataTaps in Kubernetes Pods:

apiVersion: v1
kind: Pod
metadata:
  name: demo
  namespace: k8s
  labels:
     hpecp.hpe.com/dtap: hadoop2
spec:
  containers:
  - name: app
    image: docker.io/xoxoxoxoxoxo/app:1.0
    resources:
      limits:
        cpu: "500m"
        memory: "4Gi"
      requests:
        cpu: "500m"
        memory: "4Gi"

The pod information is as follows after successful deployment of the demo.yaml file:

[root@intel-s02 ~]# kubectl -n k8s describe pod demo
Name:         demo
Namespace:    k8s
Priority:     0
Node:         hostname.enterprise.net/10.50.50.50
Start Time:   Mon, 20 Jul 2020 17:18:16 -0700
Labels:       hpecp.hpe.com/dtap=hadoop2
Annotations:  cni.projectcalico.org/podIP: 10.192.1.15/32
              hpecp.hpe.com/dtap-status: injected
Status:       Running
IP:           10.192.1.15
IPs:
  IP:  10.192.1.15
Containers:
  app:
    Container ID:   docker://7c0df2c39b74643f52dc68be0752142af80b386f0f79f2f258a46ec4ead41649
    Image:          docker.io/xoxoxoxoxoxo/app:1.0
    Image ID:       docker-pullable://xoxoxoxoxoxo/app@sha256:9ac6291b7116c083e293c56887dbaf682102a43f121eb1914f1ab0f7d6cae36e
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Mon, 20 Jul 2020 17:18:17 -0700
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     500m
      memory:  4Gi
    Requests:
      cpu:        500m
      memory:     4Gi
    Environment:  <none>
    Mounts:
      /opt/bdfs from dtap-shared-vol (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-jlnzg (ro)
  dtap:
    Container ID:   docker://c7c45beedfaf8e08fe3f9b894f4cb276a341bcbd8f8e73d0c30645abe4314dcf
    Image:          bluedata/hpecp-dtap:1.63
    Image ID:       docker-pullable://bluedata/hpecp-dtap@sha256:a2cde114efb257e457bbd839391f1706c5a28a2b467bfe6e57fa9fcc4f14267b
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Mon, 20 Jul 2020 17:18:17 -0700
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     200m
      memory:  409Mi
    Requests:
      cpu:     200m
      memory:  409Mi
    Environment:
      K8S_DTAP_SHARED_MEMORY_SIZE:  153
      HADOOP_VERSION:               hadoop_version_2
    Mounts:
      /etc/bluedata/dtap from secret-vol-dtap (ro)
      /opt/bdfs from dtap-shared-vol (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-jlnzg (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  default-token-jlnzg:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-jlnzg
    Optional:    false
  dtap-shared-vol:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     Memory
    SizeLimit:  <unset>
  secret-vol-dtap:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  dtap
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          <none>

After the pod is ready, you can log in into the app container to either run HDFS commands or perform I/O operation on the tenant's DataTaps.