DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Auto-Scaling a Spring Boot Native App With Nomad
  • Tips for Managing Multi-Cluster Kubernetes Deployment With High Efficiencies
  • Automate Application Load Balancers With AWS Load Balancer Controller and Ingress
  • From Docker Swarm to Kubernetes: Transitioning and Scaling

Trending

  • Operational Principles, Architecture, Benefits, and Limitations of Artificial Intelligence Large Language Models
  • Using Python Libraries in Java
  • Building Reliable LLM-Powered Microservices With Kubernetes on AWS
  • Software Delivery at Scale: Centralized Jenkins Pipeline for Optimal Efficiency
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Request Routing Through Service Mesh for WebSphere Liberty Profile Container on Kubernetes

Request Routing Through Service Mesh for WebSphere Liberty Profile Container on Kubernetes

I will be demonstrating how request routing from service mesh to WebSphere Liberty Profile (WLP) application server Docker container image on Kubernetes.

By 
KOTESWARA RAO NAIDU user avatar
KOTESWARA RAO NAIDU
·
May. 04, 22 · Code Snippet
Likes (7)
Comment
Save
Tweet
Share
6.6K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

I will demonstrate how to request routing from service mesh to WebSphere Liberty Profile (WLP) application server Docker container image on Kubernetes. Further providing details about Istio Ingress gateway, Gateway, and Virtual service created on istio that routing traffic to Docker image with WLP installed. In the end, we will be seeing from Istio kiali dashboard request routing through Istio ingress gateway and another way directly hitting to service on Kubernetes.

Environment Requirements

1. Refer to the following Kubernetes official website to install and configure the cluster with kubeadm,

Installing kubeadm | Kubernetes

Creating a cluster with kubeadm | Kubernetes

      To better illustrate the proof of concept covered here, Below is the current Kubernetes environment setup installed and created a cluster of one master and two worker nodes using kubeadm.

        Login into the master node and run the following command to list the number of nodes in Kubernetes, including version and status. 



2. MetalLB: MetalLB hooks into your Kubernetes cluster and provides a network load-balancer implementation. In short, it allows you to create Kubernetes services of the type LoadBalancer clusters that don’t run on a cloud provider and thus cannot simply hook into paid products to provide load balancers. 

    Refer to the following MetalLB official website to set up MetalLB to use the Kubernetes cluster. 

MetalLB, bare metal load-balancer for Kubernetes (universe.tf)

3. Istio(Service Mesh)  Setup on Kubernetes: Istio extends Kubernetes to establish a programmable, application-aware network using the powerful Envoy service proxy. Working with both Kubernetes and traditional workloads, Istio brings standard, universal traffic management, telemetry, and security to complex deployments.

    Refer to the following  Istio official website to set up Istio on Kubernetes.

Istio / Getting Started

    Login into the master node and run the command mentioned in the below snapshot to see the Istio installed with istio controller, ingress and egress gateway, and the following add-ons grafana, jaeger, kiali, and prometheus.

    Distributed tracing is provided by integration with Jaeger; we can use Prometheus with Istio to record metrics that track the health of Istio and applications within the service mesh. We can visualize metrics using tools like Grafana and Kiali.  Kiali is an observability console for Istio to visualize the application traffic flow.

Deployment of WLP containers on Kubernetes

WebSphere liberty profile application server container image deployment on Kubernetes cluster using following imperative commands with 2 replicas.

Login into the Kubernetes master node and run the following commands to schedule the deployment and expose the service type as a load balancer to access the application server.

kubectl create deployment libertyj --image=websphere-liberty --replicas=2

kubectl expose deployment libertyj --name libertyj1 --type LoadBalancer --protocol TCP --port 9088 --target-port 9080. 

Run the following command mentioned in the below snapshot to see the deployment and load balancer status,

Service( libertyj1 ) using Load balancer type will be published with external IP using MetalLB .We can access the WebSphere Liberty Profile application server with service external IP and port mentioned as blow. The external IP in the above snapshot is masked with XXX.XXX.XX.XX for further use in the article. With the below URL, we can directly access the WebSphere liberty profile application server via Kubernetes load balancer type service libertyj1

http://XXX.XXX.XX.XX:9088/index.html 

However, we aim to access the WebSphere liberty profile application server via the Istio service mesh and route the application traffic to the Kubernetes service. To route traffic from Istio ingress gateway service to the WebSphere liberty profile application server exposed service, we need to create a gateway, virtual service, and destination rule in Kubernetes default namespace.

YAML definition file for creating gateway component,

YAML
 
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: liberty-gateway
  namespace: default
spec:
  selector:
    istio: ingressgateway
  servers:
  - hosts:
    - '*'
    port:
      name: http
      number: 80
      protocol: HTTP

YAML definition file for creating Virtual Service component. In the YAML definition file of the virtual service component, we need to mention the gateway created above, and also destination rule can be included.

YAML
 
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: httpbin
  namespace: default
spec:
  gateways:
  - liberty-gateway
  hosts:
  - '*'
  http:
  - match:
    - uri:
        prefix: /index.html
    route:
    - destination:
        host: libertyj1
        port:
          number: 9088

Finally, by using istio service mesh ingress gateway, exposed external IP and port 80 mentioned in the gateway will be exposed as service to access the WebSphere liberty profile application server via the following URL http://XXX.XXX.XX.XX:80/index.html 

From the Kiali dashboard, we can visualize traffic hitting the libertyj1 service exposed for WebSphere liberty profile application server container image deployment in two routes.

One from Istio-ingressgateway and the other from service exposed for deployment type as loadbalancer.


Summary

WebSphere Liberty is built on Open Liberty (link resides outside IBM). The combination of Open Liberty with traditional WebSphere compatibility features makes WebSphere Liberty an ideal target for modernizing existing applications. For example, when migrating from existing monolithic applications into microservices, consider Websphere Liberty on containers to orchestrate from Kubernetes and intelligent traffic management from Istio (Service Mesh).

Kubernetes Docker (software) Profile (engineering) Application server application Load balancing (computing)

Opinions expressed by DZone contributors are their own.

Related

  • Auto-Scaling a Spring Boot Native App With Nomad
  • Tips for Managing Multi-Cluster Kubernetes Deployment With High Efficiencies
  • Automate Application Load Balancers With AWS Load Balancer Controller and Ingress
  • From Docker Swarm to Kubernetes: Transitioning and Scaling

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!