0
votes

I am trying to configure release pipeline in Azure Devops to push image to registry. In the release pipeline I have two tasks run service and expose deployment. When there is no service and deployment in AKS or on first code checkin it works fine but on next checkin it fails service already exist. Any idea where am i doing wrong ?

1
Add what you have triedAthira
I have added two tasks deploy to kubernetes in release pipeline . 1st one actual command is RUN to create deployment . Second one to EXPOSE deployement as a service .bilal_khan
Kubectl run deploymentname --image --port. Kubectl expose deployment deploymentname --type =loadbalancer --port 80 --targetport 8090 --name service namebilal_khan

1 Answers

0
votes

you need to be using yaml files and kubectl apply. what you are doing is an imperative way of managing resource and kubectl apply would give you a declarative way of doing that, so it would only apply changes. But given that you only need to update the image, it will probably make more sense to do kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1 , so use kubectl set image to update the image on the existing deployment. another option would be to use something like flux to manage images