TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later...

34
TIBCO Software Inc. Global Headquarters 3307 Hillview Avenue Palo Alto, CA 94304 Tel: +1 650-846-1000 Toll Free: 1 800-420-8450 Fax: +1 650-846-1005 www.tibco.com TIBCO fuels digital business by enabling better decisions and faster, smarter actions through the TIBCO Connected Intelligence Cloud. From APIs and systems to devices and people, we interconnect everything, capture data in real time wherever it is, and augment the intelligence of your business through analytical insights. Thousands of customers around the globe rely on us to build compelling experiences, energize operations, and propel innovation. Learn how TIBCO makes digital smarter at www.tibco.com. TIBCO Enterprise Message Service™ on EKS This document describes how to run TIBCO Enterprise Message Service servers in an Amazon Elastic Container Service for Kubernetes (Amazon EKS). Version 1.0 March 2019 Initial Document

Transcript of TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later...

Page 1: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

TIBCO Software Inc.

Global Headquarters

3307 Hillview Avenue

Palo Alto, CA 94304

Tel: +1 650-846-1000

Toll Free: 1 800-420-8450

Fax: +1 650-846-1005

www.tibco.com

TIBCO fuels digital business by enabling better decisions and faster, smarter actions through the TIBCO Connected Intelligence Cloud. From APIs and systems to devices and people, we interconnect everything, capture data in real time wherever it is, and augment the intelligence of your business through analytical insights. Thousands of customers around the globe rely on us to build compelling experiences, energize operations, and propel innovation. Learn how TIBCO makes digital smarter at www.tibco.com.

TIBCO Enterprise Message Service™ on EKS This document describes how to run TIBCO Enterprise Message Service servers in an Amazon Elastic Container Service for Kubernetes (Amazon EKS).

Version 1.0 March 2019 Initial Document

Page 2: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 2

Copyright Notice COPYRIGHT© 2019 TIBCO Software Inc. All rights reserved.

Trademarks TIBCO, the TIBCO logo, TIBCO Enterprise Message Service, TIBCO FTL, Rendezvous, and SmartSockets are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only.

Content Warranty The information in this document is subject to change without notice. THIS DOCUMENT IS PROVIDED "AS IS" AND TIBCO MAKES NO WARRANTY, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO ALL WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. TIBCO Software Inc. shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance or use of this material.

For more information, please contact:

TIBCO Software Inc. 3303 Hillview Avenue Palo Alto, CA 94304 USA

Page 3: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 3

Table of Contents

1 Overview ................................................................................................................................ 6 1.1 Supported Versions ........................................................................................................................ 6 1.2 Excluded TIBCO EMS Features ........................................................................................................ 6 1.3 Prerequisites .................................................................................................................................. 7 1.4 Prepare Local Environment ............................................................................................................. 7 1.5 Prepare Preliminary AWS Account and Kubernetes Configuration .................................................. 7

2 Fault Tolerance and Shared Folder Setup ................................................................................ 9 2.1 Shared Storage ............................................................................................................................... 9 2.2 Create the EFS File System .............................................................................................................. 9

3 The EMS Docker image ......................................................................................................... 11 3.1 Creating the Base Docker Image ................................................................................................... 11 3.2 Extending the Base Docker Image ................................................................................................. 14

3.2.1 Provisioning FTL Client Libraries to Use the Corresponding Transports ...................................... 14 3.2.2 Provisioning Custom JAAS Authentication or JACI authorization Modules .................................. 14

3.3 Hosting the Docker Image ............................................................................................................. 15 3.3.1 Configure the AWS Container Registry ........................................................................................ 15 3.3.2 Push the EMS Docker Image to ECR............................................................................................. 15

4 AWS EKS Setup ..................................................................................................................... 16 4.1 Create a New Elastic Container Service for Kubernetes (EKS) ........................................................ 16 4.2 Configuring the Security Groups for EFS ........................................................................................ 17 4.3 Configuring the Elastic Kubernetes Service with Kubectl ............................................................... 17

4.3.1 Create a New Namespace ......................................................................................................... 17 4.3.2 Creating the Cluster Role for EFS ............................................................................................... 18 4.3.3 Provisioning the EFS File System ............................................................................................... 18

4.4 EMS Server Template ................................................................................................................... 20 4.4.1 Adjusting the Services NodePort Range (Optional) .................................................................... 20 4.4.2 TIBEMSD Template ................................................................................................................... 20 4.4.3 Alternate TIBEMSD Template.................................................................................................... 23 4.4.4 Creating a Deployment and Service .......................................................................................... 23 4.4.5 Stopping or Deleting an EMS Server .......................................................................................... 24 4.4.6 EMS Server Configuration ......................................................................................................... 24 4.4.7 Connecting to the EMS Server Container ................................................................................... 24

4.5 Central Administration Server Template ....................................................................................... 25

5 Accessing the EMS Server ..................................................................................................... 26 5.1 Security Group Inbound Security Rules ......................................................................................... 26 5.2 Accessing the EMS Server ............................................................................................................. 26 5.3 Modifying the Connection Factories in the EMS Server ................................................................. 26

Appendix A: Health Checks for the EMS Server ......................................................................... 28 A.1 Liveness and Readiness Probes ..................................................................................................... 28 A.2 Implementation ............................................................................................................................ 28

A.2.1 Liveness Health Check ............................................................................................................... 29 A.2.2 Readiness Health Check ............................................................................................................ 30 A.2.3 Configuring Liveness and Readiness Probes .............................................................................. 31

Page 4: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 4

A.2.4 Recommended settings ............................................................................................................ 31

Appendix B: TLS Configuration .................................................................................................. 32 B.1 Creating a Secret .......................................................................................................................... 32 B.2 Adjusting the Template................................................................................................................. 33 B.3 Adjusting the tibemscreateimage EMS Docker image build script ........................................ 34 B.4 Applying the Adjustments ............................................................................................................. 34

Page 5: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 5

Table of Figures FIGURE 1 - EFS FILE SYSTEM CREATION.............................................................................................................................. 10 FIGURE 2 - RUNNING TIBEMSCREATEIMAGE......................................................................................................................... 11 FIGURE 3 - RUNNING EMS DOCKER IMAGE STANDALONE ....................................................................................................... 12 FIGURE 4 - RUNNING DOCKER EMSCA IMAGE STANDALONE ................................................................................................... 12 FIGURE 5 - DOCKERFILE FTL EXAMPLE ................................................................................................................................ 14 FIGURE 6 - DOCKER BUILD WITH FTL LIBS............................................................................................................................ 14 FIGURE 7 - DOCKERFILE SECURITY EXAMPLE ......................................................................................................................... 14 FIGURE 8 - EMS SECURITY PATHS ..................................................................................................................................... 15 FIGURE 9 - CREATE ECR REPOSITORY ................................................................................................................................ 15 FIGURE 10 - GET ECR LOGIN ........................................................................................................................................... 15 FIGURE 11 - TAG EMS DOCKER IMAGE .............................................................................................................................. 15 FIGURE 12 - KUBECTL RESULTS ......................................................................................................................................... 16 FIGURE 13 - KUBECTL GET NODES ..................................................................................................................................... 17 FIGURE 14 - CREATE TIBEMS NAMESPACE ........................................................................................................................... 17 FIGURE 15 - SUCCESSFUL CREATION OF PV AND PVC ............................................................................................................ 20 FIGURE 16 - CHECK DEPLOYMENT RESULTS ......................................................................................................................... 24 FIGURE 17 - TO STOP, START, AND DELETE THE DEPLOYMENT ................................................................................................. 24 FIGURE 18 - APPLY THE EMSA TEMPLATE .......................................................................................................................... 25

Page 6: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 6

1 Overview

Running TIBCO Enterprise Message Service (EMS) on Amazon EKS involves:

• Configuring the Amazon Elastic Container Service for Kubernetes (EKS) for TIBCO Enterprise Message Service (EMS).

• Configuring the Amazon Elastic File System (EFS) for the EMS shared storage • Configuring the Amazon Elastic Container Registry (ECR) for the Docker® image registry • Creating a Docker® image embedding EMS and hosting it in ECR • Configuring and creating EMS Kubernetes containers based on the EMS Docker image

1.1 Supported Versions

The steps described in this document are supported for the following versions of the products and components involved:

• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most recent version, (18.09.2), to address

recent security vulnerabilities • Amazon Linux 2 for EKS (amazon-eks-node-1.11-v20190109 (ami-c24db5df6badc35a)) • Kubernetes 1.11 or newer

1.2 Excluded TIBCO EMS Features

As of March 2019, TIBCO EMS on EKS supports all EMS features, with the following exceptions:

• Excludes transports for TIBCO Rendezvous® • Excludes transports for TIBCO SmartSockets® • Excludes stores of type dbstore • Excludes stores of type mstores

Page 7: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 7

1.3 Prerequisites

The reader of this document must be familiar with:

• Docker concepts • Amazon AWS console and the AWS CLI • Kubernetes installation and administration • TIBCO EMS configuration • NFSv4 (EFS)

1.4 Prepare Local Environment

The following infrastructure should already be in place:

• A Linux or MacOS machine equipped for building Docker images • JRE installation package (.tar.gz) • TIBCO EMS 8.4.1 installer (.zip) • Tibems_eks_files.zip (EMS Kubernetes yaml files) • TIB_ems_8.4.0_probes.zip (optional)

Create a directory, place tibems_eks_files.zip in the directory. Unzip tibems_eks_files.zip. Place the TIBCO EMS installer zip, the JRE tar file, and the probes zip file in the newly created tibems_eks_files directory.

1.5 Prepare Preliminary AWS Account and Kubernetes Configuration

Use the following to prepare the preliminary environment to install EMS on EKS. For more details on preparing AWS, see the Getting started documentation for EKS.

• An AWS account is required. If necessary, create one at http://aws.amazon.com and follow the on-screen instructions.

• Use the region selector in the navigation bar to choose the AWS Region to deploy EMS in EKS. The documentation will refer to us-east-1. Note: Currently, not all AWS regions and Availability Zones (AZ) support EKS. As of February 2019, the following AWS regions support EKS: US EU AP N. Virginia (us-east-1) Ireland (eu-west-1) Singapore (ap-southeast-1) Ohio (us-east-2) Frankfurt (eu-central-1) Tokyo (ap-northeast-1) Oregon (us-west-2) Stockholm (eu-north-1) Sydney (ap-southeast-2) Seoul (ap-northeast-2)

• Install and configure Amazon AWS CLI on the workstation used. Note: After creating the AWS account, ensure the AWS credential and config files are created, and contain the appropriate AWS key, secret key, profile, and region.

Page 8: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 8

Export the following environmental variable: export AWS_SDK_LOAD_CONFIG=1 when the default AIM Role is not used.

• Install Docker on the workstation to build the TIBCO EMS images.

• Install the kubectl command-line tool do manage and deploy applications to Kubernetes in AWS from a workstation.

Page 9: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 9

2 Fault Tolerance and Shared Folder Setup

2.1 Shared Storage

A traditional EMS server configured for fault tolerance relies on its state being shared by a primary and a secondary instance, one being in the active state while the other is in standby, ready to take over. The shared state relies on the server store and configuration files to be located on a shared storage device. The fault tolerance model used by EMS on Kubernetes/EKS is different in that it relies on Kubernetes restart mechanisms. Only one EMS server instance is running and, in case of a server failure, will be restarted inside its container. In case of a failure of the container or of the corresponding cluster node, the cluster will recreate the container, possibly on a different AWS EC2 node, and restart the EMS server there. Within the container, the health of the EMS server is optionally monitored by two health check probes: the liveness and readiness probes. At this point, the implementation of these is provided as a separate package to be included in the EMS Docker image. Health check probes are detailed in Appendix A. In any case, the server still needs its state to be shared. In AWS, this can only be accomplished with the AWS Elastic File System (EFS).

2.2 Create the EFS File System

This section outlines creating the EFS file system. Though the EFS file system can be created through the AWS CLI, the following will create the EFS file system through the AWS Console.

• Log on to the AWS console, and navigate to the EFS service • Click on Create file system • Select the appropriate VPC, and select the available mount targets in the three (3)

availability zones where the EKS cluster will be configured, and click on next step. • Select either General Purpose or Max I/O for the performance mode. GP is recommended. • Select either Bursting or Provisioned for the throughput mode to be used. For Provisioned,

the higher the MiB/S for the throughput, the better. However, this can be expensive, and should only be considered for a production environment.

• Check Enable encryption, if required. Click on next step. Note: These selections are recommended, but not required. Select the Optional Configuration settings based on specific needs and environment.

• Review the settings, and click on Create File System to create the new EFS file system • The Success screen will appear after the EFS file system is created. Ensure that there is a

mount target for all Availability Zones in the region. After a few minutes, the mount targets will change from creating to available. EFS is now available. The following is an example of the newly created file system.

Page 10: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 10

Figure 1 - EFS File System Creation

Page 11: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 11

3 The EMS Docker image

3.1 Creating the Base Docker Image

The content of the container that will run on EKS derives from a Docker image that first needs to be created and then hosted in the AWS Elastic Container Registry (ECR). To create the Docker images, use the following:

• Use docker images to ensure Docker is installed and running • To create an EMS Docker image, use the tibemscreateimage script on the machine

equipped for building Docker images. • The script needs to be pointed to the software packages to be installed: the EMS installation

package, optional EMS hotfixes, the health check probes package and an optional Java package. It lets you choose which EMS installation features to embed (server, client, emsca, dev, source, hibernate) and whether to save the image as an archive. It also creates a user and group set to the required uid and gid.

Figure 2 - Running Tibemscreateimage

• In the above figure, a Docker image is created with the server and emsca EMS installation features based on the EMS 8.4.1 Linux installation package, the probe package, a JVM, the 1000 uid and the 1000 gid. It is up to you to first download the TIB_ems_8.4.1_linux_x86_64.zip, TIB_ems_8.4.0_probes.zip and Java packages.

To test and run this image stand-alone:

Page 12: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 12

• Use docker run -p 7222:7222 -v `pwd`:/shared ems:latest tibemsd

Figure 3 - Running EMS Docker image standalone

• This creates a sample EMS server folder hierarchy and configuration in the current directory and starts the corresponding server.

Figure 4 - Running Docker EMSCA image standalone

• This creates a sample Central Administration server folder hierarchy and configuration in the current directory and starts the corresponding server.

It is also possible to override the default settings. This following example starts an EMS server using the <path to shared location>/<your server config file> configuration.

Page 13: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 13

> docker run -p 7222:7222 -v <path to shared location>:/shared \ ems:latest tibemsd -config /shared/<your server config file>

Feel free to modify the tibemscreateimage script to suit the environment/needs.

Page 14: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 14

3.2 Extending the Base Docker Image

The base Docker image can be extended to include FTL client libraries and custom JAAS authentication and JACI authorization modules.

3.2.1 Provisioning FTL Client Libraries to Use the Corresponding Transports • Copy the FTL client library files to a temporary folder. • From the temporary folder, use a Dockerfile based on the example given below to copy

these files into the base Docker image:

Figure 5 - Dockerfile FTL example

Figure 6 - Docker build with FTL libs

• Customize the EMS configuration, to include /opt/tibco/ems/docker/ftl in the Module Path property. Note: Modify the tibemscreateimage script in the tibemsd-configbase.json section under tibemsd: to include the Module Path. See the TIBCO Enterprise Message Service Users Guide for details.

3.2.2 Provisioning Custom JAAS Authentication or JACI authorization Modules

NOTE: If using EMSCA on AWS, this step should be followed to ensure EMSCA is secure! See the JAAS module section in the EMS Users Guide as well as the EMS Central Administration Guide on details for setting up JAAS in EMS.

• Copy your custom JAAS or JACI plugin files, including the static configuration files they may rely on, to a temporary folder.

• From the temporary folder, use a Dockerfile based on the example given below to copy these files into the base Docker image:

Figure 7 - Dockerfile Security example

• Customize the EMS configuration, to include the relevant paths to those files in the Security Class path, JAAS Classpath and JACI Classpath properties. Modify the “ENV PATH” in the tibemscreateimage script to include the relevant paths required.

Page 15: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 15

• Note that the other required files are in their usual location: /opt/tibco/ems/<version>/bin and /opt/tibco/ems/<version>/lib For example: /opt/tibco/ems/docker/security/user_jaas_plugin.jar:/opt/tibco/ems/8.4/bin/tibemsd_jaas.jar:/opt/tibco/ems/8.4/lib/tibjmsadmin.jar, etc.

Figure 8 - EMS Security Paths

3.3 Hosting the Docker Image

3.3.1 Configure the AWS Container Registry A new ECR repository must be created to host the EMS Docker image.

• Create a new ECR repository named tibco/tibems in AWS. The repository can be created via the AWS CLI or via the console. Please note the URL of your ECR repository (e.g. 123456789012.dkr.ecr.us-east-1.amazonaws.com).

Figure 9 - Create ECR Repository

• Retrieve the login command to use to authenticate your Docker client with AWS registry. Adjust AWS region and access keys created in the previous step.

Figure 10 - Get ECR login

• Execute Docker login command returned in the previous step.

3.3.2 Push the EMS Docker Image to ECR • Tag the image and push the Docker image to the ECR repository using the URL the

appropriate repository account ID instead of 123456789012.

Figure 11 - Tag EMS Docker image

• Push the EMS Docker image to ECR. Replace 123456789012 with the appropriate repository account ID.

Page 16: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 16

4 AWS EKS Setup

4.1 Create a New Elastic Container Service for Kubernetes (EKS)

A new Kubernetes cluster must be created in EKS. There are several steps required to create the Kubernetes cluster in EKS. Follow the Getting Started EKS User Guide to create a new Kubernetes cluster. Cluster can be created via the AWS console or AWS CLI. Creating the EKS cluster via the AWS CLI is recommended. Note: If AWS account has multiple roles or there are multiple clusters, it is recommended that the AWS CLI be used, and the –profile=XXX is used to ensure the correct permissions/roles are used. Note: Existing VPC, subnets, and security groups can be used. If so, skip “Create your Amazon EKS Cluster VPC” in the Getting Started EKS Users Guide. Use the following as guidelines:

• Follow the prerequisites and steps 1-3 • For Cluster creation:

o Choose a name for the cluster that identifies its use, such as EMS-Cluster. o Ensure Kubernetes version 1.11 is used. o Ensure that an IAM role with the appropriate capabilities is available to manage the

resources. o Select three (3) subnets (Availability Zones) in the cluster. The subnets must match

the subnets selected when creating the EFS filesystem. (section 2.2). o The EKS cluster creation will take several minutes to complete. o Once the Kubernetes cluster has completed building, run the following to ensure

connectivity to the newly create cluster.

o Test the configuration before continuing. Use kubectl get svc. The results should be similar to the following:

Figure 12 - Kubectl results

If not, resolve any issues before continuing. This is usually a Kubernetes/AWS permissions/IAM role issue.

• For Worker Node creation: o Ensure the correct AWS Security Group is used. o NodeAutoScalingGroupMinSize must be one (1),

NodeAutoScalingGroupDesiredCapacity must be three (3), and NodeAutoScalingGroupMaxSize must be four (4).

o A GPU supported AMI is not required, but must use the EKS optimized AMI listed.

Page 17: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 17

o Select an appropriate EC2 instance size for the environment. For development or test, a T2.medium is fine. For production or staging, an M5.xlarge instance is recommended.

o Ensure the correct EKS Cluster is used. o Ensure VPC and subnets used match what was used for the cluster. o After the node creation has completed, ensure the nodes are ready by using kubectl

get nodes:

Figure 13 - Kubectl get nodes

4.2 Configuring the Security Groups for EFS

After the EKS cluster is configured, and the worker nodes have been created, a new AWS Security Group will be created. The new security group will have the Kubernetes Cluster name as part of the security group name. This security group must now be associated with the EFS file system created previously. Note: If this step is not followed, it will not be possible for Kubernetes to connect to the EFS file system.

• Use the AWS Console, and navigate to the EFS service. • Click on the EFS file system previously created, and click on Actions, and then on Manage

file system access, • All of the mount targets will appear with the current available security groups. • Modify the security groups to include the new security group created for the EKS cluster.

4.3 Configuring the Elastic Kubernetes Service with Kubectl

With AKS, the Kubernetes command line tool, kubectl, is used to configure the Kubernetes cluster for EMS on AKS.

4.3.1 Create a New Namespace Create a new namespace in Kubernetes, if desired. This is optional. The default namespace can be used. Note: If the namespace tibems is not used, ensure the provided yaml files are modified to use the correct namespace or default. The examples shown below will use the tibems namespace.

Figure 14 - Create tibems namespace

Page 18: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 18

4.3.2 Creating the Cluster Role for EFS The EFS file system previously created, must now be configured (provisioned) to be accessible in EKS. This section will outline configuring EFS in EKS. With EKS, the Kubernetes command line tool, kubectl, is used to configure the Kubernetes cluster for EMS on EKS. Before the EFS file system can be provisioned, the Cluster Roles must be created for EFS. This will provide the roles and binding for EKS/Kubernetes to access EFS. Adjust ems-efs-clusterrole.yaml for namespace only, if not using tibems.

Note: Do not modify any other part of the file! Apply the file:

4.3.3 Provisioning the EFS File System Provisioning the EFS storage resource in Kubernetes on EKS differs significantly from other file system mounts on AWS or in a generic Kubernetes environment. A separate deployment must be created that deploys the necessary Storage Class, Persistent Volume Claim (PVC), and Persistent Volume (PV) to mount the file system in the container. Once created, the file system will automatically be mounted on the active EMS Docker container in EKS. The following will create the deployment, Storage Class, and the PVC. The EFS provisioner will then create the PV based on the other resources. Note: Ensure section 4.2 has been completed! Adjust provided file ems-efs-provisioner.yaml to your particular setup:

