Pdeuxa
Pdeuxa

Reputation: 699

Kubernetes, access service (Zookeeper)

I am trying to deploy a custom nifi instances working with external zookeeper, on Kubernetes (begineer).

Every thing works except for the state management within Nifi.

I understood that I have to update the state-management.xml file, with the right connection string :

    <cluster-provider>
        <id>zk-provider</id>
        <class>org.apache.nifi.controller.state.providers.zookeeper.ZooKeeperStateProvider</class>
        <property name="Connect String"></property>
        <property name="Root Node">/nifi</property>
        <property name="Session Timeout">10 seconds</property>
        <property name="Access Control">Open</property>
    </cluster-provider>

I do not know how I get access to this connection string within Kubernetes, this is my service.yml for zookeeper:

apiVersion: v1
kind: Service
metadata:
  name: zk-hs
  labels:
    app: zk
spec:
  selector:
    app: zk
  ports:
  - port: 2888
    name: server
  - port: 3888
    name: leader-election
  clusterIP: None

---
apiVersion: v1
kind: Service
metadata:
  name: zk-cs
  labels:
    app: zk
spec:
  selector:
    app: zk
  ports:
  - port: 2181
    name: client

For Zookeeper leader election and so on, I used the following address :

zk-0.zk-hs.default.svc.cluster.local:2888:3888

But how to access to the port 2181?

Upvotes: 0

Views: 419

Answers (1)

Kun Li
Kun Li

Reputation: 2755

You can just access zk-cs.default.svc.cluster.local:2181

Upvotes: 0

Related Questions