Python SDK to locally hosted Kubernetes Couchbase

Viewed 24

in other thread I made I asked for the solution to a problem regarding connecting to Couchbase.

From then, I've experimented with other approach. Carefully following every step in Couchbase documentation, I have managed to setup a Couchbase cluster on Kubernetes. enter image description here

However, I still cannot connect SDK to it. How do I run Python outside of Kubernetes and connect to the Couchbase instance hosted locally on Kubernetes cluster? Specifically, what is the "connection_string" in the standard code I post below:

    connection_string = "<WHAT TO PUT THERE?>"
    cluster = Cluster.connect(connection_string,
                              ClusterOptions(PasswordAuthenticator(os.getenv("LOGIN"), os.getenv("PASSWORD"))))
    bucket = cluster.bucket('travel-sample')
    coll = bucket.default_collection()
    query_iter = cluster.query("SELECT * FROM `travel-sample` LIMIT 100")
    for r in query_iter.rows():
        print(f"Found row: {r}")
0 Answers
Related