microgateway

by Helm

Helm chartv3.0.1-1App 3.0.1

A Helm chart for WSO2 API Micro Gateway

About this chart

Helm Chart for deployment of WSO2 API Microgateway

Contents

  • Prerequisites
  • Quick Start Guide

Prerequisites

  • In order to use WSO2 Helm resources, you need an active WSO2 subscription. If you do not possess an active WSO2 subscription already, you can sign up for a WSO2 Free Trial Subscription from here . Otherwise you can proceed with docker images which are created using GA releases.

  • Install Git, Helm (and Tiller) and Kubernetes client (compatible with v1.10) in order to run the steps provided in the following quick start guide.

  • An already setup Kubernetes cluster.

  • Install NGINX Ingress Controller. Please note that Helm resources for WSO2 product deployment patterns are compatible with NGINX Ingress Controller Git release nginx-0.22.0.

Quick Start Guide

In the context of this document,

  • KUBERNETES_HOME will refer to a local copy of the wso2/kubernetes-microgateway Git repository.
  • HELM_HOME will refer to <KUBERNETES_HOME>/helm/microgateway.

1. Clone the Kubernetes Resources for WSO2 Identity Server Git repository.

git clone https://github.com/wso2/kubernetes-microgateway.git

2. Provide configurations.

a. The default product configurations are available at <HELM_HOME>/confs folder. Change the configurations as necessary.

b. Open the <HELM_HOME>/values.yaml and provide the following values.

WSO2 Subscription Configurations

ParameterDescriptionDefault Value
wso2.subscription.usernameYour WSO2 Subscription username""
wso2.subscription.passwordYour WSO2 Subscription password""

If you do not have active WSO2 subscription do not change the parameters wso2.deployment.username, wso2.deployment.password.

Centralized Logging Configurations

ParameterDescriptionDefault Value
wso2.centralizedLogging.enabledEnable Centralized logging for WSO2 componentstrue
wso2.centralizedLogging.logstash.imageTagLogstash Sidecar container image tag7.2.0
wso2.centralizedLogging.logstash.elasticsearch.usernameElasticsearch usernameelastic
wso2.centralizedLogging.logstash.elasticsearch.passwordElasticsearch passwordchangeme
wso2.centralizedLogging.logstash.indexNodeID.wso2ISNodeElasticsearch IS Node log index ID(index name: ${NODE_ID}-${NODE_IP})wso2

Micro Gateway Configurations

ParameterDescriptionDefault Value
wso2.deployment.wso2microgw.dockerRegistryDocker registry of the microgateway image""
wso2.deployment.wso2microgw.imageNameImage name for microgateway node""
wso2.deployment.wso2microgw.imageTagImage tag for microgateway node""
wso2.deployment.wso2microgw.replicasNumber of replicas for microgateway node1
wso2.deployment.wso2microgw.minReadySecondsRefer to doc1 75
wso2.deployment.wso2microgw.strategy.rollingUpdate.maxSurgeRefer to doc1
wso2.deployment.wso2microgw.strategy.rollingUpdate.maxUnavailableRefer to doc0
wso2.deployment.wso2microgw.livenessProbe.initialDelaySecondsInitial delay for the live-ness probe for microgateway node40
wso2.deployment.wso2microgw.livenessProbe.periodSecondsPeriod of the live-ness probe for microgateway node10
wso2.deployment.wso2microgw.readinessProbe.initialDelaySecondsInitial delay for the readiness probe for microgateway node40
wso2.deployment.wso2microgw.readinessProbe.periodSecondsPeriod of the readiness probe for microgateway node10
wso2.deployment.wso2microgw.imagePullPolicyRefer to docAlways
wso2.deployment.wso2microgw.resources.requests.memoryThe minimum amount of memory that should be allocated for a Pod1Gi
wso2.deployment.wso2microgw.resources.requests.cpuThe minimum amount of CPU that should be allocated for a Pod2000m
wso2.deployment.wso2microgw.resources.limits.memoryThe maximum amount of memory that should be allocated for a Pod2Gi
wso2.deployment.wso2microgw.resources.limits.cpuThe maximum amount of CPU that should be allocated for a Pod2000m

Note: The above mentioned default, minimum resource amounts for running WSO2 API Microgateway are based on its official documentation.

3. Deploy WSO2 Identity server.

helm install --dep-up --name <RELEASE_NAME> <HELM_HOME> --namespace <NAMESPACE>

NAMESPACE should be the Kubernetes Namespace in which the resources are deployed

4. Access Management Console.

Default deployment will expose <RELEASE_NAME> host (to expose Administrative services and Management Console).

To access the console in the environment,

a. Obtain the external IP (EXTERNAL-IP) of the Ingress resources by listing down the Kubernetes Ingresses.

kubectl get ing -n <NAMESPACE>
NAME                       HOSTS                ADDRESS        PORTS     AGE
wso2micro-gw-ingress       <RELEASE_NAME>       <EXTERNAL-IP>  80, 443   3m

b. Add the above host as an entry in /etc/hosts file as follows:

<EXTERNAL-IP>	<RELEASE_NAME>

Enabling Centralized Logging

Centralized logging with Logstash and Elasticsearch is disabled by default. However, if it is required to be enabled, the following steps should be followed.

  1. Set centralizedLogging.enabled to true in the values.yaml file.
  2. Add elasticsearch Helm repository to download sub-charts required for Centralized logging.
helm repo add elasticsearch https://helm.elastic.co
  1. Create a requirements.yaml at <HELM_HOME> and add the following dependencies in the file.
dependencies:
  - name: kibana
    version: "7.2.1-0"
    repository: "https://helm.elastic.co"
    condition: wso2.centralizedLogging.enabled
  - name: elasticsearch
    version: "7.2.1-0"
    repository: "https://helm.elastic.co"
    condition: wso2.centralizedLogging.enabled

  1. Add override configurations for Elasticsearch in the values.yaml file.
wso2:
  ( ... )
  
elasticsearch:
  clusterName: wso2-elasticsearch

Deploy microgateway with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has microgateway on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmicrogateway is pinned at v3.0.1-1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply