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
Helm
yaml
1
kubemqctl create cluster --grpc-expose LoadBalancer
Copied!
1
helm install kubemq-cluster --set grpc.expose=LoadBalancer -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
grpc:
11
expose: LoadBalancer
Copied!

Expose Rest Load Balancer

Kubemqctl
Helm
yaml
1
kubemqctl create cluster --rest-expose LoadBalancer
Copied!
1
helm install kubemq-cluster --set rest.expose=LoadBalancer -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
rest:
11
expose: LoadBalancer
Copied!

Expose Api Load Balancer

Kubemqctl
Helm
yaml
1
kubemqctl create cluster --api-expose LoadBalancer
Copied!
1
helm install kubemq-cluster --set api.expose=LoadBalancer -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
api:
11
expose: LoadBalancer
Copied!

Connect with Node Port

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

Configure gRPC Node Port

Kubemqctl
Helm
yaml
1
kubemqctl create cluster --grpc-expose NodePort --grpc-node-port 30500
Copied!
1
helm install kubemq-cluster --set grpc.expose=NodePort,grpc-nodePort=30500 -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
grpc:
11
expose: NodePort
12
nodePort: 30500
Copied!

Configure Rest Node Port

Kubemqctl
Helm
yaml
1
kubemqctl create cluster --rest-expose NodePort --rest-node-port 30600
Copied!
1
helm install kubemq-cluster --set rest.expose=NodePort,rest-nodePort=30600 -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
rest:
11
expose: NodePort
12
nodePort: 30500
Copied!

Configure Api Node Port

Kubemqctl
Helm
yaml
1
kubemqctl create cluster --api-expose NodePort --api-node-port 30700
Copied!
1
helm install kubemq-cluster --set api.expose=NodePort,api-nodePort=30700 -n kubemq kubemq-charts/kubemq
Copied!
1
apiVersion: core.k8s.kubemq.io/v1alpha1
2
kind: KubemqCluster
3
metadata:
4
name: kubemq-cluster
5
namesapce: kubemq
6
labels:
7
app: kubemq-cluster
8
spec:
9
replicas: 3
10
api:
11
expose: NodePort
12
nodePort: 30500
Copied!

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:
1
kubemqctl set cluster proxy
Copied!
Will show :
1
Current Kubernetes cluster context connection: kubernetes-local
2
? Select Kubemq cluster to Proxy kubemq/kubemq-cluster
3
Current Kubernetes cluster context connection: kubernetes-local
4
Connecting to kuberenets cluster...Ok.
5
start proxy for kubemq/kubemq-cluster-1. press CTRL C to close.
6
kubemq/kubemq-cluster-1:8080 -> 127.0.0.1:8080
7
kubemq/kubemq-cluster-1:9090 -> 127.0.0.1:9090
8
kubemq/kubemq-cluster-1:50000 -> 127.0.0.1:50000
Copied!