Skip to content

Latest commit

 

History

History
140 lines (97 loc) · 6.26 KB

README.md

File metadata and controls

140 lines (97 loc) · 6.26 KB

Helm Chart for deployment of WSO2 API Manager with WSO2 API Manager Analytics

Contents

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.

  • 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. This can be easily done via

    helm install stable/nginx-ingress --name nginx-wso2apim-analytics --set rbac.create=true
    
  • A pre-configured Network File System (NFS) to be used as the persistent volume for artifact sharing and persistence. In the NFS server instance, create a Linux system user account named wso2carbon with user id 802 and a system group named wso2 with group id 802. Add the wso2carbon user to the group wso2.

     groupadd --system -g 802 wso2
     useradd --system -g 802 -u 802 wso2carbon
    

Quick Start Guide

In the context of this document,

  • KUBERNETES_HOME will refer to a local copy of the wso2/kubernetes-apim Git repository.
  • HELM_HOME will refer to <KUBERNETES_HOME>/helm/pattern-1.
1. Clone Kubernetes Resources for WSO2 API Manager Git repository.
git clone https://github.com/wso2/kubernetes-apim.git
2. Setup a Network File System (NFS) to be used for persistent storage.

Create and export unique directories within the NFS server instance for each of the following Kubernetes Persistent Volume resources defined in the <HELM_HOME>/apim-with-analytics-conf/values.yaml file:

  • sharedDeploymentLocationPath
  • analyticsDataLocationPath
  • analyticsLocationPath

Grant ownership to wso2carbon user and wso2 group, for each of the previously created directories.

sudo chown -R wso2carbon:wso2 <directory_name>

Grant read-write-execute permissions to the wso2carbon user, for each of the previously created directories.

chmod -R 700 <directory_name>
3. Provide configurations.

a. The default product configurations are available at <HELM_HOME>/apim-with-analytics-conf/confs folder. Change the configurations as necessary.

b. Open the <HELM_HOME>/apim-with-analytics-conf/values.yaml and provide the following values.

Parameter Description
username Your WSO2 username
password Your WSO2 password
email Docker email
namespace Kubernetes Namespace in which the resources are deployed
svcaccount Kubernetes Service Account in the namespace to which product instance pods are attached
serverIp NFS Server IP
sharedDeploymentLocationPath NFS shared deployment directory (<APIM_HOME>/repository/deployment) location for APIM
analyticsDataLocationPath NFS volume for Indexed data for Analytics (<DAS_HOME>/repository/data)
analyticsLocationPath NFS volume for Analytics data for Analytics(<DAS_HOME>/repository/analytics)

c. Open the <HELM_HOME>/apim-with-analytics-deployment/values.yaml and provide the following values.

Parameter Description
namespace Kubernetes Namespace in which the resources are deployed
svcaccount Kubernetes Service Account in the namespace to which product instance pods are attached
4. Deploy the configurations.
helm install --name <RELEASE_NAME> <HELM_HOME>/apim-with-analytics-conf
5. Deploy product database(s) using MySQL in Kubernetes.
helm install --name wso2apim-with-analytics-rdbms-service -f <HELM_HOME>/mysql/values.yaml stable/mysql --namespace <NAMESPACE>

NAMESPACE should be same as in step 3.b.

For a serious deployment (e.g. production grade setup), it is recommended to connect product instances to a user owned and managed RDBMS instance.

6. Deploy WSO2 API Manager with Analytics.
helm install --name <RELEASE_NAME> <HELM_HOME>/apim-with-analytics-deployment
7. Access Management Console:

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

kubectl get ing

e.g.

NAME                                             HOSTS                       ADDRESS         PORTS     AGE
wso2apim-with-analytics-apim-analytics-ingress   wso2apim-analytics          <EXTERNAL-IP>   80, 443   6m
wso2apim-with-analytics-apim-ingress             wso2apim,wso2apim-gateway   <EXTERNAL-IP>   80, 443   7m

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

<EXTERNAL-IP>	wso2apim-analytics
<EXTERNAL-IP>	wso2apim
<EXTERNAL-IP>	wso2apim-gateway

c. Try navigating to https://wso2apim/carbon and https://wso2apim-analytics/carbon from your favorite browser.