<p>I am deploying a stream with Spring SCDF. This stream also has a LoadBalancer. I activated that with the</p>

<pre><code>spring.cloud.deployer.kubernetes.createLoadBalancer true
</code></pre>

<p>stream <strong>Deployer</strong> property.
So this LoadBalancer does work now and gives me an external IP that I can access. However this IP is changing each time I am redeploying the stream.</p>

<p>I am using GCP and there am able to provide a static IP. In Kubernetes I can give an ingress a static IP like so:</p>

<pre><code>annotations:
    kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
</code></pre>

<p>I wonder how I can do the same for a deployed stream with Spring SCDF now?</p>

xetra11
<p>In a production deployment setting, you'd want to have an explicit load-balancer (LB) attached to the desired application, so its service can be invoked by other services because there will be a static URL/IP to interact with it. Even if the app is rolling-upgraded or redeployed, you will get a predictable URL/IP. </p>

<p>Here's an example of the LB deployment:</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: FOO-lb
  namespace: kafkazone
spec:
  ports:
  - port: 80
    name: http
    targetPort: 8080
  selector:
    FOOZ: BAR-APP
  type: LoadBalancer
</code></pre>

<p>This deployment would produce a URL/IP. Let's say, for example, the IP address of <code>FOO-lb</code> is: <code>10.20.30.40</code>.</p>

<p>And, when you deploy the stream, you can attach a label selector to the desired application [e.g.: <code>deployer.&lt;yourapp&gt;.kubernetes.deploymentLabels=FOOZ: BAR-APP</code>], so all the incoming traffic to <code>10.20.30.40</code> will automatically be received by the source. You will be, of course, relying on the specific IP to post data or interact with it, and it will not change.</p>
