Skip to content

Commit

Permalink
Update README.md documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chirangaalwis authored and ctienshi committed Jun 13, 2019
1 parent 68a5885 commit e39a9e1
Show file tree
Hide file tree
Showing 4 changed files with 502 additions and 79 deletions.
104 changes: 52 additions & 52 deletions advanced/pattern-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ kubectl config set-context $(kubectl config current-context) --namespace=wso2

The Kubernetes Deployment definition file(s) that need to be updated are as follows:

* `<KUBERNETES_HOME>/advanced/pattern-2//apim-analytics/wso2apim-analytics-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2//apim-gw/wso2apim-gateway-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-1-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-2-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-analytics/wso2apim-analytics-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-gw/wso2apim-gateway-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-1-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-2-deployment.yaml`

If you are using WSO2 API Manager's Key Manager profile, edit the following file.

* `<KUBERNETES_HOME>/advanced/pattern-2//apim-km/wso2apim-km-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-km/wso2apim-km-deployment.yaml`

Else, if you are using WSO2 Identity Server as Key Manager, edit the following file.

* `<KUBERNETES_HOME>/advanced/pattern-2//apim-is-as-km/wso2apim-is-as-km-deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/apim-is-as-km/wso2apim-is-as-km-deployment.yaml`

##### 4. Setup product database(s).

Expand All @@ -109,32 +109,32 @@ on creating the required databases for the deployment.
Provide appropriate connection URLs, corresponding to the created external databases and the relevant driver class names for the data sources defined in
the following files:

* `<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-analytics/conf/worker/deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-1/datasources/master-datasources.xml`
* `<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-2/datasources/master-datasources.xml`
* `<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-analytics/conf/worker/deployment.yaml`
* `<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-1/datasources/master-datasources.xml`
* `<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-2/datasources/master-datasources.xml`

If you are using WSO2 API Manager's Key Manager profile, edit the following file.

* `<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-km/datasources/master-datasources.xml`
* `<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-km/datasources/master-datasources.xml`

Else, if you are using WSO2 Identity Server as Key Manager, edit the following file.

* `<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-is-as-km/datasources/master-datasources.xml`
* `<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-is-as-km/datasources/master-datasources.xml`

Please refer WSO2's [official documentation](https://docs.wso2.com/display/ADMIN44x/Configuring+master-datasources.xml) on configuring data sources.

**Note**:

* For **evaluation purposes**, you can use Kubernetes resources provided in the directory<br>
`<KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/mysql` for deploying the product databases, using MySQL in Kubernetes. However, this approach of product database deployment is
`<KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/mysql` for deploying the product databases, using MySQL in Kubernetes. However, this approach of product database deployment is
**not recommended** for a production setup.

* For using these Kubernetes resources,

first create a Kubernetes ConfigMap for passing database script(s) to the deployment.

