NGINX

Install and configure the ingress-based NGINX load balancer for Oracle SOA Suite domain clusters. NGINX supports non-SSL access, SSL termination, and end-to-end SSL access to application URLs. Secure domains support only end-to-end SSL.

For prerequisites, see the Ingress NGINX Helm Chart Requirements.

This topic covers the following configuration and removal procedures. Use the procedures that apply to your SSL configuration:

Add the Helm repository and update its information:

$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
  $ helm repo update

Install the NGINX load balancer for non-SSL access and SSL termination

Deploy the ingress-nginx controller using Helm in the domain namespace:

 $ helm install nginx-ingress -n soans \
        --set controller.service.type=NodePort \
        --set controller.admissionWebhooks.enabled=false \
        ingress-nginx/ingress-nginx

Sample output:

NAME: nginx-ingress
  LAST DEPLOYED: Thu May  5 13:27:30 2022
  NAMESPACE: soans
  STATUS: deployed
  REVISION: 1
  TEST SUITE: None
  NOTES:
  The ingress-nginx controller has been installed.
  Get the application URL by running these commands:
  export HTTP_NODE_PORT=$(kubectl --namespace soans get services -o jsonpath="{.spec.ports[0].nodePort}" nginx-ingress-ingress-nginx-controller)
  export HTTPS_NODE_PORT=$(kubectl --namespace soans get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
  export NODE_IP=$(kubectl --namespace soans get nodes -o jsonpath="{.items[0].status.addresses[1].address}")

  echo "Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP."
  echo "Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS."

  An example ingress that makes use of the controller:

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: example
      namespace: foo
    spec:
      ingressClassName: nginx
      rules:
      - host: www.example.com
        http:
        paths:
          - pathType: Prefix
            backend:
              service:
                name: exampleService
                port:
                  number: 80
          path: /
   # This section is only required if TLS is to be enabled for the ingress
   tls:
    - hosts:
        - www.example.com
      secretName: example-tls

   If TLS is enabled for the ingress, a secret containing the certificate and key must also be provided:

  apiVersion: v1
  kind: Secret
  metadata:
    name: example-tls
    namespace: foo
  data:
   tls.crt: <base64 encoded cert>
   tls.key: <base64 encoded key>
  type: kubernetes.io/tls

Generate a secret for SSL access

For SSL or end-to-end SSL (E2ESSL) access to the Oracle SOA Suite application, create a certificate and a secret:

  1. Create the certificate:

    $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj "/CN=domain1.org"
  2. Create the secret:

    $ kubectl -n soans create secret tls soainfra-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt

Note:

Set CN to the host on which the ingress is deployed. The secret name should be <domainUID>-tls-cert.

Install the NGINX load balancer for end-to-end SSL

  1. Deploy the ingress-nginx controller using Helm in the domain namespace:

     $ helm install nginx-ingress -n soans \
           --set controller.extraArgs.default-ssl-certificate=soans/soainfra-tls-cert \
           --set controller.service.type=NodePort \
           --set controller.admissionWebhooks.enabled=false \
           --set controller.extraArgs.enable-ssl-passthrough=true  
            ingress-nginx/ingress-nginx
    

    Sample output:

        NAME: nginx-ingress
        LAST DEPLOYED: Thu May  5 12:21:50 2022
        NAMESPACE: soans
        STATUS: deployed
        REVISION: 1
        TEST SUITE: None
        NOTES:
        The ingress-nginx controller has been installed.
        Get the application URL by running these commands:
        export HTTP_NODE_PORT=$(kubectl --namespace soans get services -o jsonpath="{.spec.ports[0].nodePort}" nginx-ingress-ingress-nginx-controller)
        export HTTPS_NODE_PORT=$(kubectl --namespace soans get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
        export NODE_IP=$(kubectl --namespace soans get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
    
        echo "Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP."
        echo "Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS."
    
        An example Ingress that makes use of the controller:
    
          apiVersion: networking.k8s.io/v1
          kind: Ingress
          metadata:
            name: example
            namespace: foo
          spec:
            ingressClassName: nginx
            rules:
            - host: www.example.com
              http:
              paths:
                - pathType: Prefix
                  backend:
                    service:
                      name: exampleService
                      port:
                        number: 80
                path: /
         # This section is only required if TLS is to be enabled for the Ingress
         tls:
          - hosts:
              - www.example.com
            secretName: example-tls
    
         If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:
        apiVersion: v1
        kind: Secret
        metadata:
          name: example-tls
          namespace: foo
        data:
         tls.crt: <base64 encoded cert>
         tls.key: <base64 encoded key>
        type: kubernetes.io/tls
    
  2. Check the status of the deployed ingress controller:

    kubectl --namespace soans get services | grep ingress-nginx-controller
    

    Sample output:

     nginx-ingress-ingress-nginx-controller   NodePort    10.106.186.235   <none>        80:32125/TCP,443:31376/TCP   19m
    

Configure NGINX to manage ingresses

  1. Set LOADBALANCER_HOSTNAME to the hostname used to access the Oracle SOA Suite domain application URLs:

    export LOADBALANCER_HOSTNAME=<LOADBALANCER_HOSTNAME>
    

    For example, if you are running the commands from a master node terminal and want to use that node's hostname:

    export LOADBALANCER_HOSTNAME=$(hostname -f)
    
  2. Create the domain ingress in the domain namespace using the sample Helm chart. The ingress uses path-based routing. Default values are defined in ${WORKDIR}/charts/ingress-per-domain/values.yaml:

    type
    TRAEFIK
    sslType
    NONSSL
    wlsDomain.secureEnabled
    false
    domainType
    soa

    Override these values on the command line or edit values.yaml. If necessary, add path rules under spec.rules.host.http.paths for the application URLs that need to be accessed. Update the NGINX template at ${WORKDIR}/charts/ingress-per-domain/templates/nginx-ingress.yaml.

    Note:

    See Ingress per Domain Configuration for the full set of configuration parameters.

    Install ingress-per-domain using the configuration that applies to your domain:

    Non-SSL
     $ cd ${WORKDIR}
     $ helm install soa-nginx-ingress  charts/ingress-per-domain \
         --namespace soans \
         --values charts/ingress-per-domain/values.yaml \
         --set "nginx.hostname=${LOADBALANCER_HOSTNAME}" \
         --set type=NGINX
    

    Sample output:

    NAME: soa-nginx-ingress
    LAST DEPLOYED: Fri Jul 24 09:34:03 2020
    NAMESPACE: soans
    STATUS: deployed
    REVISION: 1
    TEST SUITE: None
    
    SSL termination
     $ cd ${WORKDIR}
     $ helm install soa-nginx-ingress  charts/ingress-per-domain \
         --namespace soans \
         --values charts/ingress-per-domain/values.yaml \
         --set "nginx.hostname=${LOADBALANCER_HOSTNAME}" \
         --set type=NGINX --set sslType=SSL
    
    End-to-end SSL for a non-secure domain

    Note:

    To use E2ESSL, create the Oracle SOA Suite domain with sslEnabled set to true. See Create an Oracle SOA Suite domain.
     $ cd ${WORKDIR}
     $ helm install soa-nginx-ingress  charts/ingress-per-domain \
         --namespace soans \
         --values charts/ingress-per-domain/values.yaml \
         --set type=NGINX --set sslType=E2ESSL
    

    Sample output:

     NAME: soa-nginx-ingress
     LAST DEPLOYED: Fri Jul 24 09:34:03 2020
     NAMESPACE: soans
     STATUS: deployed
     REVISION: 1
     TEST SUITE: None
    
    End-to-end SSL for a secure domain

    Note:

    To use E2ESSL for a secure domain, create the Oracle SOA Suite domain with both sslEnabled and secureEnabled set to true. See Create an Oracle SOA Suite domain.
    $ cd ${WORKDIR}    $ helm install soa-nginx-ingress  charts/ingress-per-domain \
                    --namespace soans \
                    --values charts/ingress-per-domain/values.yaml \
                    --set type=NGINX --set sslType=E2ESSL --set
              wlsDomain.secureEnabled=true
  3. Inspect the services exposed by the deployed ingress using the command for your access configuration:

    Non-SSL
    kubectl describe ingress soainfra-nginx -n soans
    

    Sample output:

    Name:             soainfra-nginx
    Namespace:        soans
    Address:          100.111.150.225
    Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
    Rules:
    Host                                                   Path  Backends
    ----                                                   ----  --------
    domain1.org
                                                         
                                                         /em                        soainfra-adminserver:7001 (10.244.0.45:7001)
                                                         /weblogic/ready            soainfra-adminserver:7001 (10.244.0.45:7001)
                                                         /                          soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                         /soa-infra                 soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                         /soa/composer              soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                         /integration/worklistapp   soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
    Annotations:                                             <none>
    Events:
    Type    Reason  Age    From                      Message
    ----    ------  ----   ----                      -------
    Normal  CREATE  2m32s  nginx-ingress-controller  Ingress soans/soainfra-nginx
    Normal  UPDATE  94s    nginx-ingress-controller  Ingress soans/soainfra-nginx
    
    SSL
     $ kubectl describe ingress soainfra-nginx -n soans
    

    Sample output:

     Name:             soainfra-nginx
     Namespace:        soans
     Address:          100.111.150.225
     Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
     TLS:
       soainfra-tls-cert terminates domain1.org
     Rules:
        Host                                                   Path  Backends
        ----                                                   ----  --------
         domain1.org
                                                          
                                                          /em                        soainfra-adminserver:7001 (10.244.0.45:7001)
                                                          /weblogic/ready            soainfra-adminserver:7001 (10.244.0.45:7001)
                                                          /                          soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                          /soa-infra                 soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                          /soa/composer              soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
                                                          /integration/worklistapp   soainfra-cluster-soa-cluster:7003 (10.244.0.46:8011,10.244.0.47:7003)
     Annotations:                                             kubernetes.io/ingress.class: nginx
                                                              nginx.ingress.kubernetes.io/configuration-snippet:
                                                              more_set_input_headers "X-Forwarded-Proto: https";
                                                              more_set_input_headers "WL-Proxy-SSL: true";
                                                              nginx.ingress.kubernetes.io/ingress.allow-http: false
     Events:
       Type    Reason  Age    From                      Message
       ----    ------  ----   ----                      -------
       Normal  CREATE  3m47s  nginx-ingress-controller  Ingress soans/soainfra-nginx
       Normal  UPDATE  3m25s  nginx-ingress-controller  Ingress soans/soainfra-nginx
    
    End-to-end SSL
     $  kubectl describe ingress  soainfra-nginx-e2essl -n soans
    

    Sample output:

     Name:             soainfra-nginx-e2essl-admin
     Namespace:        soans
     Address:
     Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
     TLS:
      soainfra-tls-cert terminates admin.org
     Rules:
       Host        Path  Backends
       ----        ----  --------
       admin.org
                           soainfra-adminserver-nginx-ssl:7002 (10.244.0.247:7002)
      Annotations:  kubernetes.io/ingress.class: nginx
                    meta.helm.sh/release-name: soa-nginx-ingress
                    meta.helm.sh/release-namespace: soans
                    nginx.ingress.kubernetes.io/ssl-passthrough: true
     Events:
     Type    Reason  Age   From                      Message
     ----    ------  ----  ----                      -------
     Normal  Sync    4s    nginx-ingress-controller  Scheduled for sync
    
     Name:             soainfra-nginx-e2essl-soa
     Namespace:        soans
     Address:
     Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
     TLS:
      soainfra-tls-cert terminates soa.org
     Rules:
      Host        Path  Backends
      ----        ----  --------
      soa.org
                     /   soainfra-cluster-soa-cluster:7004 (10.244.0.249:7004)
     Annotations:  kubernetes.io/ingress.class: nginx
                   meta.helm.sh/release-name: soa-nginx-ingress
                   meta.helm.sh/release-namespace: soans
                   nginx.ingress.kubernetes.io/ssl-passthrough: true
    Events:
       Type    Reason  Age   From                      Message
      ----    ------  ----  ----                      -------
     Normal  Sync    4s    nginx-ingress-controller  Scheduled for sync
    

Verify access to domain application URLs

Non-SSL configuration

  1. Get the NGINX NodePort and store it in LOADBALANCER_NON_SSLPORT:

    LOADBALANCER_NON_SSLPORT=$(kubectl --namespace soans  get services -o jsonpath="{.spec.ports[0].nodePort}" nginx-ingress-ingress-nginx-controller)
    echo ${LOADBALANCER_NON_SSLPORT}
    
  2. Verify that the Oracle SOA Suite domain application URLs are accessible through LOADBALANCER_NON_SSLPORT:

    http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_NON_SSLPORT}/weblogic/ready
    http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_NON_SSLPORT}/em
    http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_NON_SSLPORT}/soa-infra
    http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_NON_SSLPORT}/soa/composer
    http://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_NON_SSLPORT}/integration/worklistapp
    

