For my current distributed databases project in my studies I should deploy a CockrouchDB Cluster on Google Cloud Kubernetes Engine and run a YCSB Loadtest against it.
The YCSB Client is going to run on another VM so that the results are comparable to other groups results.
Now I need to expose the DB Console on Port 8080 as well as the Database Endpoint on Port 26257.
so far I started changing the cockraochdb-public service to kind: NodePort and exposing its ports using an Ingress. My current Problem is exposing both ports (if possible on their default ports 8080 and 26257) and having them accessible from YCSB.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cockroachdb-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: cockroachdb-global-ip
ingress.citrix.com/insecure-service-type: “tcp”
ingress.citrix.com/insecure-port: “6379”
labels:
app: cockroachdb
spec:
backend:
serviceName: cockroachdb-public
servicePort: 26257
rules:
- http:
paths:
- path: /labs/*
backend:
serviceName: cockroachdb-public
servicePort: 8080
- path: /*
backend:
serviceName: cockroachdb-public
servicePort: 26257
So far I just managed to route it to different paths. I'm not sure if this may work, because the JDBC driver used by YCSB is using TCP not http.
How do I expose two ports of one service using an Ingress for TCP?
Focusing on:
In general when an
Ingressresource is referenced it's forHTTP/HTTPStraffic.You cannot expose the
TCPtraffic with anIngresslike the one mentioned in your question.You could expose your application with service of type
LoadBalancer:By above definition you will expose your
Podsto external traffic on ports:8080and26257with aTCP/UDPLoadBalancer. You can read more about it by following below link:If this
VMis located inGCPinfrastructure you could also take a look on Internal TCP/UDP LoadBalancer:Also I'm not sure about the annotations of your
Ingressresource:In
GKEwhen you are creating anIngresswithout specifying theingress.classyou are using:gcecontroller. Theingress.citrix.comannotations are specific to citrix controller and will not work withgcecontroller.Additional resources: