Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1688674 - Scheduler priority "ImageLocalityPriority" not take effect
Summary: Scheduler priority "ImageLocalityPriority" not take effect
Keywords:
Status: CLOSED DUPLICATE of bug 1685439
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod
Version: 4.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.1.0
Assignee: ravig
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-14 08:22 UTC by MinLi
Modified: 2019-03-20 15:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-20 15:32:07 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description MinLi 2019-03-14 08:22:14 UTC
Description of problem:
When create configmap and scheduler for policy priority "ImageLocalityPriority", it not take effect. It means a pod is not scheduled to a node which has image digest locally but to a node which need to pull image from registry.

Version-Release number of selected component (if applicable):
4.0.0-0.nightly-2019-03-13-233958
oc v4.0.0-0.182.0

How reproducible:
always

Steps to Reproduce:
1.#oc create configmap -n openshift-config --from-file=policy.cfg mypolicy
policy.cfg is like:
{
"kind" : "Policy",
"apiVersion" : "v1",
"priorities" : [
        {"name" : "ImageLocalityPriority", "weight" : 100}
        ]
}

2.#oc create -f scheduler.yaml
scheduler.yaml is like:
apiVersion: config.openshift.io/v1
kind: Scheduler
metadata:
  name: cluster
spec:
  policy:
    name: mypolicy

3.Pull image with digest in node1
#sudo crictl pull docker.io/deshuai/hello-pod@sha256:90b815d55c95fffafd7b68a997787d0b939cdae1bca785c6f52b5d3ffa70714f

4.Make sure only node1 has this image digest
#oc get node $nodeName -o json | grep
"sha256:90b815d55c95fffafd7b68a997787d0b939cdae1bca785c6f52b5d3ffa70714f"

5.Create a pod with this image digest.
#oc create -f pod.json -n minmli
pod.json is like:
{  
  "kind": "Pod",  
  "apiVersion": "v1",  
  "metadata": {  
    "name": "hello-openshift",  
    "creationTimestamp": null,  
    "labels": {  
      "name": "hello-openshift"  
    }  
  },  
  "spec": {  
    "containers": [  
      {  
        "name": "hello-openshift",  
**        "image": "docker.io/deshuai/hello-pod@sha256:90b815d55c95fffafd7b68a997787d0b939cdae1bca785c6f52b5d3ffa70714f",**  
        "ports": [  
          {  
            "containerPort": 8080,  
            "protocol": "TCP"  
          }  
        ],  
        "resources": {},  
        "volumeMounts": [  
          {  
            "name":"tmp",  
            "mountPath":"/tmp"  
          }  
        ],  
        "terminationMessagePath": "/dev/termination-log",  
        "imagePullPolicy": "IfNotPresent",  
        "capabilities": {},  
        "securityContext": {  
          "capabilities": {},  
          "privileged": false  
        }  
      }  
    ],  
    "volumes": [  
      {  
        "name":"tmp",  
        "emptyDir": {}  
      }  
    ],  
    "restartPolicy": "Always",  
    "dnsPolicy": "ClusterFirst",  
    "serviceAccount": ""  
  },  
  "status": {}  
}

Actual results:
5.the pod is not scheduled to node1, but node2 which need to pull image first. 

Expected results:
5.the pod is scheduled to node1


Additional info:
I think there should be some log in openshift-kube-scheduler pod, but I find nothing related, perhaps we should add some schedule log or maybe I don't choose correct log-level.


Note You need to log in before you can comment on or make changes to this bug.