Updated 10. Setting the solution up in ACS Kubernetes (markdown)
parent
8e062434ed
commit
6822e2bd1e
@ -114,11 +114,14 @@ This creates a ConfigMap named `config-files` with key `nginx-conf` whose value
|
|||||||
>```
|
>```
|
||||||
This facilitates rapid iteration better than other techniques, e.g. building an image to bake in configuration.
|
This facilitates rapid iteration better than other techniques, e.g. building an image to bake in configuration.
|
||||||
|
|
||||||
|
Configuration of all pods is stored in a ConfigMap (named `externalcfg`) in the file `conf-local.yml`. This file contains the configuration to run k8s with "local" resources (that is, using SQL, Redis, RabbitMQ, etc, as containers in k8s). You can provide your own configuration file if you want to use external resources (i.e. if you want to use resources in Azure). The deployment script accepts the parameter `-configFile` to set which config file must be used to create the `externalcfg` ConfigMap.
|
||||||
|
|
||||||
The script also stores public URLs for the app's components in a ConfigMap:
|
The script also stores public URLs for the app's components in a ConfigMap:
|
||||||
>`deploy.ps1`
|
>`deploy.ps1`
|
||||||
>```powershell
|
>```powershell
|
||||||
>kubectl create configmap urls --from-literal=BasketUrl=http://$($frontendUrl)/basket-api ...
|
>kubectl create configmap urls --from-literal=BasketUrl=http://$($frontendUrl)/basket-api ...
|
||||||
>```
|
>```
|
||||||
|
|
||||||
>Here's how the `webspa` Deployment uses it:
|
>Here's how the `webspa` Deployment uses it:
|
||||||
>
|
>
|
||||||
>`deployments.yaml`
|
>`deployments.yaml`
|
||||||
@ -136,6 +139,8 @@ The script also stores public URLs for the app's components in a ConfigMap:
|
|||||||
> key: BasketUrl
|
> key: BasketUrl
|
||||||
>```
|
>```
|
||||||
|
|
||||||
|
You might wonder why `urls` ConfigMap is created by the script instead to be created from YAML file (like the `externalcfg`). This is because entries in `urls` ConfigMap depend on the public IP of the LoadBalancer service, and this IP needs to be asked. k8s do not support variables in object config files (like the YANML files used to create ConfigMaps).
|
||||||
|
|
||||||
### Further reading
|
### Further reading
|
||||||
* [Kubernetes Concepts](https://kubernetes.io/docs/concepts/)
|
* [Kubernetes Concepts](https://kubernetes.io/docs/concepts/)
|
||||||
* [kubectl for Docker Users](https://kubernetes.io/docs/user-guide/docker-cli-to-kubectl/)
|
* [kubectl for Docker Users](https://kubernetes.io/docs/user-guide/docker-cli-to-kubectl/)
|
||||||
@ -277,11 +282,11 @@ We have simplified the deployment so you can do it just by executing a script by
|
|||||||
|
|
||||||
Once the user and password are retrieved, run the following script for deployment, including your values and password. For example:
|
Once the user and password are retrieved, run the following script for deployment, including your values and password. For example:
|
||||||
>```
|
>```
|
||||||
>./deploy.ps1 -registry eshopautogencontainerregistry.azurecr.io -dockerUser eShopAutogenContainerRegistry -dockerPassword YourSuperSecretPassword
|
>./deploy.ps1 -registry eshopautogencontainerregistry.azurecr.io -dockerUser eShopAutogenContainerRegistry -dockerPassword YourSuperSecretPassword -configFile ./conf_local.yml
|
||||||
>```
|
>```
|
||||||
<img src="img/kubernetes/deploying-eshop-to-kubernetes-cluster.png">
|
<img src="img/kubernetes/deploying-eshop-to-kubernetes-cluster.png">
|
||||||
|
|
||||||
The script will build the .NET Core code, SPA TypeScript code and corresponding Docker images, push the latter to your registry at Azure Container Registry, and deploy the application to your cluster.
|
The script will build the .NET Core code, SPA TypeScript code and corresponding Docker images, push the latter to your registry at Azure Container Registry, and deploy the application to your cluster. Building .NET Core projects and/or build docker images is optionally based on parameters. ** Please refer to the file `k8s/README.k8s.md` for detailed info about how the script works and its parameters.
|
||||||
|
|
||||||
While deploying eShopOnContainers with the script, you can see the Docker image repositories being created in your **Azure Container Registry** which happens right before deploying to Kubernetes, at the Azure's portal:
|
While deploying eShopOnContainers with the script, you can see the Docker image repositories being created in your **Azure Container Registry** which happens right before deploying to Kubernetes, at the Azure's portal:
|
||||||
<img src="img/kubernetes/azure-container-service-repos.png">
|
<img src="img/kubernetes/azure-container-service-repos.png">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user