Remove "$" from commands and clarify context for spark example

This commit is contained in:
Alexandru Gheorghe 2022-06-08 16:41:12 +01:00
parent 13cbf0b065
commit d65dfd1e4c
No known key found for this signature in database
GPG Key ID: D0943A9B6F5571DB
1 changed files with 10 additions and 8 deletions

View File

@ -30,8 +30,10 @@ Optionally, your Kubernetes cluster should be configured with a Loadbalancer int
## Step One: Create namespace ## Step One: Create namespace
Create the namespace by executing the following command using `kubectl`:
```sh ```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: Now list all namespaces:
@ -43,14 +45,14 @@ default <none> Active
spark-cluster name=spark-cluster 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 ```sh
$ CURRENT_CONTEXT=$(kubectl config view -o jsonpath='{.current-context}') CURRENT_CONTEXT=$(kubectl config view -o jsonpath='{.current-context}')
$ USER_NAME=$(kubectl config view -o jsonpath='{.contexts[?(@.name == "'"${CURRENT_CONTEXT}"'")].context.user}') 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}') 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 set-context spark --namespace=spark-cluster --cluster=${CLUSTER_NAME} --user=${USER_NAME}
$ kubectl config use-context spark kubectl config use-context spark
``` ```
## Step Two: Start your Master service ## 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: Take the Zeppelin pod from before and port-forward the WebUI port:
```console ```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 This forwards `localhost` 8080 to container port 8080. You can then find