Exposing SCDF services from a Kubernetes deployment

10/2/2019

Base problem is how to access a Spring Cloud Data Flow service from outside the Kubernetes cluster?

By default SCDF apps will be deployed as servcies with type 'ClusterIP'. From my understanding 'ClusterIP' services cannot be exposed from a cluster? I tried to follow the instructions here, i.e. adding deployment properties for both, load balancer and node port, but the services keep being deployed with type 'ClusterIP'.

stream deploy test --properties "deployer.http.kubernetes.createLoadBalancer=true"
stream deploy test --properties "deployer.http.kubernetes.createNodePort=32123"

And in general: deployer properties will be applied to all apps of a stream, isn't there a nice way to do such things for each single app?

-- bove
kubernetes
spring-cloud-dataflow

1 Answer

10/3/2019

If you're using Minikube, you will deploy a stream with NodePort, so you can interact with it via HTTP/PORT when the app is up and running. That can be set up with deployer.<app-name>.kubernetes.createNodePort=32123 deployment property.

When running in a real K8s cluster, however, you'd have to use deployer.http.kubernetes.createLoadBalancer=true, so a real LB can be automatically created for the app. Likewise, you will then have an External-IP to interact with the app.

You shouldn't be doing both for a given app, however. It depends on the K8s environment where you're attempting to deploy the stream.

Both of the above-described deployment properties are optionally configurable at each app or for all the apps in a given stream. The global setting can be triggered via deployer.*... pattern.

I hope this clarifies.

-- Sabby Anandan
Source: StackOverflow