Deploy Kubernetes Containers, adding labels to Service

Hi
Im using the Deploy Kubernetes Containers to deploy microservices to an on-premises kubernetes.
Now I have the need for a way to add labels to my services, so Grafana/Prometheus can find the services we need to monitor.
How do I add my own tags to the Labels for a Service.
I can’t find any way to do that using the Deploy Kubernetes Containers Step.

Hi,
Thanks for reaching out.
Absolutely you can add Tags to your Kubernetes build. In the Kubernetes Build step under Deployment, you should find the “Labels” option.

Take a look at our Kubernetes Documentation for more detail.

Hope this helps. Please let me know if you have any further questions or concerns.

Thanks,
Tina

Hi Tina

Thanks for the reply,

I need to add Labels to the Service, not the Deployment resource.

I’m running v2019.6.8 LTS
Do I need to run a newer version of Octopus Deploy?

Thanks,
Søren

Hi Soren,
V2019.6.8 has the latest Kubernetes deployment Template, so your good on the Octopus Server version.
These labels can be applied to Deployment Resources as well as Services, pods managed by the deployment resource and the ingress. So they should work well for your Services.

Give it a try and let me know if the labels are being applied to the services as expected.

Thank you,
Tina

Hi Tina

Have checked and yes, the labels get applied to alle my resources.
That does mean that you can’t have labels only on the Deployment or the Service, but have to have the same labels on both.
In my case this is not a problem, but it might come up sometime for someone else.

Thanks for the help,
Søren

Hi Soren,
Glad to hear that these labels are working for you!
Thanks for the additional input here. Please don’t hesitate to reach out with any further questions.

Happy Deployments!

Tina