Skip to content

Commit

Permalink
Merge pull request #53 from TIBCOSoftware/EFS-Setup
Browse files Browse the repository at this point in the history
Efs setup
  • Loading branch information
grantbacon-jaspersoft authored Nov 10, 2020
2 parents dd9cce5 + a315033 commit 235a4c0
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
48 changes: 46 additions & 2 deletions platforms/aws/eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
1. [Introduction](#introduction)
1. [Prerequisites](#prerequisites)
1. [EKS Cluster setup](#eks-cluster-setup)

1. [EFS Configuration for applying the customization](#efs-setup-for-customization)
# Introduction
These EKS configuration files help to create a EKS cluster setup.

Expand All @@ -26,10 +26,54 @@ The following software's are required

To verify the cluste setup run `kubectl get svc` and it will list the ClusterIP and it will confirm that the cluster is ready.

Once Cluster is ready and see the [Js-Docker/Kubernets](https://github.com/TIBCOSoftware/js-docker/tree/ENGINFRA-8743-K8s-Fix/kubernetes) for JRS deployment in EKS.
Once Cluster is ready and see the [Js-Docker/Kubernets](https://github.com/TIBCOSoftware/js-docker/tree/master/kubernetes) for JRS deployment in EKS.

Note: It is a basic cluster setup and for advanced security features and some other configuration , refer the [Official AWS Docs](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html)

# EFS Configuration for applying the customization
For large amount of files for customizations in kubernetes deployment , kubernetes secrets may not work. To avoid such type of issues ,
we can use AWS EFS CSI driver for mounting the larger amount of data and same data can be deployed in Jaspersoft.
To Setup EFS Storage for EKS cluster follow below steps.

- To install EFS CSI driver in EKS cluster and creating EFS in aws follow this [AWS-CSI-DRIVER](https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html)
Make sure EFS should be created in same VPC where EKS cluster is created and allow NFS port for EKS cluster CIDR range
- Once everything setup run `aws efs describe-file-systems --query "FileSystems[*].FileSystemId" --output text` to get the EFS file system ID or get the ID from aws console
- modify the `eks-efs-setup.yaml` and replace the volumeHandle with EFS file system ID
````
csi:
driver: efs.csi.aws.com
volumeHandle: fs-xxxxx`
````
- Create jaspersoft name space in kubernetes cluster by running `kubectl apply -f namespace-rbac.yaml` , find the namespace-rbac-yaml file [js-docker/kubernetes](https://github.com/TIBCOSoftware/js-docker/tree/master/kubernetes)
- Create Kubernets storage , persistent volume and persistent volume claim in EKS cluster by running `kubectl apply -f eks-efs-setup.yaml`
- Remove the jasperserver-pro-volume in [Kubernetes-deployment-yaml-file](https://github.com/TIBCOSoftware/js-docker/blob/master/kubernetes/jasperreports-server-service-deployment.yaml) in volumes sections .
````
volumes:
- name: license
secret:
secretName: jasperserver-pro-license
- name: jasperserver-pro-keystore-files-secret
secret:
secretName: jasperserver-pro-jrsks
- name: jasperserver-pro-volume
hostPath:
path: /mnt/jasperser-pro-customization
````
Add jasperserver-pro-volume with below code

````
- name: jasperserver-pro-volume
persistentVolumeClaim:
claimName: jaspersoft-efs-claim
````
- To mount the data from on-premises to EFS , first create ec2 instance on same VPC where eks cluster is created and allow SSH port to copy the data
- Connect to ec2 instance , switch to root user and create efs directory `mkdir efs`
- Mount EFS on ec2 machine bu running EFS mount point similar to like this `sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-XXXX.efs.us-east-1.amazonaws.com:/ efs`.
- To get the EFS mount point , click in EFS which is created and click on attach button and then will see EFS mounting options, copy the EFS mount point from `Using the NFS client:` and run it on ec2 machine.
- For more information see [Mount EFS on EC2 machine](https://docs.aws.amazon.com/efs/latest/ug/wt1-test.html)
- Copy all your customizations in proper volumes , see [JS-Docker-volumes](https://github.com/TIBCOSoftware/js-docker#jasperreports-server-volumes)

Once Everything is setup then see the [Js-Docker/Kubernets](https://github.com/TIBCOSoftware/js-docker/tree/master/kubernetes) for JRS deployment in EKS.

# Copyright
Copyright © 2020. TIBCO Software Inc.
Expand Down
39 changes: 39 additions & 0 deletions platforms/aws/eks/eks-efs-setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
namespace: jaspersoft
provisioner: efs.csi.aws.com

---

apiVersion: v1
kind: PersistentVolume
metadata:
name: jaspersfor-efs-pv
namespace: jaspersoft
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: efs-sc
csi:
driver: efs.csi.aws.com
volumeHandle: fs-xxxxx
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jaspersoft-efs-claim
namespace: jaspersoft
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-sc
resources:
requests:
storage: 5Gi

0 comments on commit 235a4c0

Please sign in to comment.