Add nodeSelector to WordPress App

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!

Hi,

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

Then edit the deployment (as yaml):

      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:

      nodeSelector:
        myappgoeshere: nginx

Without label the node you get this error message:
image

Future reading:
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

Br,
Janos Vincze

Node labeling: