Connect Your Cluster

Inside Cluster (Service-To-Service)

Connect within the same namespace

Each cluster deployment exposes 3 services with the prefix of your cluster name.

For example, kubemq-cluster as cluster name:

Service

Name

Default Port

gRPC

kubemq-cluster-grpc

50000

Rest

kubemq-cluster-rest

9090

API

kubemq-cluster-api

8080

Connect from external namespace

Each cluster deployment exposes 3 services with the prefix of your cluster name.

Use Kubernetes DNS resolving for accessing cluster services.

For example, namespace is kubemq and cluster name is kubemq-cluster with cluster.local domain name:

Service

Name

Default Port

gRPC

kubemq-cluster-grpc.kubemq.svc.cluster.local

50000

Rest

kubemq-cluster-rest.kubemq.svc.cluster.local

9090

API

kubemq-cluster-api.kubemq.svc.cluster.local

8080

Outside Cluster

Connect with Load Balancer

Expose gRPC Load Balancer

kubemqctl create cluster --grpc-expose LoadBalancer

Expose Rest Load Balancer

kubemqctl create cluster --rest-expose LoadBalancer

Expose Api Load Balancer

kubemqctl create cluster --api-expose LoadBalancer

Connect with Node Port

Expose the required service via node port and access the service with host:port defined.

Configure gRPC Node Port

kubemqctl create cluster --grpc-expose NodePort --grpc-node-port 30500

Configure Rest Node Port

kubemqctl create cluster --rest-expose NodePort --rest-node-port 30600

Configure Api Node Port

kubemqctl create cluster --api-expose NodePort --api-node-port 30700

Connect with Kubemqctl as Proxy

Kubemqctl CLI tool provides a very useful command which port-forward all cluster services ports of selected cluster to localhost.

Run:

kubemqctl set cluster proxy

Will show :

Current Kubernetes cluster context connection: kubernetes-local
? Select Kubemq cluster to Proxy kubemq/kubemq-cluster
Current Kubernetes cluster context connection: kubernetes-local
Connecting to kuberenets cluster...Ok.
start proxy for kubemq/kubemq-cluster-1. press CTRL C to close.
kubemq/kubemq-cluster-1:8080 -> 127.0.0.1:8080
kubemq/kubemq-cluster-1:9090 -> 127.0.0.1:9090
kubemq/kubemq-cluster-1:50000 -> 127.0.0.1:50000

Last updated