Skip to content

Deploy the Microgateway on a Kubernetes Cluster

You can easily deploy WSO2 API Microgateway on a Kubernetes cluster. Follow the step-by-step instructions below to quickly download, configure, and deploy the Microgateway on a Kubernetes cluster.

Note

Before you begin,

  1. Download the Kubernetes Microgateway Helm chart ZIP file from here and extract it. Let's refer to the extracted Microgateway Helm chart directory location as <K8S_MICROGATEWAY_HOME> throughout this section.
  2. Edit the <K8S_MICROGATEWAY_HOME>/values.yaml file and specify appropriate values to configure the Kubernetes Microgateway Helm chart.

    values.yaml

    # Micro-gateway configurations
    
    #Define the number of gateways to be deployed
    replicaCount: 2
    
    #Define a namespace to deploy micro-gateways
    #If you are not changing the below value microgateway will be deployed in a namespace called “wso2-microgateway” 
    namespace: wso2-microgateway
    
    # Define Docker credentials
    # Use cloud login email as the email
    # Use the value of Base64(cloud-email:cloud-password) as the auth value
    auths:
      https://docker.cloud.wso2.com:
        email: wso2.microgateway@sample.com                                #FIX ME
        auth: d3NvMi5taWNyb2dhdGV3YXlAc2FtcGxlLmNvbTpwYXMkd29yZCEyMw==     #FIX ME
    
    ## Include the organization authentication information
    organizationDetails:
        tenantName: myCompany                                            #FIX ME
        email: wso2.microgateway@sample.com                              #FIX ME
        password: pas$word!23                                            #FIX ME
        label: gateway_label                                             #FIX ME
    
    #Define the custom-URL of the microgateway service along with the certificate information
    #Please enter the values of a cert and a key of your domain in a one line as given by the sample below
    #For testing purposes you can use the below details without any change
    ingress:
        host: wso2-microgateway.sample.com                                #FIX ME
        tls:
            tlsCertificate: MIIECjCCAvKgAwIBAgIJAMUo+deRyB48MA0GCSqGSIb3DQEBCwUAMIGZMQswCQYDVQQGEwJTTDEQMA4GA1UECAwHY29sb21ibzEQMA4GA1UEBwwHY29sb21ibzENMAsGA1UECgwEd3NvMjEOMAwGA1UECwwFY2xvdWQxJTAjBgNVBAMMHHdzbzItbWljcm9nYXRld2F5LnNhbXBsZS5jb20xIDAeBgkqhkiG9w0BCQEWEW1hZGVlc2hhQHdzbzIuY29tMB4XD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X+j6TGue3QobvQo5QflPj8jvptzpX9bZASH3gvReFWwY2nZV4T34GE5DuMFiW3QG5E0pJhP9Vhf9B1jB6wKBgQChrphh/6w6Ayp5xG8sxCHwAo67/FgMNaD7z7/cmC4dspgGkCGgQHDZ4Sfxn4k6+/cvC6upjNgIV1PdxmI3hwSF3YCP7tnzbwzAwhwnrBcXcl9aKbQ17NfNZLcUrzLIlQvusFtgdK0si5tysLHTpYMpQ1ATRrxhGvAayj+rhzsXCQKBgEClyie9W1scGPIgRKSE+GWIAeMgBbJ9xfwvgMmD3IH6hbnILJsOA+0IBPxrGdeyfukjmUy99eCO9lVUiaFyAyJdUm7Yby1BhHZnpWW3Zb8SfpMwPgLJzR/m5IbglZUh/rhEDayBQb7vFcpD3WmBR5BLvLkfmDqYt9QRyqbSrGxvAoGBAJRrFw5Mg/ksp4jzQ9G7qZf0uImWlAq0mrXIIBlfoWkGuy2oqTtN542NqDoEUdpH3UwKaOQOVAriVoMvY8SwrOrh4O6K/KTknnaxo2gMFjgttEMzVZkRM5xsifLUB2ZaV0kK/eiEmdMUnEbuUb0+hzfS7D/Pt2qClSDlCk/rgNEJ
    
    
    # Define the allocated resources per gateway
    resources:
       limits:
         cpu: 400m
         memory: 1024Mi
       requests:
         cpu: 400m
         memory: 1024Mi
    
    
    
  3. Navigate to the <K8S_MICROGATEWAY_HOME> directory using the command line and execute the following command to deploy the Microgateway in your Kubernetes cluster:

    helm install --name micro-gateways-deployment .

    This will set up the following deployment in your Kubernetes cluster:
    Kubernetes deployment
    Once you set up the deployment, you need to obtain the hostname of your Nginx load balancer and set it as the DNS of your Microgateway custom URL.

  4. Execute the following command to obtain the hostname of the Nginx load balancer:

    kubectl get svc micro-gateways-deployment-private-jet-mode-nginx-controller -o yaml

    This provides an output similar to the following, which displays the hostname at the end:

    ...
    loadBalancer:
        ingress:
        - hostname: abc2adaa290d711e994d802f89b5426a-1544968781.us-west-2.elb.amazonaws.com
  5. Use the hostname obtained above as the DNS record of your custom URL domain.

    Note

    If you use the sample hostname given in the values.yaml file (i.e., wso2-microgateway.sample.com), you need to add the following entry in the /etc/hosts file of your machine to access the Microgateway:

    <> sample.com

Now that you have set up the DNS of your Microgateway custom URL, you can follow the steps here to test your Microgateway deployment.

Once you test the deployment, you can access the Microgateway via the Microgateway URL.

Top