(Optional) Connect a Local Workstation

NOTE
This procedure is only required if you are planning on executing the Spark operator from your laptop or other local machine. If you are planning on running the Spark operator from the Web Terminal, then skip to Spark Operator.

To connect your local workstation to a Kubernetes tenant to execute the Spark operator:

  1. Log in to HPE Ezmeral Runtime Enterprise as the Tenant Administrator user that you created in Preparing the Spark Environment.
  2. Download the HPE Kubectl plugin from the Dashboard screen, as described in Dashboard – Kubernetes Tenant/Project Administrator.
  3. Copy kubectl-hpecp to /usr/local/bin/ on your local workstation, and set the path by executing the following command:

    # export PATH=$PATH:/usr/local/bin/
  4. Change the permissions of kubectl-hpecp by executing the following command:

    # chmod +x /usr/local/bin/kubectl-hpecp
  5. Establish a connection to the HPE Ezmeral Runtime Enterprise environment by executing the following command:

    # kubectl hpecp refresh <HPECP-Gateway-LB-IP-address> --insecure
    NOTE
    Omit the --insecure flag if your HPE Ezmeral Runtime Enterprise deployment is configured to use HTTPS.
  6. Input the username and password of the Kubernetes Cluster Administrator user.
                            User name with which to authenticate to HPECP: tenadmin
                            Password for user tenadmin: <tenant_admin_password>
                            The next step is to send credentials across the network.
                            Since the TLS connection will not be verified, there is some risk in this.
    
                            
    
                            Would you like to continue? [y/N] y
    
                            
    
                            Retrieved new Kube Config from HPECP server at <HPECP-Gateway-LB-IP-address:8080>.
                            Config file:
                            KUBECONFIG="/tenadmin/.kube/.hpecp/<HPECP-GW-IP>/config:/tenadmin/.kube/config" kubectl config view
  7. From the KUBECONFIG output of the previous step, execute the following command to set the path for your local workstation to communicate with the Kubernetes tenant:

    # export KUBECONFIG="/john/...config:/john/.../config"
  8. Display the Kubernetes cluster configurations to verify that you are properly connected to the Kubernetes tenant by executing the following command:

    # kubectl config view
    Example Output:
    # kubectl config view
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data: DATA+OMITTED
        server: https://hpecp-lab.mip.storage.hpecorp.net:9500
      name: HPECP K8s Demolab
    contexts:
    - context:
        cluster: HPECP K8s Demolab
        user: HPECP K8s Demolab-admin
      name: HPECP K8s Demolab-admin
    current-context: HPECP K8s Demolab-admin 
    kind: Config
    preferences: {}
    users:
    - name: HPECP K8s Demolab-admin
      user:
        exec:
          apiVersion: client.authentication.k8s.io/v1beta1
          args:
          - hpecp
          - authenticate
          - hpecp-lab.mip.storage.hpecorp.net:8080
          - --hpecp-user=admin
          - --hpecp-token=/api/v2/session/09ad3d7c-e7e5-4345-ac14-5afcc9a8cb0e
          - --hpecp-token-expiry=1586039843
          - --force-reauth=false
          - --insecure=true
          - --insecure-skip-tls-verify=true
          command: kubectl
    NOTE
    If you receive the error connection to the server localhost:8080 was refused, then verify the previous steps.
  9. Verify the Spark operator is setup by executing the following command:

    # kubectl get pods -n <tenant-namespace>

    The sample output will look something like this:

    cspaceterminal-578586bff9-78pkc
            hivemeta-7dd6d76d69-87wjz
            sparkhs-5bfdc7fc8b-rmjwm