Exposing Apps with Ingress Controller

You must do the following configurations to expose BWCE and Flogo apps with Ingress Controller.

Nginx Ingress Controller

For application public endpoints to work, add use-forwarded-headers: "true" in the nginx configmap ingress-nginx-controller under namespace ingress-nginx.

In the values.yaml of nginx-ingress chart, add the following:

controller:
 allowSnippetAnnotations: true 

Kong Ingress Controller

For application public endpoints to work with the Kong ingress controller, perform the following steps:

Setting x_forwarded_prefix Header

For BWCE and Flogo, the header x_forwarded_prefix is needed.

To add this header, there is no direct annotation available in Kong, but you can use a plugin to add it.

    Procedure
  1. Update the name, namespace, and prefix path value in the plugin file.

    Sample plugin file:

    apiVersion: configuration.konghq.com/v1
    kind: KongPlugin
    metadata:
      name: x-forwarded-prefix-flgoapp-cmgoj6kbej6joak8cmmg
      namespace: dp-ns-1
    plugin: post-function
    config:
      access:
      - |
        ngx.var.upstream_x_forwarded_prefix='/tibco/apps/cmgoj6kbej6joak8cmmg/ReceiveHTTPMessageGetSharedData'
  2. Create the plugin by using the following command:

    kubectl apply -f <pluginfile>
  3. After the plugin is created, annotate the ingress with the plugin name. Ensure that the plugin is in the same namespace of ingress.
    annotations: 
         konghq.com/plugins: x-forwarded-prefix-flgoapp-cmgoj6kbej6joak8cmmg

Setting x_forwarded_proto and x_forwarded_port Headers

BWCE Swagger requires x_forwarded_proto and x_forwarded_port headers to have the value of the load balancer protocol and port (HTTPS and 443). The post-function plugin can be used to set these values.

Sample plugin file:

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: set-forwarded-header-echo
  namespace: test-kong-echo
plugin: post-function
config:
  access:
    - |
      ngx.var.upstream_x_forwarded_prefix='/echo/cmfg1k4gptjvfnmg6hfg'
      ngx.var.upstream_x_forwarded_proto='https'
      ngx.var.upstream_x_forwarded_port='443'