change the annotation for node-selector for openshift namespace

7/6/2018

I want to create projects on a particular node on openshift using the rest api.

I call the openshift api /oapi/v1/projectrequests to create projects. And in the body I am sending,

    body:
    {
        apiVersion: 'v1',
        kind: 'ProjectRequest',
        metadata: {
            name: projectName,
            annotations: {
                "openshift.io/node-selector": "servicelevel=botifyproject",
            }
        }, 

This api runs successfully, project gets created but when I run the command, oc describr project <project-name> it doesn't show me anything that says it is inside the botifyproject node selector.

Is this the wrong way of doing this?

-- Ayush Ojha
docker
kubernetes
openshift
openshift-origin

0 Answers