Skip to main content

IBM Application Gateway Operator Hub Example

The IBM Application Gateway operator is available from OperatorHub.io. The example described in this document shows how the operator can be installed and managed using the Operator Lifecycle Manager and OperatorHub.io.

The IBM Application Gateway can be deployed in Kubernetes as an instance of the custom object type IBMApplicationGateway. This allows the maintenance of the container to be handled by the custom Kubernetes IBM Application Gateway operator.

Operator Deployment Model

The operator deployment of IBM Application Gateway is suitable when:

  • The application to protect is an application that is running outside of the Kubernetes infrastructure
  • The IBM Application Gateway configuration needs to be split across multiple sources
  • There are multiple instances of the IBM Application Gateway required. (The operator will manage all instances with minimal assistance from the Kubernetes administrator)

Example

The following steps will:

  • Install the IBM Application Gateway operator from OperatorHub.io. This includes the installation of the Operator Lifecycle Manager
  • Create an instance of the IBM Application Gateway using the example available on OperatorHub.io
  • Access the protected application via the IBM Application Gateway
  • The page will show the identity and other headers that have been added to the request by the IBM Application Gateway

Steps 1 - 5 are required to setup the Operator Lifecycle Manager and IBM Application Gateway operator. To deploy further applications other than the one listed in the subsequent steps, the operator setup does NOT need to be performed again.

Note: This example does not include authentication. This example illustrates the deployment process for using IBM Application Gateway as a proxy to a protected application. For details on adding authentication, refer to Configuring as an OIDC Relying Party for IBM Security Verify or Configuring as an OIDC Relying Party for IBM Security Verify Access.

Note: This example uses Minikube with a docker driver

  1. Start Minikube.
minikube start --driver docker
  1. Set context.
kubectl config use-context minikube
eval $(minikube docker-env)
  1. Access the IBM Application Gateway operator page on OperatorHub.io in a browser.

  2. Click the Install button on the page and follow the installation instructions.

  3. Ensure that the IBM Application Gateway operator has been created by the Operator Lifecycle Manager. The phase should be set to "Succeeded". Note that this may take a few minutes.

kubectl get csv -n operators

NAME                                      DISPLAY                            VERSION   REPLACES   PHASE
ibm-application-gateway-operator.v0.9.0   IBM Application Gateway Operator   0.9.0                Succeeded
  1. Paste the following into a file named iag_service_account.yaml.
apiVersion: v1
kind: ServiceAccount
metadata:
  name: ibm-application-gateway
  1. Create the service account.
kubectl apply -f iag_service_account.yaml
  1. Paste the following into a file named co.yaml.
apiVersion: ibm.com/v1
kind: IBMApplicationGateway
metadata:
  name: iag-instance
spec:
  replicas: 1
  deployment:
    serviceAccountName: ibm-application-gateway
    image: ibmcom/ibm-application-gateway:20.09.0
    imagePullPolicy: IfNotPresent 
  configuration:
    - type: literal 
      value: |
        version: "20.09"
        resource_servers:
          - path: "/static"
            connection_type: "ssl"
            servers:
              - host: resource-server.au-syd.mybluemix.net
                port: 443
            identity_headers:
              attributes:
                - attribute: groupIds
                  header: iv_groups
                - attribute: AZN_CRED_AUTHZN_ID
                  header: iv_user
              jwt:
                certificate: "B64:QmFnIEF0dHJpYnV0ZXMKICAgIGZyaWVuZGx5TmFtZTogUlNBCiAgICBsb2NhbEtleUlEOiAwMyA4MiAwMSAwMSAwMCBEMyAwMyBCNSBFMiBERSA3RiBEMSAwOCBFOCBBMCA5QyBENCBDRSBCOCAwQSA1QSBEOSAyRCA2NSAzMCBDNyA3MCA5RiAyRCAxRiA0OSBFRSA3MCA1OCA3QyAyRSA0MCBDOCA3MCBGRSBEOSBFNiAzRSA0RSA2QiBENiAzOCBFMCBEMiAyMyAzOCA3QyBGOSA2RCBDMiAxNCAyRSBERCA2NyBGMSBBRCBDOCAwMyAxNCAyQiBGNCAzNCBEOCA4MCA4MSAwNCBFMiBFMCBBRCA2MSBDMCA4NyA2MSA2RiBCQiA5RSAzMiBDNSBEMCA0MiBERSAxMCBEQSAwNCBDNSAzRSA5OCA2QSA2NCBCQiBCNyA2RSBDQiBDRSBGQyBFRCBDMCBEQiBFMyA3RiAzQSBFRCAxQSBBMyBCNSBBMyBDNyBDRCAxMyAwMSA1NCAwMCBGMSBGRCAwNyBCRCA1NSA3QiBCMyA0NCBFMiA4RiA1OSA0RSAyNSBENiBFMSAyQiBFRSA3MSBFOCBGMCA2NSAxNiAxOCA2OCBEQiBCNCBCNiBBMCBDMiAxNiAwMCBBMiA4MSA1RiBGNyA2NCAwNiA1RiBEQSAyQSBENiA3MiBFRiBCMyBBQyBBMyA0N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udzNBQ2hCcGhJWkhFdVdIU09YYmhQenI0CjVQNnVLN1pURVVUR0hXOWQ4L3dUSk9SdGl3NUVKakFhV2lsdW40TDk3bXhxdktpL0xMRnlxOVhBOTNSeWxJNSsKbkJubkwxRFIKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="
                hdr_name: jwt
                claims:
                  - text: www.ibm.com
                    name: iss
                  - attr: AZN_CRED_PRINCIPAL_NAME
                    name: sub
                  - attr: AZN_*
  1. Deploy the custom object.
kubectl apply -f co.yaml
  1. Ensure that the IBM Application Gateway pod has started correctly.
kubectl get all

NAME                                                    READY   STATUS    RESTARTS   AGE
pod/iag-instance-76759f9764-nh4jd                       1/1     Running   0          3s

NAME                                               TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
service/kubernetes                                 ClusterIP      10.96.0.1        <none>        443/TCP             11m

NAME                                               READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/iag-instance                       1/1     1            1           3s

NAME                                                          DESIRED   CURRENT   READY   AGE
replicaset.apps/iag-instance-76759f9764                       1         1         1       3s
  1. Expose the IBM Application Gateway port.
kubectl port-forward deployment.apps/iag-instance 30112:8443
  1. Use a browser to access the demo URL.
https://127.0.0.1:30112/static
  1. The demo page is shown.

This page includes the following pieces that have been added by the IBM Application Gateway:

  • A JWT header has been added
  • The IV-USER, IV-GROUPS and IV-SERVER-NAME headers have been added
  • The JWT has been extracted

Demo Application

  1. Exit the port forward process by pressing ctrl-c in the shell.

  2. Cleanup.

kubectl delete -f co.yaml
kubectl delete csv/ibm-application-gateway-operator.v0.9.0 -n operators
  1. Stop Minikube.
minikube stop