Skip to content

Commit

Permalink
Merge pull request #184 from chirangaalwis/kubernetes-apim-v2.6.x-201…
Browse files Browse the repository at this point in the history
…9-q1-master-merge

Merge 2.6.x branch to master branch
  • Loading branch information
ThilinaManamgoda authored May 25, 2019
2 parents f9ea738 + 5c7f142 commit eee10ea
Show file tree
Hide file tree
Showing 218 changed files with 15,503 additions and 12,787 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog
All notable changes to this project 2.6.x per each release will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [v2.6.0.3] - 2018-05-25

### Added
- Kubernetes resources for a simplified, WSO2 API Manager with Analytics deployment
- Define Kubernetes Deployment resource requests and limits
- Integrate support in Kubernetes resources for users with and without WSO2 subscriptions
- Integrate support in Helm resources for users with and without WSO2 subscriptions

### Changed
- Upgrade API version of Kubernetes Deployment resources
- Improvements to Kubernetes deployment management scripts

## [v2.6.0.2] - 2019-04-26

### Changed
- Fix erroneous Kubernetes Persistent Volume mount path in Helm resources for WSO2 API Management deployment pattern 1

## [v2.6.0.1] - 2018-10-10

### Added
- Kubernetes resources for WSO2 API Management deployment patterns 1 and 2
- Helm resources for WSO2 API Management deployment patterns 1 and 2

[v2.6.0.3]: https://github.com/wso2/kubernetes-apim/compare/v2.6.0.2...v2.6.0.3
163 changes: 41 additions & 122 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,41 @@
# Kubernetes and Helm Resources for WSO2 API Manager
*Kubernetes and Helm Resources for container-based deployments of WSO2 API Manager deployment patterns*

This repository contains Kubernetes and Helm resources required for,

* WSO2 API Manager pattern 1

* WSO2 API Manager pattern 2

## Deploy Kubernetes resources

In order to deploy Kubernetes resources for each deployment pattern, follow the **Quick Start Guide**s for each deployment pattern
given below:

* [WSO2 API Manager pattern 1](pattern-1/README.md)

* [WSO2 API Manager pattern 2](pattern-2/README.md)

## Deploy Helm resources

In order to deploy Helm resources for each deployment pattern, follow the **Quick Start Guide**s for each deployment pattern
given below:

* [WSO2 API Manager pattern 1](helm/pattern-1/README.md)

* [WSO2 API Manager pattern 2](helm/pattern-2/README.md)

## How to update configurations

Kubernetes resources for WSO2 products use Kubernetes [ConfigMaps](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/)
to pass on the minimum set of configurations required to setup a product deployment pattern.

For example, the minimum set of configurations required to setup pattern 1 of WSO2 API Manager can be found
in `<KUBERNETES_HOME>/pattern-1/confs` directory. The Kubernetes ConfigMaps are generated from these files.

If you intend to pass on any additional files with configuration changes, third-party libraries, OSGi bundles and security
related artifacts to the Kubernetes cluster, you may mount the desired content to `/home/wso2carbon/wso2-server-volume` directory path within
a WSO2 product Docker container.

The following example depicts how this can be achieved when passing additional configurations to WSO2 API Manager in pattern 1 of WSO2 API Manager:

a. In order to apply the updated configurations, WSO2 product server instances need to be restarted. Hence, un-deploy all the Kubernetes resources
corresponding to the product deployment, if they are already deployed.

b. Create and export a directory within the NFS server instance.

c. Add the additional configuration files, third-party libraries, OSGi bundles and security related artifacts, into appropriate
folders matching that of the relevant WSO2 product home folder structure, within the previously created directory.

d. Grant ownership to `wso2carbon` user and `wso2` group, for the directory created in step (b).

```
sudo chown -R wso2carbon:wso2 <directory_name>
```
e. Grant read-write-execute permissions to the `wso2carbon` user, for the directory created in step (b).

```
chmod -R 700 <directory_name>
```

f. Map the directory created in step (b) to a Kubernetes [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
in the `<KUBERNETES_HOME>/pattern-1/volumes/persistent-volumes.yaml` file. For example, append the following entry to the file:

```
apiVersion: v1
kind: PersistentVolume
metadata:
name: wso2apim-with-analytics-additional-config-pv
labels:
purpose: apim-additional-configs
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
server: <NFS_SERVER_IP>
path: "<NFS_LOCATION_PATH>"
```

Provide the appropriate `NFS_SERVER_IP` and `NFS_LOCATION_PATH`.

g. Create a Kubernetes Persistent Volume Claim to bind with the Kubernetes Persistent Volume created in step e. For example, append the following entry
to the file `<KUBERNETES_HOME>/pattern-1/apim/wso2apim-volume-claim.yaml`:

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wso2apim-with-analytics-additional-config-volume-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: ""
selector:
matchLabels:
purpose: apim-additional-configs
```

h. Update the appropriate Kubernetes [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) resource(s).
For example in the discussed scenario, update the volumes (`spec.template.spec.volumes`) and volume mounts (`spec.template.spec.containers[wso2apim-with-analytics-apim-worker].volumeMounts`) in
`<KUBERNETES_HOME>/pattern-1/apim/wso2apim-deployment.yaml` file as follows:

```
volumeMounts:
...
- name: wso2apim-with-analytics-additional-config-storage-volume
mountPath: "/home/wso2carbon/wso2-server-volume"
volumes:
...
- name: wso2apim-with-analytics-additional-config-storage-volume
persistentVolumeClaim:
claimName: wso2apim-with-analytics-additional-config-volume-claim
```

i. Deploy the Kubernetes resources as defined in section **Quick Start Guide** for the pattern 1 of WSO2 API Manager.
# Kubernetes and Helm Resources for WSO2 API Management

*This repository contains Kubernetes and Helm Resources for container-based deployments
of WSO2 API Manager.*

## Kubernetes resources for API Management deployment patterns

### Simple

* [Deployment Single Node](simple/single-script/README.md)

### Advanced

* [Deployment Pattern 1](advanced/pattern-1/README.md)
* [Deployment Pattern 2](advanced/pattern-2/README.md)

## Helm resources for API Management deployment patterns

* [Deployment Pattern 1](advanced/helm/pattern-1/README.md)
* [Deployment Pattern 2](advanced/helm/pattern-2/README.md)

## Advanced topics

* [Update product configurations](advanced/ManageConfigurations.md)
* [Introduce additional artifacts](advanced/ManageArtifacts.md)

## Changelog

**Change log** from previous v2.6.0.2 release: [View Here](advanced/CHANGELOG.md)

## Reporting issues

We encourage you to report any issues and documentation faults regarding Kubernetes and Helm resources
for WSO2 API Management. Please report your issues [here](https://github.com/wso2/kubernetes-apim/issues).

## Contact us

WSO2 developers can be contacted via the following mailing lists:

* WSO2 Developers Mailing List : [[email protected]](mailto:[email protected])
* WSO2 Architecture Mailing List : [[email protected]](mailto:[email protected])
95 changes: 95 additions & 0 deletions advanced/ManageArtifacts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Manager Non-Configuration Files

## How to introduce additional artifacts

If you intend to pass on any additional artifacts such as, third-party libraries, OSGi bundles and security related artifacts to the Kubernetes cluster,
you may mount the desired content to `/home/wso2carbon/wso2-artifact-volume` directory path within a WSO2 product Docker container.

The following example depicts how this can be achieved when passing additional artifacts to WSO2 API Manager nodes
in a clustered deployment of WSO2 API Manager:

**[1] In order to apply the updated configurations, WSO2 product server instances need to be restarted. Hence, un-deploy all the Kubernetes resources
corresponding to the product deployment, if they are already deployed.**

**[2] Create and export a directory within the NFS server instance.**

**[3] Add the additional third-party libraries, OSGi bundles and security related artifacts, into appropriate
folders matching that of the relevant WSO2 product home folder structure, within the previously created directory.**

**[4] Grant ownership to `wso2carbon` user and `wso2` group, for the directory created in step [2].**

```
sudo chown -R wso2carbon:wso2 <directory_name>
```
**[5] Grant read-write-execute permissions to the `wso2carbon` user, for the directory created in step [2].**

```
chmod -R 700 <directory_name>
```

**[6] Map the directory created in step [2] to a Kubernetes [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
in the persistent volume resource file `<KUBERNETES_HOME>/pattern-1/volumes/persistent-volumes.yaml`**

For example, append the following entry to the file:

```
apiVersion: v1
kind: PersistentVolume
metadata:
name: apim-additional-artifact-pv
labels:
purpose: apim-additional-artifacts
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
server: <NFS_SERVER_IP>
path: "<NFS_LOCATION_PATH>"
```

Provide the appropriate `NFS_SERVER_IP` and `NFS_LOCATION_PATH`.

**[7] Create a Kubernetes Persistent Volume Claim to bind with the Kubernetes Persistent Volume defined in step [6].**

For example, append the following entry to the file `<KUBERNETES_HOME>/pattern-1/apim/wso2apim-volume-claim.yaml`:

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: apim-additional-artifact-volume-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: ""
selector:
matchLabels:
purpose: apim-additional-artifacts
```

**[8] Update the appropriate Kubernetes [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) resource(s).**

For example in the discussed scenario, update the volumes (`spec.template.spec.volumes`) and volume mounts (`spec.template.spec.containers[wso2apim-with-analytics-apim-worker].volumeMounts`) in
`<KUBERNETES_HOME>/pattern-1/apim/wso2apim-deployment.yaml` file as follows:

```
volumeMounts:
...
- name: apim-additional-artifact-storage-volume
mountPath: "/home/wso2carbon/wso2-artifact-volume"
volumes:
...
- name: apim-additional-artifact-storage-volume
persistentVolumeClaim:
claimName: apim-additional-artifact-volume-claim
```

**[9] Deploy the Kubernetes resources as defined in section **Quick Start Guide** for pattern 1 of WSO2 API Manager.**
94 changes: 0 additions & 94 deletions ManageConfigurations.md → advanced/ManageConfigurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,97 +84,3 @@ volumes:
```

**[3] Deploy the Kubernetes resources as defined in section **Quick Start Guide** for the relevant deployment pattern.**

## How to introduce additional artifacts

If you intend to pass on any additional artifacts such as, third-party libraries, OSGi bundles and security related artifacts to the Kubernetes cluster,
you may mount the desired content to `/home/wso2carbon/wso2-artifact-volume` directory path within a WSO2 product Docker container.

The following example depicts how this can be achieved when passing additional artifacts to WSO2 API Manager nodes
in a clustered deployment of WSO2 API Manager:

**[1] In order to apply the updated configurations, WSO2 product server instances need to be restarted. Hence, un-deploy all the Kubernetes resources
corresponding to the product deployment, if they are already deployed.**

**[2] Create and export a directory within the NFS server instance.**

**[3] Add the additional third-party libraries, OSGi bundles and security related artifacts, into appropriate
folders matching that of the relevant WSO2 product home folder structure, within the previously created directory.**

**[4] Grant ownership to `wso2carbon` user and `wso2` group, for the directory created in step [2].**

```
sudo chown -R wso2carbon:wso2 <directory_name>
```
**[5] Grant read-write-execute permissions to the `wso2carbon` user, for the directory created in step [2].**

```
chmod -R 700 <directory_name>
```

**[6] Map the directory created in step [2] to a Kubernetes [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
in the persistent volume resource file `<KUBERNETES_HOME>/pattern-1/volumes/persistent-volumes.yaml`**

For example, append the following entry to the file:

```
apiVersion: v1
kind: PersistentVolume
metadata:
name: apim-additional-artifact-pv
labels:
purpose: apim-additional-artifacts
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
server: <NFS_SERVER_IP>
path: "<NFS_LOCATION_PATH>"
```

Provide the appropriate `NFS_SERVER_IP` and `NFS_LOCATION_PATH`.

**[7] Create a Kubernetes Persistent Volume Claim to bind with the Kubernetes Persistent Volume defined in step [6].**

For example, append the following entry to the file `<KUBERNETES_HOME>/pattern-1/apim/wso2apim-volume-claim.yaml`:

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: apim-additional-artifact-volume-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: ""
selector:
matchLabels:
purpose: apim-additional-artifacts
```

**[8] Update the appropriate Kubernetes [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) resource(s).**

For example in the discussed scenario, update the volumes (`spec.template.spec.volumes`) and volume mounts (`spec.template.spec.containers[wso2apim-with-analytics-apim-worker].volumeMounts`) in
`<KUBERNETES_HOME>/pattern-1/apim/wso2apim-deployment.yaml` file as follows:

```
volumeMounts:
...
- name: apim-additional-artifact-storage-volume
mountPath: "/home/wso2carbon/wso2-artifact-volume"
volumes:
...
- name: apim-additional-artifact-storage-volume
persistentVolumeClaim:
claimName: apim-additional-artifact-volume-claim
```

**[9] Deploy the Kubernetes resources as defined in section **Quick Start Guide** for pattern 1 of WSO2 API Manager.**
Loading

0 comments on commit eee10ea

Please sign in to comment.