--- apiVersion: v1 kind: ConfigMap metadata: name: efs-provisioner data: file.system.id: fs-12d12345 (1) aws.region: us-east-1 (2) provisioner.name: example.com/aws-efs dns.name: "" --- kind: Deployment apiVersion: extensions/v1beta1 metadata: name: efs-provisioner spec: replicas: 1 strategy: type: Recreate template: metadata: labels: app: efs-provisioner spec:

Page 19: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 19

containers: - name: efs-provisioner image: quay.io/external_storage/efs-provisioner:latest env: - name: FILE_SYSTEM_ID valueFrom: configMapKeyRef: name: efs-provisioner key: file.system.id - name: AWS_REGION valueFrom: configMapKeyRef: name: efs-provisioner key: aws.region - name: DNS_NAME valueFrom: configMapKeyRef: name: efs-provisioner key: dns.name optional: true - name: PROVISIONER_NAME valueFrom: configMapKeyRef: name: efs-provisioner key: provisioner.name volumeMounts: - name: pv-volume mountPath: /persistentvolumes volumes: - name: pv-volume nfs: server: fs-12d12345.efs.us-east-1.amazonaws.com (3) path: / --- kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: aws-efs provisioner: example.com/aws-efs reclaimPolicy: Retain --- kind: PersistentVolumeClaim apiVersion: v1 metadata: name: efs annotations: volume.beta.kubernetes.io/storage-class: "aws-efs" spec: accessModes: - ReadWriteMany resources: requests: storage: 1Mi ---

(1): AWS EFS file system ID

Page 20: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 20

(2): AWS Region, such us-east-1 (3): The complete AWS EFS DNS name

Note: DO NOT make any other changes to the file! Create the EFS provisioner > kubectl apply –f ems-efs-provisioner.yaml –n tibems

Check the results with the following. It may take a couple of minutes for the provisioner to create the PV. > kubectl get pv,pvc –n tibems

Figure 15 - Successful creation of PV and PVC

Note that the same PV/PVC can be used by multiple pods within the same namespace. Note: Creating the PV/PVC is done once for the lifetime of the namespace. So, when EMS creates the configuration file and data stores, these will never be deleted.

4.4 EMS Server Template

EMS server containers are created in a Kubernetes cluster through the provided tibemsd-template.yaml sample template. A deployment and a service will be created. This template includes sections that define a limited set of parameters, ports, and names for the deployment and the service, which can be changed to meet the environment. Note: The template creates the EMS server with TCP access. This maybe suitable for development and testing environments. However, for production environments, a TLS configuration is highly recommended. See Appendix B: for details for configuring the EMS server with TLS in Kubernetes on EKS.

4.4.1 Adjusting the Services NodePort Range (Optional) Services of type NodePort or LoadBalancer are used to expose EMS server listen ports outside the cluster. The range of allowed values defaults to 30000-32767. If you intend to use port numbers outside this range for the EMS server or Central Administration server, you can alter the range by using a load balancer in Kubernetes. See the Kubernetes documentation for details.

4.4.2 TIBEMSD Template The tibemsd-template.yaml has several sections that may need modification. The deployment section includes the names of the Kubernetes deployment, ports, and location/name of the ECR repository. The service section contains the port numbers.

Page 21: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 21

The default values in the example below can all be used, except for the name and location of the ECR repository and the runAsUser. This must be updated for the environment. Only modify the value marked. Changes other values may prevent the TIBEMS deployment/service from being created or running. kind: Deployment … apiVersion: apps/v1 kind: Deployment metadata: labels: name: emstest01 (1) name: emstest01 (1) spec: replicas: 1 selector: matchLabels: name: emstest01 (1) strategy: type: Recreate template: metadata: labels: name: emstest01 (1) name: emstest01 (1) spec: containers: - name: tibemsd-container image: "123456789012.dkr.ecr.us-east-1.amazonaws.com/tibco/ems-image:latest" (2) imagePullPolicy: Always (3) env: - name: EMS_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: EMS_PUBLIC_PORT value: "30722" (4) - name: EMS_SERVICE_NAME value: emstest01 (1) args: - tibemsd livenessProbe: exec: command: - live.sh - '-spawnTimeout' - '4' - '--' - '-server' - tcp://localhost:7222 (5) - '-user' - 'probeuser' - '-password' - 'probepassword'

Page 22: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 22

initialDelaySeconds: 1 (7) timeoutSeconds: 5 periodSeconds: 6 readinessProbe: exec: command: - ready.sh - '-spawnTimeout' - '4' - '-responseTimeout' - '4' - '--' - '-server' - tcp://localhost:7222 (5) - '-user' - 'probeuser' - '-password' - 'probepassword' initialDelaySeconds: 1 (7) timeoutSeconds: 5 periodSeconds: 6 ports: - containerPort: 7222 (5) name: tibemsd-tcp protocol: TCP resources: {} securityContext: runAsUser: 1000 (6) terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /shared name: tibemsd-volume dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 volumes: - name: tibemsd-volume persistentVolumeClaim: claimName: efs --- apiVersion: v1 kind: Service metadata: labels: name: emslb (8) name: emslb (8) namespace: tibems (9) spec: externalTrafficPolicy: Cluster ports: - nodePort: 30722 (4) port: 30722 (4) protocol: TCP

Page 23: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 23

targetPort: 7222 (5) selector: name: emstest01 (1) sessionAffinity: None type: LoadBalancer status: loadBalancer: {}

(1): The name of the EMS deployment and service. If modifying, change ALL locations. (2): The name and location of the Elastic Container Repository (ECR) where the TIBCO EMS

Docker image is located. Ensure the proper permissions are set. The image maybe something different for lastest, depending on how it was tagged in Docker.

(3): Determines if the EMS Docker image should be pulled from the ECR prior to starting the container. Use Always to download the Docker image every time, or Never to use the existing image.

(4): Throughout the template, 30722 is used for the external EMS port. If 30722 is not used, change the value accordingly.

(5): Throughout the template, 7222 is used for the internal EMS port. If 7222 is not used, change the value accordingly.

(6): The uid the container will run as. The default is 1000. Change runAsUser to the uid the EMS server container must run as with respect to accessing NFS. Note: The uid provided here must match that used when creating the EMS Docker image.

This constraint should be removed in a future version of Kubernetes. (7): The initialDelaySeconds determines the delay before the probes become active. This is set

for 1 second. (8): The name of the EMS Load Balancer service. If modifying, change all locations. (9): The name of the Kubernetes namespace used in the cluster. If no namespace is used, change

to default.

4.4.3 Alternate TIBEMSD Template In environments where large data stores are maintained, the EMS container will not be able to start successfully if it takes over one minute for EMS to become active. To deploy EMS in such environments, it is recommended not to use the Readiness or Liveness Probes. Without the probes, the container will start successfully and EMS will become active after reading the data stores. Tibemsd_noprobe-template.yaml is provided to deploy EMS without the probes. It is identical to tibemsd-template.yaml without the probes section. Makes changes to this file as outlined in section 4.4.2. For more information on the probes, see appendix A.1

4.4.4 Creating a Deployment and Service Create a deployment and service with an EMS server using the corresponding template. For example: > kubectl apply –f tibemsd-template.yaml –n tibems

The kubectl operation transforms the tibemsd-template.yaml template into a list of resources using the default and overridden parameter values. That list is then passed on to create process for creation. In this particular case, it results in the creation of a deployment, a ReplicaSet,

Page 24: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 24

a pod and a service. Three of the four objects can be selected through the emstest01 label. The service will have the label emslb. The service exposes itself as emslb inside the cluster and maps internal port 7222 to port 30722 for both inside and outside the cluster.

Check the results using the following: > kubectl –n tibems get --selector name=emstest01 all > kubectl –n tibems describe deploy/emstest01 > kubectl –n tibems describe svc/emslb

Figure 16 - Check Deployment Results

or in the Kubernetes Web Console (not documented).

4.4.5 Stopping or Deleting an EMS Server To stop an EMS server without deleting it, use the kubectl scale operation to set its number of replicas to 0.

For example: > kubectl scale --replicas=0 deploy emstest01 –n tibems

To start it again, set its number of replicas back to 1: > kubectl scale --replicas=1 deploy emstest01 –n tibems

To delete an EMS server deployment and service entirely, use the kubectl delete operation. For example: > kubectl delete --selector name=emstest01 deploy,svc –n tibems

Figure 17 - To Stop, Start, and Delete the Deployment

The corresponding pod and ReplicaSet will also be deleted. The PC and PV will not be deleted.

4.4.6 EMS Server Configuration As mentioned in Section 3.1, running a container off of the EMS Docker image creates a default EMS server folder hierarchy and configuration. In an EKS cluster, the configuration will be created under /shared/ems/config/<EMS_SERVICE_NAME>.json. The Central Administration server works in a similar way. This is handled by the tibems.sh script embedded in tibemscreateimage and is invoked through the Docker image ENTRYPOINT. It can be overridden by altering the args entry in the template and is provided only for illustration purposes. Feel free to alter tibems.sh or to directly provision your own configuration files to suit your needs.

4.4.7 Connecting to the EMS Server Container The EMS server logs and configuration file can be accessed directly through the following command. Substitute the name of the running EMS pod for <Pod name>. This can be useful for viewing the logs or configuration file. Accessing the pod will be necessary to modify the EMS Connection Factories discussed in section 5.

Page 25: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 25

4.5 Central Administration Server Template

A Central Administration server container is created in the Kubernetes cluster through the tibemsca-template.yaml sample template. The structure of this template is almost identical to that of the EMS server template. Most of the concepts described in the previous section also apply to the Central Administration server. Note: Ensure to update the Docker image location from the ECR, and the external port number. The default is 30088. Note: The Central Administrator is not secure. The following is for example only! JAAS must be implemented in both the EMS server and CA before use.

Example of deployment and service creation with a Central Administration server: > kubectl apply -f tibemsca-template.yaml –n tibems

Figure 18 - Apply the EMSA Template

Page 26: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 26

5 Accessing the EMS Server

The EMS server is configured so that access from an EMS client can be internal to AWS, or accessed externally. Access is the same. The section will outline how to connect to the EMS Server.

5.1 Security Group Inbound Security Rules

Note: The Kubernetes load balancer(s) created in AWS by the EMS and EMSCA services have inbound security rules that allow inbound access from the anywhere. So, the security group(s) created in the Kubernetes cluster needs modification. The Security Group(s) created for the cluster, will be similar to k8s-elb-a782f72c936ec22f8bb1a133697ce8ed. Change the inbound rules for the ports. By default, the ports are open from anywhere. This needs be modified to limit access. Highly recommend limiting to a trusted IP Address or small trusted IP range.

5.2 Accessing the EMS Server

The EMS Server running in the Docker Container on the node in AWS is accessed via the External-IP address and Port created via the emslb service.

To get the load balancer External-IP address and Port, use:

To test access to the EMS Server running the Docker Container on the node in AWS use the EMS tibemsadmin CLI. In the following example, 13.118.90.27 is the IP address of the load balancer, and 30722 is the external port. Note: If there are issues connecting to the EMS Server, this will be due to a Security Group rule, usually not having inbound/outbound rules with access to/from the external load balancer.

