SlideShare a Scribd company logo
1 of 29
Scalability and Elasticity locally and in the IBM Cloud
Brian S Paskin, Senior Application Architect, R&D Services, IBM Cloud
Updated 22 August 2018
WebSphere Liberty Lunch and Learn
with native installs and Docker
Types of Scaling for Liberty
2
 Scaling cluster member
 Elasticity with cluster members
 Scaling with Docker with cluster members
 Elasticity with Docker with cluster members
 Scaling Liberty in the IBM Cloud
 Scaling with Docker in the IBM Cloud
Collective Controllers
3
 A Collective Controller allows for the
administration of a group of Liberty servers
– Replica Collective Controllers for high
availability
– Clustering of Liberty servers
– Auto scaling for server elasticity
– Dynamic Routing automatically updates
the plugin file when changes occur
– Health management that triggers actions
based on health of a Liberty server
– Administer all servers and clusters from a
single Collective Controller
– Communications from Collective to
members is over secure connections
Auto scaling Liberty servers
4
 Auto scaling automatically adjusts the number of Liberty servers that handle requests
– Requires members be part of a cluster
– Consists of a scaling controller and scaling members
– The scaling controller decides whether to expand or contract the number of servers
– Scaling based on CPU, heap and memory
– Should be used in conjunction with Dynamic Routing for automatic update of available
members to handle requests
 Add the scaling controller feature to the Collective Controller and Replica Sets
<feature>scalingController-1.0</feature>
 Add the scaling member feature and listening port to each member
– Members on the same host should use the same port number
<feature>scalingMember-1.0</feature>
<hostSingleton name="ScalingMemberSingletonService" port="20020" />
Auto scaling Liberty servers
5
 Add the auto scaling policy to the Collective and Replica
Sets
– Policies can scale horizontally or vertically, have any
number of minimum and maximum servers and contain
multiple clusters
– Metrics to scale are based on CPU, heap and memory
percentages or any combination
– Scaling out and back to the minimum is based on
minutes passed the threshold
<scalingDefinitions>
<scalingPolicy name="horizontal"
id="Cluster1Policy" max="2" min="1">
<bind clusters="cluster1"/>
<metric name="cpu" min="10" max="70"/>
<metric name="heap" min="1" max="80"/>
<out minInterval="3m" units="instance"/>
<in minInterval="10m" units="instance"/>
</scalingPolicy>
</scalingDefinitions>
Provisionable Cluster Elasticity
6
 Provision and start Liberty on new servers based on
cluster scaling definitions
– Utilize Stack Groups to push Liberty, Java and
servers to systems
– New systems must be registered to the Controller
 Liberty, Java and Server must be packaged with specific
names under the ${wlp.user.dir}/stackGroups
directory using the server package command
– Liberty and Java are placed in the installables
directory
– Servers are placed in the packages directory
 Use stackGroup and scalingDefinitions
configurations to push out Liberty to servers
 Start and stop Docker containers based on
configuration
– Containers become part of the cluster
Liberty and Docker
7
 Docker allows for packaging applications with all of their dependencies into a standardized
unit for software development and deployment onto a wide range of platforms
 Liberty is Docker ready
– Official repository available Docker Hub
– Available in IBM Bluemix Containers
– Near bare metal performance
– All features of Liberty available
 Dockerfiles on WASdev GitHub
– Upgrade the Docker Hub image with Liberty Core, Base or ND commercial license
– Build your own Docker image for WAS Liberty or Full Profile
 Containers can be part of Cluster and managed by Controllers
– Start and stop sending JSON to a Controller
– Using new panels in Liberty Admin Center *
 Provisional cluster elasticity
– Start and stop containers based on scaling requirements
* 16.0.0.3 and above
Using Docker with Liberty
 Official repository can be pulled from the Docker Hub
– Several diverse Docker tags with different features installed
– Install needed features using the installUtility command in the Dockerfile
– Collective Controller is not necessary
 Run Liberty Docker container individually
– Command line from the server
– Create as many instances as necessary
– Map ports to free ports on server
– Include applications or deploy by linking to the dropins directory
 Liberty Docker containers can be added to Cluster
– Requires Collective Controller
– Requires Dockerfile contain register and deregister scripts
– Generic port definitions in the server.xml
– Managed with REST API requests or Admin Console *
8
.war.war
.war
* 16.0.0.3 and above
Using Docker with Liberty
 Provisioning Liberty Docker containers for elasticity
– Requires Collective Controller
– Requires Dockerfile contain register and deregister scripts
– Requires stack group configuration
– Generic port definitions in the server.xml
– Manage elasticity with scaling definitions in collective controller
– Decide which servers are start on which system
– Scaling horizontally or vertically
9
Single Instances
 Requires a Dockerfile, server.xml and any artifacts necessary
– Use installUtility in Dockerfile to include necessary features
– The ENTRYPOINT is to run the defaultServer
– Liberty is install under the /opt/ibm/wlp directory
– JRE 8 is installed under the /opt/ibm/java directory
 Build the Docker containers using a meaningful tags
 Run Docker containers by exposing the ports defined in server.xml to operating system
ports
 Deploy applications by mapping application to server dropins directory, if necessary
10
Clustering Containers
 A Cluster Controller must be installed
– Install the Admin Center to see the changes as they happen
 The Docker host must be registered with the Collective Controller
 Add variables in the Collective Controller server.xml for HTTP and HTTPS ports, which will
increase by the number indicated on the host
<deployVariable name="memberHttpPort" value="9080" increment="1"/>
<deployVariable name="memberHttpsPort" value="9443" increment="1"/>
 A valid username and password need to be added in the Collective Controller server.xml so
the new Docker containers can communicate
<collectiveController user="userName" password="password" />
 Optionally, Dynamic Routing can be enabled to allow the web servers to communicate with the
Docker containers by adding the feature to the Collective Controller
<feature>dynamicRouting-1.0</feature>
11
Clustering Containers
 If using a Docker Registry, add the variables to the Collective Controller
– Docker image will be pulled from the registry and deployed to the Docker host
<variable name="dockerRegistry" value="dockerRegistry" />
<variable name="dockerRepository" value="dockerRepository" />
<variable name="dockerUser" value="dockerUser" />
<variable name="dockerUserPassword" value="dockerUserPassword" />
<variable name="dockerUserEmail" value="dockerUserEmail" />
12
Clustering Containers
 Dockerfile must add the joinMember and removeMember scripts to the /opt/ibm/docker
directory in the container
– Scripts are called before starting the Liberty server and after shutdown
– Provide updated HTTP and HTTPs ports and register and deregister with the Collective
Controller
 Dockerfile must install clusterMember-1.0, collectiveMember-1.0 and any other
features that will be used by Liberty using the installUtility
 The default HTTP endpoint must contain the variables for the HTTP and HTTPs ports
– Will be passed by the Collective Controller to the Docker container
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="${memberHttpPort}"
httpsPort="${memberHttpsPort}" />
 Build the Docker container
13
Clustering Containers with REST APIs
 REST APIs can be used to control the starting and stopping of a container, and to view the status
of an operation
– Display deployment rules
GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/rule
– Display status of an operation
GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/{token}/status
– Display complete results of an operation
GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/{token}/results
– Deploy a Docker Container
POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/deploy
– Remove a Docker Container
POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/undeploy
14
Clustering Containers
15
POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/deploy
{
"rule": "Liberty Docker Rule",
"hosts": [ "myHostName" ],
"variables": [
{ "name":"imageName", "value":"myImageName" },
{ "name":"containerName", "value":"myContainerName" },
{ "name":"clusterName", "value":"myClusterName" },
{ "name":"keystorePassword", "value":"thePassword" }
]
}
POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/undeploy
{
"host": "myHostName",
"userDir":"Docker",
"serverName":"myContainerName"
}
imageName - Name of the Docker image to be started
containerName - Name given to running Docker container
clusterName - Name of the cluster to join
keystorePassword - Password to the collective keystore
Clustering Containers with the Admin Center
 The Admin Center can be used to control the starting and stopping of a container, and to view the
status of an operation *
– Deploy tool to deploy a Liberty server or Node.js server
– Select a server package or Docker container
– Provide the information for Docker image name, container name, and cluster name
 Same information as REST APIs
 Cluster name can be Stack Group name
– Select the hosts to deploy the Docker containers
– Check the status for information about the status of deployment
16 * 16.0.0.3 and above
Clustering Containers with Elasticity
 Elasticity allows for the adding or removal of Docker containers based on scaling policy
17
Clustering Containers with Elasticity
 A stack group must be added to the Liberty install of the Collective Controller
– Located under the ${wlp.user.dir}/shared/stackGroups directory
– Copy the default stack group and add a meaningful name
– Create a packageName.deploy.xml in the packages directory
– The XML file contains the same entries for a deploy by the REST API
<deploy>
<useRule id="Liberty Docker Rule" />
<variable name="imageName" value="myImageName"/>
<variable name="containerName" value="myContainerName"/>
<variable name="clusterName" value=" myStackGroup.myClusterName"/>
<variable name="keystorePassword" value="thePassword"/>
</deploy>
 Add the scaling controller feature to the Collective Controller
<feature>scalingController-1.0</feature>
 Add the stack group definitions the Collective Controller for the HTTP and HTTPS ports
<stackGroup name="myStackGroup">
<deployVariable name="memberHttpPort" value="9080" increment="1"/>
<deployVariable name="memberHttpsPort" value="9443" increment="1"/>
</stackGroup>
18
Clustering Containers with Elasticity
 Add the scaling definition and scaling policies
<scalingDefinitions id="provisionPolicy">
<scalingPolicy enabled="true" max="3" min="1" name="vertical">
<bind clusters="myStackGroup.myPackageName"/>
<hostGroup tags="myHost1 myHost2"/>
<metric name="heap" min="30" max="85"/>
</scalingPolicy>
</scalingDefinitions>
 Scaling is based on the metrics, the number of minimum and maximum servers, and if the
policy is enabled
– Hosts must be tagged in metadata to use hostGroup
– Multiple scaling policies can be used in a scaling definition when bound to different
clusters
– Name of the Docker container that is used is the name placed in the
packageName.deploy.xml file suffixed by -#, where # is the instance number
19
Scaling Liberty in the IBM Cloud
 IBM Cloud uses Cloud Foundry as Platform as a
Service
– Deployment and scaling applications and
services
– Add services to applications
– Multi region possible with separate deploys
 Deploying a JEE or Web Application using Cloud
Foundry it is deployed to Liberty
 Ability to deploy the Liberty server directory with all
necessary features and configurations
 Deploy using IBM Cloud CLI or DevOps
– IBM Cloud Console can be used for adding
services and change characteristics of
applications and services
 Use Auto-Scaling to scale Liberty based on metrics
– Similar to those using the Scaling Controller20
Scaling Liberty in the IBM Cloud
 Push a Liberty application server with configuration to the IBM Cloud
ibmcloud cf push <appname> -m <memory amount>m -p </path/to/server>
 Check logs of launched app server
ibmcloud cf logs <appname> --recent
 Increase the amount of instances
ibmcloud cf scale <appname> -i <num of instances>
 Add the Auto-Scaling service
ibmcloud service create auto-scaling free <service name>
 Bind it to the application
ibmcloud service bind <appname> <service name>
 Create a policy for the Auto-Scaling
ibmcloud as policy-create
 Or Attach a policy and bind it to an application
ibmcloud as policy-attach <appname> -p <policy file name>
ibmcloud as policy-enable <appname>
21
Scaling Liberty in the IBM Cloud
 Sample policy file:
{ "instanceMaxCount": 2,
"instanceMinCount": 1,
"policyTriggers": [
{
"breachDuration": 600,
"instanceStepCountDown": 1,
"instanceStepCountUp": 1,
"lowerThreshold": 30,
"metricType": "ResponseTime",
"scaleInAdjustment": "changeCapacity",
"scaleOutAdjustment": "changeCapacity",
"statWindow": 300,
"stepDownCoolDownSecs": 600,
"stepUpCoolDownSecs": 600,
"upperThreshold": 100
}
]
}
22
Scaling Liberty in the IBM Cloud
23
Scaling Containers in the IBM Cloud
 Kubernetes is used in the IBM Cloud for orchestration
– Clusters that allow horizontal and/or vertical scaling of
containers in one or more virtual or physical machines
 Pod – contains one or more containers using Deployments
 Node – a worker machine, physical or virtual, that contains
one or more Pods
 ReplicaSet – controls the number of Pods that should be
running across Nodes
 Service – defines a logical sets of Pods and can expose
their endpoints
 Cluster – Contains one or more Nodes and a master that
controls the functions of Kubernetes
24
Scaling Containers in the IBM Cloud
 Add a namespace that will be used for the IBM Cloud Docker registry
ibmcloud cr namespace-add <namespace>
 Tag local Docker image
docker tag <imagename> registry.ng.bluemix.net/<namespace>/<imagename>
 Push the image to the IBM Cloud
docker push registry.ng.bluemix.net/<namespace>/<imagename>
 Create a Cluster (may take several minutes)
ibmcloud cs cluster-create --name <clustername>
 Configure the Cluster for local Kubernetes commands
bx cs cluster-config <clustername>
export KUBECONFIG=/path/to/file.yml
 Deploy a container
kubectl run <deploymentname> --
image=registry.ng.bluemix.net/<namespace>/<imagename>
25
Scaling Containers in the IBM Cloud
 Deployment instances will be defined on the worker Nodes
 Add a deployment and specify the number of replicas
kubectl run <deploymentName> --
image=registry.ng.bluemix.net/<namespace>/<imagename> --replicas=1 or
kubectl apply –f </path/to/deployment>
 Expose ports, if necessary
kubectl expose deployment/<deploymentName> --type=NodePort --port=<port> --
name=<serviceName> --target-port=<targetPort>
 Link a service to the deployment
kubectl apply –f </path/to/service>
 Without ingress or other load balancer, the workers must be targeted directly
 Show the recently added service to find the Node Port that is opened
kubectl describe service <serviceName>
 Show the workers’ public IP Address
bx cs workers –cluster <clusterName>
26
Scaling Containers in the IBM Cloud
 Access the container using the public IP:nodePort address
 Apply changes to any resource from a file
kubectl apply –f </path/to/file>
 Cluster information
kubectl cluster-info
 Examine configuration and metrics of all aspects of the Kubernets using the Kubernetes
Dashboard button on the cluster screen in the IBM Cloud or locally with a proxy
kubectl proxy <flags>
kubectl proxy --address=0.0.0.0 --accept-
hosts=^localhost$,^127.0.0.1$,^192.168.134.128$
 Examine container logs using the proxy or command
kubectl logs <resource>
27
Scaling Containers in the IBM Cloud
28
Liberty Scalability and Elasticity Locally and in the IBM Cloud

More Related Content

What's hot

Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Imesh Gunaratne
 
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...Massimiliano Dessì
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMysql User Camp
 
Apache Ambari - What's New in 1.7.0
Apache Ambari - What's New in 1.7.0Apache Ambari - What's New in 1.7.0
Apache Ambari - What's New in 1.7.0Hortonworks
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to KubernetesRohman Muhamad
 
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Phil Estes
 
How Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, WorksHow Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, WorksMatthew Farina
 
PAC 2019 virtual Scott Moore
PAC 2019  virtual   Scott Moore PAC 2019  virtual   Scott Moore
PAC 2019 virtual Scott Moore Neotys
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
How to scheduled jobs in a cloudera cluster without oozie
How to scheduled jobs in a cloudera cluster without oozieHow to scheduled jobs in a cloudera cluster without oozie
How to scheduled jobs in a cloudera cluster without oozieTiago Simões
 
Bee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingBee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingAngel Borroy López
 
Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introductionJason Hu
 
How to create a secured cloudera cluster
How to create a secured cloudera clusterHow to create a secured cloudera cluster
How to create a secured cloudera clusterTiago Simões
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisTiago Simões
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Dockerdocker-athens
 

What's hot (20)

Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 2
 
Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
 
Weblogic cluster
Weblogic clusterWeblogic cluster
Weblogic cluster
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana Yeruva
 
Helm @ Orchestructure
Helm @ OrchestructureHelm @ Orchestructure
Helm @ Orchestructure
 
Servicemix4.5.0
Servicemix4.5.0Servicemix4.5.0
Servicemix4.5.0
 
Apache Ambari - What's New in 1.7.0
Apache Ambari - What's New in 1.7.0Apache Ambari - What's New in 1.7.0
Apache Ambari - What's New in 1.7.0
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
 
How Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, WorksHow Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, Works
 
PAC 2019 virtual Scott Moore
PAC 2019  virtual   Scott Moore PAC 2019  virtual   Scott Moore
PAC 2019 virtual Scott Moore
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
How to scheduled jobs in a cloudera cluster without oozie
How to scheduled jobs in a cloudera cluster without oozieHow to scheduled jobs in a cloudera cluster without oozie
How to scheduled jobs in a cloudera cluster without oozie
 
Bee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installingBee con2016 presentation_20160125004_installing
Bee con2016 presentation_20160125004_installing
 
Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introduction
 
How to create a secured cloudera cluster
How to create a secured cloudera clusterHow to create a secured cloudera cluster
How to create a secured cloudera cluster
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 
Kubernetes basics
Kubernetes basicsKubernetes basics
Kubernetes basics
 

Similar to Liberty Scalability and Elasticity Locally and in the IBM Cloud

MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2Alfonso Martino
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileWASdev Community
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with ComponentsAjeet Singh
 
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...Ovadiah Myrgorod
 
IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation khawkwf
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWSGrant Ellis
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWSGrant Ellis
 
Docker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a MinuteDocker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a Minutedchq
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Etsuji Nakai
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesVishal Biyani
 
Veer's Container Security
Veer's Container SecurityVeer's Container Security
Veer's Container SecurityJim Barlow
 
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaMonitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaQbox
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueShapeBlue
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesPaul Czarkowski
 
containerD
containerDcontainerD
containerDstrikr .
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..webhostingguy
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..webhostingguy
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...Kasun Gajasinghe
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 

Similar to Liberty Scalability and Elasticity Locally and in the IBM Cloud (20)

MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components
 
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
 
IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation IBM Cloud Pak for Integration 2020.2.1 installation
IBM Cloud Pak for Integration 2020.2.1 installation
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWS
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWS
 
Docker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a MinuteDocker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a Minute
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Veer's Container Security
Veer's Container SecurityVeer's Container Security
Veer's Container Security
 
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaMonitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
containerD
containerDcontainerD
containerD
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Liberty Scalability and Elasticity Locally and in the IBM Cloud

  • 1. Scalability and Elasticity locally and in the IBM Cloud Brian S Paskin, Senior Application Architect, R&D Services, IBM Cloud Updated 22 August 2018 WebSphere Liberty Lunch and Learn with native installs and Docker
  • 2. Types of Scaling for Liberty 2  Scaling cluster member  Elasticity with cluster members  Scaling with Docker with cluster members  Elasticity with Docker with cluster members  Scaling Liberty in the IBM Cloud  Scaling with Docker in the IBM Cloud
  • 3. Collective Controllers 3  A Collective Controller allows for the administration of a group of Liberty servers – Replica Collective Controllers for high availability – Clustering of Liberty servers – Auto scaling for server elasticity – Dynamic Routing automatically updates the plugin file when changes occur – Health management that triggers actions based on health of a Liberty server – Administer all servers and clusters from a single Collective Controller – Communications from Collective to members is over secure connections
  • 4. Auto scaling Liberty servers 4  Auto scaling automatically adjusts the number of Liberty servers that handle requests – Requires members be part of a cluster – Consists of a scaling controller and scaling members – The scaling controller decides whether to expand or contract the number of servers – Scaling based on CPU, heap and memory – Should be used in conjunction with Dynamic Routing for automatic update of available members to handle requests  Add the scaling controller feature to the Collective Controller and Replica Sets <feature>scalingController-1.0</feature>  Add the scaling member feature and listening port to each member – Members on the same host should use the same port number <feature>scalingMember-1.0</feature> <hostSingleton name="ScalingMemberSingletonService" port="20020" />
  • 5. Auto scaling Liberty servers 5  Add the auto scaling policy to the Collective and Replica Sets – Policies can scale horizontally or vertically, have any number of minimum and maximum servers and contain multiple clusters – Metrics to scale are based on CPU, heap and memory percentages or any combination – Scaling out and back to the minimum is based on minutes passed the threshold <scalingDefinitions> <scalingPolicy name="horizontal" id="Cluster1Policy" max="2" min="1"> <bind clusters="cluster1"/> <metric name="cpu" min="10" max="70"/> <metric name="heap" min="1" max="80"/> <out minInterval="3m" units="instance"/> <in minInterval="10m" units="instance"/> </scalingPolicy> </scalingDefinitions>
  • 6. Provisionable Cluster Elasticity 6  Provision and start Liberty on new servers based on cluster scaling definitions – Utilize Stack Groups to push Liberty, Java and servers to systems – New systems must be registered to the Controller  Liberty, Java and Server must be packaged with specific names under the ${wlp.user.dir}/stackGroups directory using the server package command – Liberty and Java are placed in the installables directory – Servers are placed in the packages directory  Use stackGroup and scalingDefinitions configurations to push out Liberty to servers  Start and stop Docker containers based on configuration – Containers become part of the cluster
  • 7. Liberty and Docker 7  Docker allows for packaging applications with all of their dependencies into a standardized unit for software development and deployment onto a wide range of platforms  Liberty is Docker ready – Official repository available Docker Hub – Available in IBM Bluemix Containers – Near bare metal performance – All features of Liberty available  Dockerfiles on WASdev GitHub – Upgrade the Docker Hub image with Liberty Core, Base or ND commercial license – Build your own Docker image for WAS Liberty or Full Profile  Containers can be part of Cluster and managed by Controllers – Start and stop sending JSON to a Controller – Using new panels in Liberty Admin Center *  Provisional cluster elasticity – Start and stop containers based on scaling requirements * 16.0.0.3 and above
  • 8. Using Docker with Liberty  Official repository can be pulled from the Docker Hub – Several diverse Docker tags with different features installed – Install needed features using the installUtility command in the Dockerfile – Collective Controller is not necessary  Run Liberty Docker container individually – Command line from the server – Create as many instances as necessary – Map ports to free ports on server – Include applications or deploy by linking to the dropins directory  Liberty Docker containers can be added to Cluster – Requires Collective Controller – Requires Dockerfile contain register and deregister scripts – Generic port definitions in the server.xml – Managed with REST API requests or Admin Console * 8 .war.war .war * 16.0.0.3 and above
  • 9. Using Docker with Liberty  Provisioning Liberty Docker containers for elasticity – Requires Collective Controller – Requires Dockerfile contain register and deregister scripts – Requires stack group configuration – Generic port definitions in the server.xml – Manage elasticity with scaling definitions in collective controller – Decide which servers are start on which system – Scaling horizontally or vertically 9
  • 10. Single Instances  Requires a Dockerfile, server.xml and any artifacts necessary – Use installUtility in Dockerfile to include necessary features – The ENTRYPOINT is to run the defaultServer – Liberty is install under the /opt/ibm/wlp directory – JRE 8 is installed under the /opt/ibm/java directory  Build the Docker containers using a meaningful tags  Run Docker containers by exposing the ports defined in server.xml to operating system ports  Deploy applications by mapping application to server dropins directory, if necessary 10
  • 11. Clustering Containers  A Cluster Controller must be installed – Install the Admin Center to see the changes as they happen  The Docker host must be registered with the Collective Controller  Add variables in the Collective Controller server.xml for HTTP and HTTPS ports, which will increase by the number indicated on the host <deployVariable name="memberHttpPort" value="9080" increment="1"/> <deployVariable name="memberHttpsPort" value="9443" increment="1"/>  A valid username and password need to be added in the Collective Controller server.xml so the new Docker containers can communicate <collectiveController user="userName" password="password" />  Optionally, Dynamic Routing can be enabled to allow the web servers to communicate with the Docker containers by adding the feature to the Collective Controller <feature>dynamicRouting-1.0</feature> 11
  • 12. Clustering Containers  If using a Docker Registry, add the variables to the Collective Controller – Docker image will be pulled from the registry and deployed to the Docker host <variable name="dockerRegistry" value="dockerRegistry" /> <variable name="dockerRepository" value="dockerRepository" /> <variable name="dockerUser" value="dockerUser" /> <variable name="dockerUserPassword" value="dockerUserPassword" /> <variable name="dockerUserEmail" value="dockerUserEmail" /> 12
  • 13. Clustering Containers  Dockerfile must add the joinMember and removeMember scripts to the /opt/ibm/docker directory in the container – Scripts are called before starting the Liberty server and after shutdown – Provide updated HTTP and HTTPs ports and register and deregister with the Collective Controller  Dockerfile must install clusterMember-1.0, collectiveMember-1.0 and any other features that will be used by Liberty using the installUtility  The default HTTP endpoint must contain the variables for the HTTP and HTTPs ports – Will be passed by the Collective Controller to the Docker container <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="${memberHttpPort}" httpsPort="${memberHttpsPort}" />  Build the Docker container 13
  • 14. Clustering Containers with REST APIs  REST APIs can be used to control the starting and stopping of a container, and to view the status of an operation – Display deployment rules GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/rule – Display status of an operation GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/{token}/status – Display complete results of an operation GET https://controller_host:controller_port/ibm/api/collective/v1/deployment/{token}/results – Deploy a Docker Container POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/deploy – Remove a Docker Container POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/undeploy 14
  • 15. Clustering Containers 15 POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/deploy { "rule": "Liberty Docker Rule", "hosts": [ "myHostName" ], "variables": [ { "name":"imageName", "value":"myImageName" }, { "name":"containerName", "value":"myContainerName" }, { "name":"clusterName", "value":"myClusterName" }, { "name":"keystorePassword", "value":"thePassword" } ] } POST https://controller_host:controller_port/ibm/api/collective/v1/deployment/undeploy { "host": "myHostName", "userDir":"Docker", "serverName":"myContainerName" } imageName - Name of the Docker image to be started containerName - Name given to running Docker container clusterName - Name of the cluster to join keystorePassword - Password to the collective keystore
  • 16. Clustering Containers with the Admin Center  The Admin Center can be used to control the starting and stopping of a container, and to view the status of an operation * – Deploy tool to deploy a Liberty server or Node.js server – Select a server package or Docker container – Provide the information for Docker image name, container name, and cluster name  Same information as REST APIs  Cluster name can be Stack Group name – Select the hosts to deploy the Docker containers – Check the status for information about the status of deployment 16 * 16.0.0.3 and above
  • 17. Clustering Containers with Elasticity  Elasticity allows for the adding or removal of Docker containers based on scaling policy 17
  • 18. Clustering Containers with Elasticity  A stack group must be added to the Liberty install of the Collective Controller – Located under the ${wlp.user.dir}/shared/stackGroups directory – Copy the default stack group and add a meaningful name – Create a packageName.deploy.xml in the packages directory – The XML file contains the same entries for a deploy by the REST API <deploy> <useRule id="Liberty Docker Rule" /> <variable name="imageName" value="myImageName"/> <variable name="containerName" value="myContainerName"/> <variable name="clusterName" value=" myStackGroup.myClusterName"/> <variable name="keystorePassword" value="thePassword"/> </deploy>  Add the scaling controller feature to the Collective Controller <feature>scalingController-1.0</feature>  Add the stack group definitions the Collective Controller for the HTTP and HTTPS ports <stackGroup name="myStackGroup"> <deployVariable name="memberHttpPort" value="9080" increment="1"/> <deployVariable name="memberHttpsPort" value="9443" increment="1"/> </stackGroup> 18
  • 19. Clustering Containers with Elasticity  Add the scaling definition and scaling policies <scalingDefinitions id="provisionPolicy"> <scalingPolicy enabled="true" max="3" min="1" name="vertical"> <bind clusters="myStackGroup.myPackageName"/> <hostGroup tags="myHost1 myHost2"/> <metric name="heap" min="30" max="85"/> </scalingPolicy> </scalingDefinitions>  Scaling is based on the metrics, the number of minimum and maximum servers, and if the policy is enabled – Hosts must be tagged in metadata to use hostGroup – Multiple scaling policies can be used in a scaling definition when bound to different clusters – Name of the Docker container that is used is the name placed in the packageName.deploy.xml file suffixed by -#, where # is the instance number 19
  • 20. Scaling Liberty in the IBM Cloud  IBM Cloud uses Cloud Foundry as Platform as a Service – Deployment and scaling applications and services – Add services to applications – Multi region possible with separate deploys  Deploying a JEE or Web Application using Cloud Foundry it is deployed to Liberty  Ability to deploy the Liberty server directory with all necessary features and configurations  Deploy using IBM Cloud CLI or DevOps – IBM Cloud Console can be used for adding services and change characteristics of applications and services  Use Auto-Scaling to scale Liberty based on metrics – Similar to those using the Scaling Controller20
  • 21. Scaling Liberty in the IBM Cloud  Push a Liberty application server with configuration to the IBM Cloud ibmcloud cf push <appname> -m <memory amount>m -p </path/to/server>  Check logs of launched app server ibmcloud cf logs <appname> --recent  Increase the amount of instances ibmcloud cf scale <appname> -i <num of instances>  Add the Auto-Scaling service ibmcloud service create auto-scaling free <service name>  Bind it to the application ibmcloud service bind <appname> <service name>  Create a policy for the Auto-Scaling ibmcloud as policy-create  Or Attach a policy and bind it to an application ibmcloud as policy-attach <appname> -p <policy file name> ibmcloud as policy-enable <appname> 21
  • 22. Scaling Liberty in the IBM Cloud  Sample policy file: { "instanceMaxCount": 2, "instanceMinCount": 1, "policyTriggers": [ { "breachDuration": 600, "instanceStepCountDown": 1, "instanceStepCountUp": 1, "lowerThreshold": 30, "metricType": "ResponseTime", "scaleInAdjustment": "changeCapacity", "scaleOutAdjustment": "changeCapacity", "statWindow": 300, "stepDownCoolDownSecs": 600, "stepUpCoolDownSecs": 600, "upperThreshold": 100 } ] } 22
  • 23. Scaling Liberty in the IBM Cloud 23
  • 24. Scaling Containers in the IBM Cloud  Kubernetes is used in the IBM Cloud for orchestration – Clusters that allow horizontal and/or vertical scaling of containers in one or more virtual or physical machines  Pod – contains one or more containers using Deployments  Node – a worker machine, physical or virtual, that contains one or more Pods  ReplicaSet – controls the number of Pods that should be running across Nodes  Service – defines a logical sets of Pods and can expose their endpoints  Cluster – Contains one or more Nodes and a master that controls the functions of Kubernetes 24
  • 25. Scaling Containers in the IBM Cloud  Add a namespace that will be used for the IBM Cloud Docker registry ibmcloud cr namespace-add <namespace>  Tag local Docker image docker tag <imagename> registry.ng.bluemix.net/<namespace>/<imagename>  Push the image to the IBM Cloud docker push registry.ng.bluemix.net/<namespace>/<imagename>  Create a Cluster (may take several minutes) ibmcloud cs cluster-create --name <clustername>  Configure the Cluster for local Kubernetes commands bx cs cluster-config <clustername> export KUBECONFIG=/path/to/file.yml  Deploy a container kubectl run <deploymentname> -- image=registry.ng.bluemix.net/<namespace>/<imagename> 25
  • 26. Scaling Containers in the IBM Cloud  Deployment instances will be defined on the worker Nodes  Add a deployment and specify the number of replicas kubectl run <deploymentName> -- image=registry.ng.bluemix.net/<namespace>/<imagename> --replicas=1 or kubectl apply –f </path/to/deployment>  Expose ports, if necessary kubectl expose deployment/<deploymentName> --type=NodePort --port=<port> -- name=<serviceName> --target-port=<targetPort>  Link a service to the deployment kubectl apply –f </path/to/service>  Without ingress or other load balancer, the workers must be targeted directly  Show the recently added service to find the Node Port that is opened kubectl describe service <serviceName>  Show the workers’ public IP Address bx cs workers –cluster <clusterName> 26
  • 27. Scaling Containers in the IBM Cloud  Access the container using the public IP:nodePort address  Apply changes to any resource from a file kubectl apply –f </path/to/file>  Cluster information kubectl cluster-info  Examine configuration and metrics of all aspects of the Kubernets using the Kubernetes Dashboard button on the cluster screen in the IBM Cloud or locally with a proxy kubectl proxy <flags> kubectl proxy --address=0.0.0.0 --accept- hosts=^localhost$,^127.0.0.1$,^192.168.134.128$  Examine container logs using the proxy or command kubectl logs <resource> 27
  • 28. Scaling Containers in the IBM Cloud 28

Editor's Notes

  1. Each region would manage their resources. Deploying to US South and to GB would require an app deploy to each region and a service for each region. The service does not scale regions. A load balancer in the front can manage the traffic.
  2. Usually a Pod contains a single container, unless they need to work together