SSL configuration

  1. Get the NGINX NodePort and store it in LOADBALANCER_SSLPORT:

    LOADBALANCER_SSLPORT=$(kubectl --namespace soans  get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
    echo ${LOADBALANCER_SSLPORT}
    
  2. Verify that the Oracle SOA Suite domain application URLs are accessible through LOADBALANCER_SSLPORT:

    https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_SSLPORT}/weblogic/ready
    https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_SSLPORT}/em
    https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_SSLPORT}/soa-infra
    https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_SSLPORT}/soa/composer
    https://${LOADBALANCER_HOSTNAME}:${LOADBALANCER_SSLPORT}/integration/worklistapp
    

End-to-end SSL configuration

  1. To access the SOA Suite domain application URLs from a remote browser, update the hosts file on the browser's machine: /etc/hosts, or C:\Windows\System32\Drivers\etc\hosts on Windows. Add the following entries using the IP address of the host on which the ingress is deployed:

    X.X.X.X  admin.org
    X.X.X.X  soa.org
    X.X.X.X  osb.org
    

    Note:

    • Replace X.X.X.X with the IP address of the host on which the ingress is deployed.
    • If you use a corporate proxy, update the browser's proxy settings as needed to access the hostnames added to /etc/hosts.
  2. Get the NGINX NodePort and store it in LOADBALANCER_SSLPORT:

    LOADBALANCER_SSLPORT=$(kubectl --namespace soans  get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
    echo ${LOADBALANCER_SSLPORT}
    
  3. Verify that the Oracle SOA Suite domain application URLs are accessible through LOADBALANCER_SSLPORT:

    https://admin.org:${LOADBALANCER_SSLPORT}/weblogic/ready
    https://admin.org:${LOADBALANCER_SSLPORT}/em
    https://soa.org:${LOADBALANCER_SSLPORT}/soa-infra
    https://soa.org:${LOADBALANCER_SSLPORT}/soa/composer
    https://soa.org:${LOADBALANCER_SSLPORT}/integration/worklistapp
    
    

    Note:

    These URLs use the default hostnames. If you changed the hostnames in values.yaml, use those values instead.

Uninstall NGINX ingress

Uninstall the domain ingress Helm release:

helm delete soa-nginx-ingress  -n soans

Uninstall NGINX

Uninstall the NGINX controller Helm release:

helm delete nginx-ingress -n soans