5.3 Modifying the Connection Factories in the EMS Server

The EMS server running in the Docker Container on the node in AWS must be modified for the Connection Factory URLs. The EMS Connection Factories must be updated from the Node Name to the load balancer External-IP address. If not done, the EMS clients will not be able to reconnect to EMS after a fail-over of the EMS Server deployed in EKS. The approaches to use to modify the tibemsd json configuration file being used in the container are:

• The tibemsadmin CLI for another machine (can be external) o Use the command shown above to access the EMS Server

Page 27: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 27

o Use the setprop option and modify all Connection Factories for the URL o Commit your changes o Exit out tibemsadmin Note: a script can be created and used to make the modifications via tibemsadmin

• Logging into the Kubernetes node, and modifying the configuration file. o Use kubectl exec –it <pod> -n tibems -- /bin/bash o Edit ems/config/emstest01.json and modify all Connection Factories for the URL o Exit out of the Kubernetes node o Stop and re-start the deployment as defined in Section 4.4.5

• The EMS Central Administrator, if so configured. o Easiest approach. o Must ensure the Central Administrator is secured. o Modify the Connection Factories for the URL in EMSCA o Save and deploy the new configuration

Page 28: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 28

Appendix A: Health Checks for the EMS Server

This appendix documents how EMS server container health checks are implemented using the sample TIB_ems_<version>_probes.zip. At this point, these rely on executing commands in the container. NOTE: In environments where large data stores are maintained, the EMS container will not be able to start successfully if it takes over one minute for EMS to become active. To deploy EMS in such environments, it is recommended not to use the Readiness or Liveness Probes. Without the probes, the container will start successfully and EMS will become active after reading the data stores. Tibemsd_noprobe-template.yaml is provided to deploy EMS without the probes. It is identical to tibemsd-template.yaml without the probes section. Makes changes to this file as outlined in section 4.4.2.

A.1 Liveness and Readiness Probes

The Kubernetes and Kubernetes documentation describe health checks here: https://docs.Kubernetes.com/container-platform/3.9/dev_guide/application_health.html https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes For an EMS server container, a liveness health check helps detect when an EMS server stops servicing client heartbeats but somehow does not exit. When this health check fails a number of times in a row, the EMS server container will be restarted. A readiness health check helps detect when an EMS server stops servicing new client requests but is still up and running. When this health check fails a number of times in a row, the EMS server endpoints are removed from its container, such that the server is made unreachable. This could be useful for deliberately hiding an EMS server while it handles a long internal operation (e.g. performing a compact) that prevents it from servicing client requests. As it may or may not fit your operations, it is up to you to decide whether you need the readiness health check. If not relevant to you, feel free to remove it from the template.

A.2 Implementation

Sample health checks are provided in TIB_ems_<version>_probes.zip, which includes a number of internal tools. These rely on server heartbeats flowing from the EMS server to its clients as well as a client timeout of missing server heartbeats. Those are set through the following two EMS server properties:

Page 29: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 29

• server_heartbeat_client (set to a value > 0) • client_timeout_server_connection (set to a value > 0)

The implementation also relies on establishing an admin client connection to the EMS server. As a result, credentials for an admin user with at least the view-server administrator permission need to be configured. The admin user name and password will be used to configure the liveness and readiness probes. Additionally, if the EMS server is TLS only, TLS credentials will also be required when configuring the probes.

A.2.1 Liveness Health Check The sample liveness probe is provided through the live.sh script configured in the deployment object (see section 4.4.2): ... livenessProbe: exec: command: - live.sh - '-spawnTimeout' - '4' - '--' - '-server' - tcp://localhost:<EMS_INTERNAL_PORT> - '-user' - 'probeuser' - '-password' - 'probepassword' initialDelaySeconds: 1 timeoutSeconds: 5 periodSeconds: 6 ...

Here the cluster will perform a periodic liveness check based on the live.sh script and the corresponding parameters. The -spawnTimeout parameter is an internal timeout used by the probe that should be set relative to the probe's periodSeconds setting (see recommended settings in section A.2.4). The above example matches the EMS server sample configuration. It should be tailored to your target configuration using the following additional probe parameters, when relevant: -server <server-url> Connect to specified server (default is tcp://localhost:7222). -timeout <timeout> Timeout of server request (in seconds) (default is 10). -delay <delay> Delay between server requests (in seconds) (default is 1). -user <user-name> Use this user name to connect to server (default is admin). -password <password> Use this password to connect to server (default is NULL).

Page 30: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 30

-pwdfile <passwd file> Use the password in the specified file (to hide it). -module_path <path> Path to find dynamic libraries such as SSL. -ssl_trusted <filename> File containing trusted certificate(s). This parameter may be

entered more than once if required. -ssl_identity <filename> File containing client certificate and optionally extra issuer

certificate(s) and private key. -ssl_issuer <filename> File containing extra issuer certificate(s) for client-side identity. -ssl_password <password> Private key or PKCS12 password. -ssl_pwdfile <pwd file> Use the private key or the PKCS12 password from this file. -ssl_key <filename> File containing private key. -ssl_noverifyhostname Do not verify host name against the name in the certificate. -ssl_hostname <name> Name expected in the certificate sent by host. -ssl_trace Show loaded certificates and certificates sent by the host. -ssl_debug_trace Show additional tracing.

A.2.2 Readiness Health Check The sample readiness probe is provided through the ready.sh script configured in the deployment object: ... readinessProbe: exec: command: - ready.sh - '-spawnTimeout' - '4' - '-responseTimeout' - '4' - '--' - '-server' - tcp://localhost:<EMS_INTERNAL_PORT> - '-user' - 'probeuser' - '-password' - 'probepassword' initialDelaySeconds: 1 timeoutSeconds: 5 periodSeconds: 6 ...

Here the cluster will perform a periodic readiness check based on the ready.sh script and the corresponding parameters.

Page 31: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 31

The -spawnTimeout and -responseTimeout parameters are internal timeouts used by the probe that should be set relative to the probe's periodSeconds setting (see recommended settings in section A.2.4). The above example matches the EMS server sample configuration. Just as with the liveness health check, it should be tailored to your target configuration using the same parameters.

A.2.3 Configuring Liveness and Readiness Probes In addition to the above settings, Kubernetes provides settings to adjust the behavior of the probes: initialDelaySeconds: Number of seconds after the container has started before the liveness or

readiness probes are initiated. timeoutSeconds: Number of seconds after which the probe times out. Defaults to 1

second. Minimum value is 1. periodSeconds: How often (in seconds) to perform the probe. Default to 10 seconds.

Minimum value is 1. These settings are individually set on each probe and affect the timing of health check events.

A.2.4 Recommended settings livenessProbe initialDelaySeconds: 1

periodSeconds: 6 = <PERIOD> used below timeoutSeconds: <PERIOD> -1

readinessProbe initialDelaySeconds: 1 periodSeconds: <PERIOD> timeoutSeconds: <PERIOD> - 1

live.sh -spawnTimeout: <PERIOD> - 2 ready.sh -spawnTimeout: <PERIOD> - 2

-responseTimeout: <PERIOD> - 2 EMS server configuration server_heartbeat_client: 5

client_timeout_server_connection: 20 The tibemsd-template.yaml sample template is already populated with recommended values.

Page 32: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 32

Appendix B: TLS Configuration

This appendix takes you through the steps of modifying the EMS server template and Docker image build script so that EMS clients can connect to the server through TLS (formerly SSL). Whether an EMS listen port is configured for TCP or TLS makes no difference in terms of exposing it through a service, either in the AWS VPC or from a remote location. However, you need to decide how to provision the corresponding certificate files. While these could be placed in the EFS shared folder or embedded in the EMS Docker image, the standard practice in the Kubernetes world consists of using secret objects. These are meant to decouple sensitive information from the pods and can be mounted into containers as volumes populated with files to be accessed by programs. In this example, we will assume that we want the EMS server to be authenticated by EMS clients. This involves providing the server with its certificate, private key and the corresponding password, which we will store inside a secret. We will mount that secret into the container, point the EMS server configuration to the certificate and private key files and pass the corresponding password to the server through its -ssl_password command-line option. Based on the sample certificates that ship with EMS, the files will eventually be made available inside the container as follows: /etc/secret/server.cert.pem /etc/secret/server.key.pem /etc/secret/ssl_password

B.1 Creating a Secret

To store the server certificate, private key and the corresponding password in a secret, based on the sample certificates available in the EMS package under ems/<version>/samples/certs: > cd …/ems/<version>/samples > kubectl create secret generic tibemsd-secret \ --from-file=server.cert.pem=certs/server.cert.pem \ --from-file=server.key.pem=certs/server.key.pem \ --from-literal=ssl_password=password –n tibems

You can check the result this way: > kubectl describe secret tibemsd-secret –n tibems

Page 33: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 33

B.2 Adjusting the Template

The tibemsd-template.yaml template needs to be adjusted to mount the secret as a volume. This involves adding one new entry to the volumes section and another one to the volumeMounts sections. We also need to alter the livenessProbe and the readinessProbe to connect to the server through ssl. kind: Deployment … spec: … template: … spec: containers: - name: tibemsd-container … livenessProbe: … - ssl://localhost:7222 … readinessProbe: … - ssl://localhost:7222 … volumeMounts: - mountPath: /shared name: tibemsd-volume - mountPath: /etc/secret name: tibemsd-secret-volume readOnly: true … volumes: - name: tibemsd-volume persistentVolumeClaim: claimName: ${{EMS_PVC}} - name: tibemsd-secret-volume secret: secretName: tibemsd-secret

Page 34: TIBCO Software Inc. TIBCO Enterprise Message …...• TIBCO EMS 8.4.1 • TIBCO FTL 5.4 and later (static TCP transports only) • Docker Community/Enterprise Edition should be most

©2019 TIBCO Software Inc. All Rights Reserved. 34

B.3 Adjusting the tibemscreateimage EMS Docker image build script

In the tibemsd-configbase.json section: Modify the primary_listen to use ssl: "primary_listens":[ { "url":"ssl://7222" } ],

Add an ssl section pointing to the certificate files: "tibemsd":{ … "ssl":{ "ssl_server_identity":"/etc/secret/server.cert.pem", "ssl_server_key":"/etc/secret/server.key.pem" },

In the tibems.sh section: The tibemsd_run() function needs to be modified to launch the EMS server with the proper value for its -ssl_password command-line option: … if [[ \$# -ge 1 ]]; then PARAMS=\$* else tibemsd_seed PARAMS="-config /shared/ems/config/\$EMS_SERVICE_NAME.json -ssl_password \`cat /etc/secret/ssl_password\`" fi …

B.4 Applying the Adjustments

• Regenerate the EMS Docker image, tag it and push it to the Registry (see section 3.1). • Create a new deployment and service (see section 4.4.3).

Check the results by connecting to the EMS server with one of the EMS TLS sample clients: > java tibjmsSSL -server ssl://13.118.90.27:30722 \ -ssl_trusted ../certs/server_root.cert.pem \ -ssl_hostname server