```
kubectl create configmap mysql-dbscripts --from-file=<KUBERNETES_HOME>/advanced/pattern-2//extras/confs/mysql/dbscripts/
kubectl create configmap mysql-dbscripts --from-file=<KUBERNETES_HOME>/advanced/pattern-2/extras/confs/mysql/dbscripts/
```
Here, a Network File System (NFS) is needed to be used for persisting MySQL DB data.
Expand All @@ -144,20 +144,20 @@ Please refer WSO2's [official documentation](https://docs.wso2.com/display/ADMIN
Provide read-write-execute permissions to other users for the created folder.
Update the Kubernetes Persistent Volume resource with the corresponding NFS server IP (`NFS_SERVER_IP`) and exported,
NFS server directory path (`NFS_LOCATION_PATH`) in `<KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/volumes/persistent-volumes.yaml`.
NFS server directory path (`NFS_LOCATION_PATH`) in `<KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/volumes/persistent-volumes.yaml`.
Deploy the persistent volume resource and volume claim as follows:
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/mysql/mysql-persistent-volume-claim.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/volumes/persistent-volumes.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/mysql/mysql-persistent-volume-claim.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/volumes/persistent-volumes.yaml
```
Then, create a Kubernetes service (accessible only within the Kubernetes cluster), followed by the MySQL Kubernetes deployment, as follows:
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/mysql/mysql-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//extras/rdbms/mysql/mysql-deployment.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/mysql/mysql-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/extras/rdbms/mysql/mysql-deployment.yaml
```
##### 5. Create a Kubernetes role and a role binding necessary for the Kubernetes API requests made from Kubernetes membership scheme.
Expand All @@ -169,7 +169,7 @@ kubectl create -f <KUBERNETES_HOME>/rbac/rbac.yaml
##### 6. Setup a Network File System (NFS) to be used for persistent storage.
Create and export unique directories within the NFS server instance for each Kubernetes Persistent Volume resource defined in the
`<KUBERNETES_HOME>/advanced/pattern-2//volumes/persistent-volumes.yaml` file.
`<KUBERNETES_HOME>/advanced/pattern-2/volumes/persistent-volumes.yaml` file.
Grant ownership to `wso2carbon` user and `wso2` group, for each of the previously created directories.
Expand Down Expand Up @@ -211,87 +211,87 @@ Then, deploy the Kubernetes Persistent Volume and Volume Claim resources as foll
`<APIM_HOME>/repository/deployment/server` directory in Gateway profile deployment.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-gw/wso2apim-gateway-volume-claim.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-gw/wso2apim-gateway-volume-claim.yaml
```
* Kubernetes Persistent Volume Claim resource for the shared volume mount for runtime artifacts created at
`<APIM_HOME>/repository/deployment/server` directory in Publisher-Store-Traffic-Manager profile deployment.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-volume-claim.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-volume-claim.yaml
```
* [Optional] If you are using WSO2 Identity Server as the Key Manager, Kubernetes Persistent Volume Claim resource for the
shared volume mount for runtime artifacts created at `<IS_KM_HOME>/repository/deployment/server` directory in Key Manager profile deployment.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-is-as-km/wso2apim-is-as-km-volume-claim.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-is-as-km/wso2apim-is-as-km-volume-claim.yaml
```
* Kubernetes Persistent Volume resources for the above Volume Claims created.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//volumes/persistent-volumes.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/volumes/persistent-volumes.yaml
```
##### 7. Create Kubernetes ConfigMaps for passing WSO2 product configurations into the Kubernetes cluster.
```
kubectl create configmap apim-analytics-conf-worker --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-analytics/conf/worker
kubectl create configmap apim-analytics-conf-worker --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-analytics/conf/worker

kubectl create configmap apim-pub-store-tm-1-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-1/
kubectl create configmap apim-pub-store-tm-1-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-1/datasources/
kubectl create configmap apim-pub-store-tm-2-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-2/
kubectl create configmap apim-pub-store-tm-2-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-pub-store-tm-2/datasources/
kubectl create configmap apim-pub-store-tm-1-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-1/
kubectl create configmap apim-pub-store-tm-1-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-1/datasources/
kubectl create configmap apim-pub-store-tm-2-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-2/
kubectl create configmap apim-pub-store-tm-2-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-pub-store-tm-2/datasources/

kubectl create configmap apim-gateway-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-gateway/
kubectl create configmap apim-gateway-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-gateway/axis2/
kubectl create configmap apim-gateway-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-gateway/
kubectl create configmap apim-gateway-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-gateway/axis2/
```
If you are using WSO2 API Manager's Key Manager profile, deploy the following Kubernetes ConfigMaps.
```
kubectl create configmap apim-km-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-km/
kubectl create configmap apim-km-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-km/axis2/
kubectl create configmap apim-km-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-km/datasources/
kubectl create configmap apim-km-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-km/
kubectl create configmap apim-km-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-km/axis2/
kubectl create configmap apim-km-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-km/datasources/
```
Else, if you are using WSO2 Identity Server as Key Manager, deploy the following Kubernetes ConfigMaps.
```
kubectl create configmap apim-is-as-km-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-is-as-km/
kubectl create configmap apim-is-as-km-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-is-as-km/axis2/
kubectl create configmap apim-is-as-km-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2//confs/apim-is-as-km/datasources/
kubectl create configmap apim-is-as-km-conf --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-is-as-km/
kubectl create configmap apim-is-as-km-conf-axis2 --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-is-as-km/axis2/
kubectl create configmap apim-is-as-km-conf-datasources --from-file=<KUBERNETES_HOME>/advanced/pattern-2/confs/apim-is-as-km/datasources/
```
##### 8. Create Kubernetes Services for WSO2 API Manager and Analytics.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-analytics/wso2apim-analytics-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-1-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-2-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-gw/wso2apim-gateway-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-analytics/wso2apim-analytics-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-1-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-2-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-gw/wso2apim-gateway-service.yaml
```
If you are using WSO2 API Manager's Key Manager profile, deploy the following Kubernetes Service.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-km/wso2apim-km-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-km/wso2apim-km-service.yaml
```
Else, if you are using WSO2 Identity Server as Key Manager, deploy the following Kubernetes Service.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-is-as-km/wso2apim-is-as-km-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-is-as-km/wso2apim-is-as-km-service.yaml
```
##### 9. Create Kubernetes Deployments for WSO2 API Manager and Analytics.
* Create the Kubernetes Deployment for WSO2 API Manager Analytics Worker profile.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-analytics/wso2apim-analytics-deployment.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-analytics/wso2apim-analytics-deployment.yaml
```
Ensure that the Analytics Worker profile pod is successfully deployed and ready to serve requests.
Expand All @@ -302,13 +302,13 @@ You can execute `kubectl get pods` command to achive this.
If you are using WSO2 API Manager's Key Manager profile, create the following Kubernetes Deployment.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-km/wso2apim-km-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-km/wso2apim-km-deployment.yaml
```
Else, if you are using WSO2 Identity Server as Key Manager, create the following Kubernetes Deployment.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-is-as-km/wso2apim-is-as-km-service.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-is-as-km/wso2apim-is-as-km-deployment.yaml
```
Ensure that the Key Manager profile pod is successfully deployed and ready to serve requests.
Expand All @@ -318,7 +318,7 @@ Ensure that the Key Manager profile pod is successfully deployed and ready to se
Create the Kubernetes Deployment for the first node of WSO2 API Manager Publisher-Store-Traffic-Manager profiles.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-1-deployment.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-1-deployment.yaml
```
Ensure the Kubernetes pod for the first node of WSO2 API Manager Publisher-Store-Traffic-Manager profiles is successfully
Expand All @@ -327,15 +327,15 @@ deployed and ready to serve requests.
Then, create the Kubernetes Deployment for the second node of WSO2 API Manager Publisher-Store-Traffic-Manager profiles.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-pub-store-tm/wso2apim-pub-store-tm-2-deployment.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-pub-store-tm/wso2apim-pub-store-tm-2-deployment.yaml
```
Ensure the Kubernetes pod is up and running and ready to serve requests.
* Create the Kubernetes Deployment for WSO2 API Manager Gateway profile.
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//apim-gw/wso2apim-gateway-deployment.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/apim-gw/wso2apim-gateway-deployment.yaml
```
Ensure the Kubernetes pod for WSO2 API Manager's Gateway profile is up and running and ready to serve requests.
Expand All @@ -350,8 +350,8 @@ please refer the official documentation, [NGINX Ingress Controller Installation
Finally, deploy the WSO2 API Manager Kubernetes Ingress resources as follows:
```
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//ingresses/wso2apim-gateway-ingress.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2//ingresses/wso2apim-ingress.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/ingresses/wso2apim-gateway-ingress.yaml
kubectl create -f <KUBERNETES_HOME>/advanced/pattern-2/ingresses/wso2apim-ingress.yaml
```
##### 11. Access Management Consoles.
Expand Down Expand Up @@ -392,7 +392,7 @@ simply run `kubectl scale` Kubernetes client command on the terminal.
For example, the following command scales the WSO2 API Manager Gateway profile to the desired number of replicas.
```
kubectl scale --replicas=<n> -f <KUBERNETES_HOME>/advanced/pattern-2//apim-gw/wso2apim-gateway-deployment.yaml
kubectl scale --replicas=<n> -f <KUBERNETES_HOME>/advanced/pattern-2/apim-gw/wso2apim-gateway-deployment.yaml
```
If `<n>` is 2, you are here scaling up this deployment from 1 to 2 container replicas.
Loading

0 comments on commit e39a9e1

Please sign in to comment.