Anyone testing this locally should consider using kubectl proxy to run an HTTP proxy and work around any self-signed certificate issues with TeamCity accessing the k8s API. kubectl proxy will transparently handle auth, and you can setup TeamCity to use http & unauthorized auth strategy. In production or a remote system you can deal with configuring auth properly but don’t beat your head against the wall locally in a dev environment.
Just be careful that you don’t open your HTTP proxy to the world thus exposing your k8s API to the world.
Read more here: https://kubernetes.io/docs/tasks/access-kubernetes-api/http-proxy-access-api/