For k8s CI/CD pipeline delivery a series of tasks must be created in VSTS to deploy k8s in Azure
./gen-k8s-env -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -orchestratorName k8s-cluster -dnsName k8s-dns
Azure Blob storage
. It is needed for storing the kubernetes config file used by the hosted agent to access to Kubernetes cluster. Example:kubernetes config file
to the blob storage previously created. Execute the following command which will download the config file into the directory c:\Users\<User>\.kube\
and then, upload it to your blob storage:https://eshopk8s.blob.core.windows.net/k8s-config/config
Download File
task to download the kubernetes binary kubectl
to the hosted agent. For example:https://storage.googleapis.com/kubernetes-release/release/v0.0.1.7.0-alpha.0/bin/windows/386/kubectl.exe
https://eshopk8s.blob.core.windows.net/k8s-config/config
$(System.DefaultWorkingDirectory)/All Microservices/docker-compose/deploy.ps1
-deployCI $true -execPath '$(System.DefaultWorkingDirectory)/' -kubeconfigPath '$(System.DefaultWorkingDirectory)/' -deployInfrastructure $true -imageTag dev -configFile '$(System.DefaultWorkingDirectory)/$(Build.DefinitionName)/docker-compose/conf_local.yml'
- deployCI: Must be set to `$true`. This avoids create images (always are pulled from registry) and compile bits.
- deployInfrastructure: Can be set to `$false` if don't want to deploy infrastructure containers (like Redis, rabbit, SQL,...).
- imageTag: Image tag to pull from k8s.
- configFile: Configuration file (refer to [README.k8s.md](./README.k8s.md) for more info). This file is part of the VSTS build output.
- execPath: path where the k8s binary is stored
- kubeconfigPath: path where the k8s config file is stored
You can use additional parameters (i.e. pass registry and user/password to use custom registry instead of DockerHub. Plase, refer to README.k8s.md for more info.