# Add nodeSelector to WordPress App

**URL:** <https://forums.suse.com/t/add-nodeselector-to-wordpress-app/17727>\
**Category:** General\
**Created:** [June 15, 2020, 12:11pm UTC](https://forums.suse.com/t/add-nodeselector-to-wordpress-app/17727 "2020-06-15T12:11:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fpieressa](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fpieressa/32/6341_2.png) [@fpieressa](https://forums.suse.com/u/fpieressa)\
**Post date:** [June 15, 2020, 12:11pm UTC](https://forums.suse.com/t/add-nodeselector-to-wordpress-app/17727/1 "2020-06-15T12:11:22Z")

</div>

Hi team! I want to Launch a new WordPress App, forcing to be scheduled in a particular Node.

I’m seeing in the “Detailed description” section of the App that the nodeSelector parameter is supported, but I don’t know where to add it…

How can I add the nodeSelector parameters? I think I have to configure it using the “Edit as YAML” option, but I don’t know where…

Thanks!

---

<div class="post-metadata">

**Author:** ![jvincze84](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jvincze84/32/5474_2.png) [@jvincze84](https://forums.suse.com/u/jvincze84)\
**Post date:** [June 26, 2020, 2:21pm UTC](https://forums.suse.com/t/add-nodeselector-to-wordpress-app/17727/2 "2020-06-26T14:21:28Z")

</div>

Hi,

First you need to add a label to the node on which the pod should be running.

Then edit the deployment (as yaml):

```auto
      containers:
      - image: nginx
        imagePullPolicy: Always
        name: nginx
        ports:
        - containerPort: 80
          name: nginx
          protocol: TCP
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities: {}
          privileged: false
          readOnlyRootFilesystem: false
          runAsNonRoot: false
        stdin: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        tty: true
      dnsPolicy: ClusterFirst
      nodeSelector:
        myappgoeshere: nginx
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

```

Important part:

```auto
      nodeSelector:
        myappgoeshere: nginx

```

Without label the node you get this error message:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/b/b2002687a10547266bbeb917877bac6fd6049971.png)

Future reading:  
[https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)  
[https://medium.com/kubernetes-tutorials/learn-how-to-assign-pods-to-nodes-in-kubernetes-using-nodeselector-and-affinity-features-e62c437f3cf8](https://medium.com/kubernetes-tutorials/learn-how-to-assign-pods-to-nodes-in-kubernetes-using-nodeselector-and-affinity-features-e62c437f3cf8)

Br,  
Janos Vincze

---

<div class="post-metadata">

**Author:** ![jvincze84](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jvincze84/32/5474_2.png) [@jvincze84](https://forums.suse.com/u/jvincze84)\
**Post date:** [June 26, 2020, 2:22pm UTC](https://forums.suse.com/t/add-nodeselector-to-wordpress-app/17727/3 "2020-06-26T14:22:06Z")

</div>

Node labeling:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/6/6b4cb5e9abe1f81ab363e8fc378655091e4ae39c.png)
