Deploy views in couchbase cluster with Kubernetes

Hi All,

I found a great instruction here to deploy couchbase cluster with Kubernetes which helps me to successfully deployed the couchbase cluster in my dev environment.

But I wonder when we deploy the cluster/servers/buckets, is it possible to deploy views along with them as well? If yes, can someone give me an example?

Currently I am using rest view api to create production views by login a node to execute curl command. I think there must be a better way to do this in one go with the deployment.

Many Thanks,

In short no, the Operator is not concerned with data, indexes etc. Creating indexes and views is the responsibility of the Couchbase SDKs, which may be a better solution than using the REST API. Your application should be able to poll for your view on start up and create it if not already present.

I’d also suggest moving away from views and just using N1QL queries instead as it’ll make your life easier in the long run!

Regards Si

Hi Simon,

Thanks for clarifying this.
We will look into using N1QL quires to replace views.