Updated 10. Setting the solution up in AKS (Azure Kubernetes Service) (markdown)

Cesar De la Torre 2018-05-17 16:54:29 -07:00
parent 065747e589
commit 3dbe714f06

@ -123,6 +123,44 @@ You should see the Kubernetes dashboard, similar to the following screenshot if
![image](https://user-images.githubusercontent.com/1712635/40207519-c6c2e4e6-59e9-11e8-8f9e-60f6a15ef3ab.png)
### Select the right Kubernetes context when having multiple clusters
When you have multiple Kubernetes clusters in AKS or even if you want to switch and deploy to a local Kubernetes cluster in the PC with "Docker for Windows" with Kuberentes support, you need to "point" to the right cluster before running `kubectl` commands.
In order to see the contexts you have in your local PC, type:
>```
>kubectl config get-contexts
>```
You should see something like the following:
![image](https://user-images.githubusercontent.com/1712635/40208824-7dc75734-59f0-11e8-9ff3-a1ed82f0a7e7.png)
If you need to select a different context because the cluster you want to use is not the current one selected, type:
>```
>kubectl config use-context YoureShopAksCluster
>```
![image](https://user-images.githubusercontent.com/1712635/40208892-047630d4-59f1-11e8-8635-59e6df9db7a4.png)
So when you use `kubectl`, it'll be managing that particular cluster:
![image](https://user-images.githubusercontent.com/1712635/40208942-49195356-59f1-11e8-968d-8450b1b67739.png)
Now, you can also manually run the Kubernetes proxy with:
>```
>kubectl proxy
>```
So when you open the Kubernetes dashboard it'll be targeting the right cluster, too, when typeing the following URL into the browser:
>```
>URL: http://localhost:8001/#!/cluster
>```
![image](https://user-images.githubusercontent.com/1712635/40209200-cc1390e0-59f2-11e8-816d-eec1d01359ca.png)
## Important: Store your credentials/secrets for Kubernetes and ACR in a safe place!
The script and Azure CLI create all the infrastructure very easily. However, if you want to re-use the same Kubernetes credentials or re-use the same Azure ACR registry, it is important that you store your credentials in a safe place.