How to add init-container to cluster pods

Hi. I have question.
I need to add init-container to couchbase pods. I`m using couchbase-operator.

            - name: init-myservice
              command: ['sh', '-c', 'echo waiting for myservice; sleep 2; done;']

Ive tried add to section, but i dont see init container in cluster pods :confused:
Can u help me with that?

You cannot add additional containers to the Couchbase Server Pods managed by the Operator. I’d ask what you are trying to accomplish, as there might be alternatives.

I need addidional container to register pods in our external loadbalancer…

External as in outside the K8S cluster? Why are you trying to load balance the Couchbase Cluster pods? Are you trying to access the admin UI or API?

Ye. We have a very specify K8S cluster in our company. Without additional sidecar I can`t use Couchbase in our network.

If you need Client access (Sdk) then you need to use external DNS. If you need just API/UI access, you can use ExposedFeatureTemplates under Networking and expose the AdminUI.

Also, in 2.6.1, which just released yesterday, we made generally available a new Cloud Native Gateway, which exposes a single point gRPC gateway that can be load balanced via an Ingress.

1 Like

We dont use svc and ingress. We have external service mesh and loadbalancer. I need use sidecar :slight_smile:

That’s unfortunate. Your use case falls outside of our supported uses cases for Couchbase Server on Kubernetes.