# How to use weaviate client v4 to connect to a self hosted instance on k8s

**URL:** <https://forum.weaviate.io/t/how-to-use-weaviate-client-v4-to-connect-to-a-self-hosted-instance-on-k8s/3199>\
**Category:** Support\
**Tags:** python\
**Created:** [July 28, 2024, 6:07pm UTC](https://forum.weaviate.io/t/how-to-use-weaviate-client-v4-to-connect-to-a-self-hosted-instance-on-k8s/3199 "2024-07-28T18:07:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chaitanya\_Bhagavan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/chaitanya_bhagavan/32/2049_2.png) [@Chaitanya\_Bhagavan](https://forum.weaviate.io/u/Chaitanya_Bhagavan)\
**Post date:** [July 28, 2024, 6:07pm UTC](https://forum.weaviate.io/t/how-to-use-weaviate-client-v4-to-connect-to-a-self-hosted-instance-on-k8s/3199/1 "2024-07-28T18:07:33Z")

</div>

### Description

I have a self hosted weaviate instance consisting of 4 nodes running on a k8s cluster on azure. This is behind a spring cloud gateway and accessed from outside through a path /weaviate and gets routed to the the running weaviate instance.  
Python client V3 accepts a url parameter, but V4 client is not using the base path.

How can i connect to the weaivate instance from outside the cluster by using the path ? eg. [https://app.example.com/weaviate](https://app.example.com/weaviate)

### Server Setup Information

- Weaviate Server Version: 1.26.1
- Deployment Method: k8s
- Multi Node? Number of Running Nodes: 4
- Client Language and Version: Python and Java
- Multitenancy?: No

### Any additional Information

---

<div class="post-metadata">

**Author:** ![Chaitanya\_Bhagavan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/chaitanya_bhagavan/32/2049_2.png) [@Chaitanya\_Bhagavan](https://forum.weaviate.io/u/Chaitanya_Bhagavan)\
**Post date:** [July 29, 2024, 12:07pm UTC](https://forum.weaviate.io/t/how-to-use-weaviate-client-v4-to-connect-to-a-self-hosted-instance-on-k8s/3199/2 "2024-07-29T12:07:33Z")

</div>

I solved this for https by creating a listener and rewrite rule in application gateway. But I am not sure how to expose the grpc service via the application gateway? Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [July 29, 2024, 5:44pm UTC](https://forum.weaviate.io/t/how-to-use-weaviate-client-v4-to-connect-to-a-self-hosted-instance-on-k8s/3199/3 "2024-07-29T17:44:08Z")

</div>

hi @Chaitanya_Bhagavan !!

Welcome to our community 🤗

We do not provide specific instructions on how to properly expose Weaviate in different services, as they may vary a lot.

The bottom line is the same as exposing a GRPC.

One way to test is using tools like grpcurl:

> **[gRPC | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/api/grpc#client-side)**
>
> Overview

This is how I have done it for traefik, using docker compose, for example:

> **[Build software better, together](https://github.com/login/oauth/authorize?client_id=7e0a3cd836d3e544dbd9&redirect_uri=https%3A%2F%2Fgist.github.com%2Fauth%2Fgithub%2Fcallback%3Freturn_to%3Dhttps%253A%252F%252Fgist.github.com%252Fdudanogueira%252F0dd925cbf63397e256e84e991245aab3%252Fedit&response_type=code&state=2c797c149b43d5f36f70e955983221bb026e63036185e8af1f0c8d09a3bcb588)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Let me know if this helps!

Thanks!
