Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] unitedDeployment controller need support patch feature for pool. #242

Closed
kadisi opened this issue Mar 22, 2021 · 2 comments
Assignees

Comments

@kadisi
Copy link
Member

kadisi commented Mar 22, 2021

Background:

Now UnitedDeployment controller provides a new way to manage pods in multi-pool by using multiple workloads.
Each workload managed by UnitedDeployment is called a pool. Each pool should at least provide the capacity to run the replicas number of pods.

The below sample yaml presents a UnitedDeployment which manages three Deployment instances in one pool(cloud).

apiVersion: apps.openyurt.io/v1alpha1
kind: UnitedDeployment
metadata:
  name: deploy
  namespace: default
spec:
  selector:
    matchLabels:
      app: deploy
  workloadTemplate:
    deploymentTemplate:
      metadata:
        labels:
          app: deploy
      spec:
        selector:
          matchLabels:
            app: deploy
        template:
          metadata:
            labels:
              app: deploy
          spec:
            containers:
            - image: nginx:1.19.3
              imagePullPolicy: Always
              name: nginx
  topology:
    pools:
    - name: cloud
      nodeSelectorTerm:
        matchExpressions:
        - key: apps.openyurt.io/uniteddeployment
          operator: In
          values:
          - cloud
      replicas: 1

We can see the workloadTemplate.DeploymentTemplate configuration to describe a Deployment template, and pool named cloud which has nodeSelectorTerm and replicas field. So use workloadTemplate and topology.pools configuration, UnitedDeployment's Pods are evenly distributed across all pools.

When an UnitedDeployment CR is created, a workload created progress will be triggered. Each workload will inherits this spec.workloadTemplate configuration. Each workload will be patch to spec.workloadTemplate configuration use it's Replicas field.

Why is this needed:

Therefore, until now, each workload has been able to modify the template differently based on its Replicas configuration.
However, in a real edge scenario, the user may not only want to modify the Replicas configuration, but other configurations will also be modified. Here are a few scenario examples:

1 User wants to upgrade the image version in a certain Pool and verify it. After successful verification, upgrade the image's version in all pools in full amount.

2 Users use a Pool to represent a node Pool, each node Pool will be built under a different image repository, so the image name may be different

  1. Host configuration, scale and access pressure are different in different node pools, so pod's containers.resources.request and containers.resources.limit may also be different.

so unitedDeployment controller need support patch feature for pool.

@rambohe-ch
Copy link
Member

@kadisi It's a good idea to add patch feature for UnitedDeployment, so user can customize the deployment in every pool easily.

@rambohe-ch
Copy link
Member

This feature is released in OpenYurt, so close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants