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

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

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

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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  • Building Reliable LLM-Powered Microservices With Kubernetes on AWS

Trending

  • The Role of AI in Identity and Access Management for Organizations
  • Scaling Microservices With Docker and Kubernetes on Production
  • Integrating Model Context Protocol (MCP) With Microsoft Copilot Studio AI Agents
  • How Kubernetes Cluster Sizing Affects Performance and Cost Efficiency in Cloud Deployments
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. A/B Testing With Kubernetes and Istio

A/B Testing With Kubernetes and Istio

See how you can use Kubernetes and Istio together to implement A/B testing in your app so that you can measure user response and make the best decisions.

By 
Niklas Heidloff user avatar
Niklas Heidloff
DZone Core CORE ·
Feb. 20, 18 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
9.1K Views

Join the DZone community and get the full member experience.

Join For Free

last week i gave a presentation “ when to use serverless? when to use kubernetes? ” one of the weaknesses of serverless platforms is that you currently cannot do things like a/b testing well since there is no notion of versions.

a/b testing allows running multiple variants of functionality in parallel, so that through analytics of user behavior, the better variant can be determined. similar to ‘dark launches,’ new features can be made available to only certain users to test features in production environments before these features will be released to the masses.

these traffic flow management capabilities are one of the advantages of kubernetes and istio . istio is an open platform to manage microservices.

some of my colleagues have documented how to do traffic flow management with istio for the book info sample that is part of the istio documentation . the current documentation is for istio 0.1.6 and doesn’t work for the later version 0.5.0, which i use. i’ve sent a pull request , since some urls have changed.

the diagram shows the architecture of the book info sample app. books have reviews and can have ratings. the application has three versions of the review service. the gray components on the left-hand side are the istio components. when the sample application is deployed, further istio components, the envoy containers, are automatically added to each pod. these envoy components are proxies (also called sidecars) through which containers communicate with each other which is the basis for istio’s traffic management capabilities.

istio-sample-architecture

check out the bookinfo.yaml file to see how to define and deploy the three versions of the review service.

in order to route traffic to version 1 for 50% of the invocations and to version 3 for the other half, this route rule can be used.

apiversion: config.istio.io/v1alpha2
kind: routerule
metadata:
  name: reviews-default
spec:
  destination:
    name: reviews
  precedence: 1
  route:
  - labels:
      version: v1
    weight: 50
  - labels:
      version: v3
    weight: 50


in order to expose version 2 to only users with the name ‘jason’, a regular expression can be used.

apiversion: config.istio.io/v1alpha2
kind: routerule
metadata:
  name: reviews-test-v2
spec:
  destination:
    name: reviews
  precedence: 2
  match:
    request:
      headers:
        cookie:
          regex: "^(.*?;)?(user=jason)(;.*)?$"
  route:
  - labels:
      version: v2


to learn more about traffic management in istio, check out the documentation . if you want to try out kubernetes, you can get an account on the ibm cloud .
Kubernetes A/B testing

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  • Building Reliable LLM-Powered Microservices With Kubernetes on AWS

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!