Skip to content

A deployment with a GPU request can still be deployed to a member cluster without a GPU Node #4435

@chaunceyjiang

Description

@chaunceyjiang

What would you like to be added:

I hope that a deployment with GPU resources can only be deployed to member clusters with GPU nodes.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: device-plugin
spec:
  replicas: 2
  selector:
    matchLabels:
      app: device-plugin
  template:
    metadata:
      labels:
        app: device-plugin
    spec:
      containers:
        - name: device-plugin
          image: busybox
          command: ["/bin/sh", "-ec", "while :; do echo '.'; sleep 5 ; done"]
          resources:
            limits:
              cpu: 2500m
              memory: 100Mi
              nvidia.com/vgpu: '1'
---
apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: device-plugin-pp
spec:
  resourceSelectors:
  - apiVersion: apps/v1
    kind: Deployment
    name: device-plugin
  placement :
    clusterAffinity:
      clusterNames :
        - member1
        - member2
        - member3
    replicaScheduling:
      replicaDivisionPreference: Weighted
      replicaSchedulingType: Divided
#      weightPreference:
#        dynamicWeight: AvailableReplicas

Why is this needed:

A deployment with a GPU request cannot start normally on a cluster without GPU nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    Status

    Todo

    Status

    Triaging

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions