Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Istio "version" label is not supported to allow multiple versions of app in the same cluster  #228

@nastacio

Description

@nastacio

Feature Request

Deploying multiple versions of the same application in the same cluster is a common practice in order to allow progressive transfer of traffic from the old to the new version over time, for instance, allowing a team to "test in production" with 5% of traffic going to a new release while 95% remains in the older release.

Is your feature request related to a problem?

Yes, for Istio service meshes, which support this concept natively through the usage of the label "version". appsody deploy always removes the old version of an app, there is no option to keep the previous version deployed.

One could try and rename the Appsody application in the app-deploy.yaml, but then Appsody will create two Service objects when what we want is a single Service object with a selector that matches all pods representing all the different versions of the application, such as in the snippet below pulled out of an Istio sample :

apiVersion: v1
kind: Service
metadata:
  name: reviews
  labels:
    app: reviews
    service: reviews
spec:
  ports:
  - port: 9080
    name: http
  selector:
    app: reviews
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: reviews-v1
  labels:
    app: reviews
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reviews
      version: v1
  template:
    metadata:
      labels:
        app: reviews
        version: v1
    spec:
      serviceAccountName: bookinfo-reviews
      containers:
      - name: reviews
        image: docker.io/istio/examples-bookinfo-reviews-v1:1.15.0
        ports:
        - containerPort: 9080
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: reviews-v2
  labels:
    app: reviews
    version: v2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reviews
      version: v2
  template:
    metadata:
      labels:
        app: reviews
        version: v2
    spec:
      serviceAccountName: bookinfo-reviews
      containers:
      - name: reviews
        image: docker.io/istio/examples-bookinfo-reviews-v2:1.15.0
       ports:
        - containerPort: 9080
 ---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: reviews-v3
  labels:
    app: reviews
    version: v3
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reviews
      version: v3
  template:
    metadata:
      labels:
        app: reviews
        version: v3
    spec:
      serviceAccountName: bookinfo-reviews
      containers:
      - name: reviews
        image: docker.io/istio/examples-bookinfo-reviews-v3:1.15.0
        ports:
        - containerPort: 9080

Describe the solution you'd like

Istio prescribes the usage of the app label to tie various Deployment objects to the same logical application inside the service mesh, and the usage of the version label to distinguish each Deployment version. With all deployments labeled with app and version labels, Istio then requires a single Service object with a selector for the app label (see above snippet).

The AppsodyOperator already allows the addition of the app and label versions to the AppsodyApplication object, so we need a mechanism to achieve that arrangement with a single Service using a selector matching all the Deployment objects.

As a current workaround, one could ignore the Service objects created by the Appsody operator and create their own Service object with a selector tied to the Istio app and version labels in the multiple AppsodyApplication objects representing the multiple versions of the logical application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions