(Optional) Connect a Local Workstation
To connect your local workstation to a Kubernetes tenant to execute the Spark operator:
- Log in to HPE Ezmeral Runtime Enterprise as the Tenant Administrator user that you created in Preparing the Spark Environment.
- Download the HPE Kubectl plugin from the Dashboard screen, as described in Dashboard – Kubernetes Tenant/Project Administrator.
-
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/
-
Change the permissions of kubectl-hpecp by executing the following command:
# chmod +x /usr/local/bin/kubectl-hpecp
-
Establish a connection to the HPE Ezmeral Runtime Enterprise environment by executing the following command:
# kubectl hpecp refresh <HPECP-Gateway-LB-IP-address> --insecure
NOTEOmit the--insecure
flag if your HPE Ezmeral Runtime Enterprise deployment is configured to use HTTPS. - 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
-
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"
-
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
NOTEIf you receive the error connection to the server localhost:8080 was refused, then verify the previous steps. -
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