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

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

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Mastering Advanced Traffic Management in Multi-Cloud Kubernetes: Scaling With Multiple Istio Ingress Gateways
  • A Guide to Container Runtimes
  • Java's Quiet Revolution: Thriving in the Serverless Kubernetes Era
  • Overview of Telemetry for Kubernetes Clusters: Enhancing Observability and Monitoring

Trending

  • Emerging Data Architectures: The Future of Data Management
  • Understanding Java Signals
  • Failure Handling Mechanisms in Microservices and Their Importance
  • How to Configure and Customize the Go SDK for Azure Cosmos DB
  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

  • Mastering Advanced Traffic Management in Multi-Cloud Kubernetes: Scaling With Multiple Istio Ingress Gateways
  • A Guide to Container Runtimes
  • Java's Quiet Revolution: Thriving in the Serverless Kubernetes Era
  • Overview of Telemetry for Kubernetes Clusters: Enhancing Observability and Monitoring

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!