- Create a
azureFullDeploymentToK8s.yaml
file which contains a section for a service and a section for a deployment separted by------
. - You can find a sample for a service description in yaml here .
- You can find a sample for a deployment description in yaml here.
- Modify the sections to represent the backend service.
- Apply the yaml file
kubectl apply -f filename
. Make sure you delete all resources you want to recreate to avoid confuision. (kubectl delete...
)
- If everything worked as expexted, modify the image section to target a placeholder
latest
or#{Build.BuildNumber}#
instead of a specific version. Check in your yaml file into your repo. - For automation create a build pipeline in azure devops (use the same you already have for your container builds)
- Add a build artifact in the pipeline.
- Save and queue a build.
- Create a new release pipeline.
- Make sure that you are carrying over the artifacts from build pipeline. If you need to release a specific version you need to modify the yaml file and replace your token with the current build id.
- Add a Kubernetes apply task to your pipeline. Make sure that the version of the task is set to
1.*
- Authorize the service connection - if you to not have enough permissions on your azure subscription use the fallback by creating a
Kubernetes Service Connection
here 📘! - Select command
apply
and check theuse configuration files
option to select and apply the yaml file from your build.
$(System.DefaultWorkingDirectory)/_phoenix_ws-aci-helloworld/drop/aci-helloworld.yaml