From 3845d35338f0840e874b7185f88b1a441662e0aa Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Wed, 8 Jun 2022 16:41:12 +0100 Subject: [PATCH] Remove "$" from commands and clarify context for spark example --- staging/spark/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/staging/spark/README.md b/staging/spark/README.md index b95d733fc..5a0e17c87 100644 --- a/staging/spark/README.md +++ b/staging/spark/README.md @@ -30,8 +30,10 @@ Optionally, your Kubernetes cluster should be configured with a Loadbalancer int ## Step One: Create namespace +Create the namespace by executing the following command using `kubectl`: + ```sh -$ kubectl create -f examples/staging/spark/namespace-spark-cluster.yaml +kubectl create -f examples/staging/spark/namespace-spark-cluster.yaml ``` Now list all namespaces: @@ -43,14 +45,14 @@ default Active spark-cluster name=spark-cluster Active ``` -To configure kubectl to work with our namespace, we will create a new context using our current context as a base: +To configure kubectl to work with our namespace, we will create a new context using our current context as a base with the following commands: ```sh -$ CURRENT_CONTEXT=$(kubectl config view -o jsonpath='{.current-context}') -$ USER_NAME=$(kubectl config view -o jsonpath='{.contexts[?(@.name == "'"${CURRENT_CONTEXT}"'")].context.user}') -$ CLUSTER_NAME=$(kubectl config view -o jsonpath='{.contexts[?(@.name == "'"${CURRENT_CONTEXT}"'")].context.cluster}') -$ kubectl config set-context spark --namespace=spark-cluster --cluster=${CLUSTER_NAME} --user=${USER_NAME} -$ kubectl config use-context spark +CURRENT_CONTEXT=$(kubectl config view -o jsonpath='{.current-context}') +USER_NAME=$(kubectl config view -o jsonpath='{.contexts[?(@.name == "'"${CURRENT_CONTEXT}"'")].context.user}') +CLUSTER_NAME=$(kubectl config view -o jsonpath='{.contexts[?(@.name == "'"${CURRENT_CONTEXT}"'")].context.cluster}') +kubectl config set-context spark --namespace=spark-cluster --cluster=${CLUSTER_NAME} --user=${USER_NAME} +kubectl config use-context spark ``` ## Step Two: Start your Master service @@ -279,7 +281,7 @@ If your Kubernetes cluster does not have a Loadbalancer integration, then we wil Take the Zeppelin pod from before and port-forward the WebUI port: ```console -$ kubectl port-forward zeppelin-controller-ja09s 8080:8080 +kubectl port-forward zeppelin-controller-ja09s 8080:8080 ``` This forwards `localhost` 8080 to container port 8080. You can then find