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

feat(cvc): user policy based target podAffinity for target deployment #107

Merged

Conversation

prateekpandey14
Copy link
Contributor

commit enhances the cstorvolumepolicy to use any key:value pair
as a target podAffinity set in target deployment while provisioning and
scheduling

Below is the example to use policy to configure the affinity and other
policies

apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  provision:
    replicaAffinity: true
  replica:
    zvolWorkers: ""
  target:
    resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    auxResources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    tolerations:
      - key: "key1"
        operator: "Equal"
        value: "value1"
        effect: "NoSchedule"
    priorityClassName: "system-cluster-critical"
    affinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: openebs.io/target-affinity
            operator: In
            values:
            - percona
        topologyKey: kubernetes.io/hostname
        namespaces: ["default"]

Signed-off-by: prateekpandey14 prateek.pandey@mayadata.io

commit enhances the cstorvolumepolicy to use any key:value pair
as a target podAffinity set in target deployment while provisioning and
scheduling

Below is the example to use policy to configure the affinity and other
policies

```
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  provision:
    replicaAffinity: true
  replica:
    zvolWorkers: ""
  target:
    resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    auxResources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    tolerations:
      - key: "key1"
        operator: "Equal"
        value: "value1"
        effect: "NoSchedule"
    priorityClassName: "system-cluster-critical"
    affinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: openebs.io/target-affinity
            operator: In
            values:
            - percona
        topologyKey: kubernetes.io/hostname
        namespaces: ["default"]

```

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are good

@prateekpandey14 prateekpandey14 merged commit 40aa7af into openebs-archive:master Jun 26, 2020
prateekpandey14 added a commit to prateekpandey14/cstor-operators that referenced this pull request Jul 1, 2020
…openebs-archive#107)

commit enhances the cstorvolumepolicy to use any key:value pair
as a target podAffinity set in target deployment while provisioning and
scheduling

Below is the example to use policy to configure the affinity and other
policies

```
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  provision:
    replicaAffinity: true
  replica:
    zvolWorkers: ""
  target:
    resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    auxResources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    tolerations:
      - key: "key1"
        operator: "Equal"
        value: "value1"
        effect: "NoSchedule"
    priorityClassName: "system-cluster-critical"
    affinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: openebs.io/target-affinity
            operator: In
            values:
            - percona
        topologyKey: kubernetes.io/hostname
        namespaces: ["default"]

```

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
kmova pushed a commit that referenced this pull request Jul 2, 2020
…#107)

commit enhances the cstorvolumepolicy to use any key:value pair
as a target podAffinity set in target deployment while provisioning and
scheduling

Below is the example to use policy to configure the affinity and other
policies

```
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  provision:
    replicaAffinity: true
  replica:
    zvolWorkers: ""
  target:
    resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    auxResources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    tolerations:
      - key: "key1"
        operator: "Equal"
        value: "value1"
        effect: "NoSchedule"
    priorityClassName: "system-cluster-critical"
    affinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: openebs.io/target-affinity
            operator: In
            values:
            - percona
        topologyKey: kubernetes.io/hostname
        namespaces: ["default"]

```

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
@prateekpandey14 prateekpandey14 deleted the target-affinity branch November 2, 2020 16:29
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

Successfully merging this pull request may close these issues.

3 participants