## 3.2.1.11. Assigning pods to specific nodes 

You can use node selectors in conjunction with labeled nodes to control pod placement. 

Cluster administrators can set the default node selector for a project in order to restrict pod placement to specific nodes. As a developer, you can set a node selector on a Pod  configuration to restrict nodes even further. 

## Procedure 

1. To add a node selector when creating a pod, edit the Pod  configuration, and add the nodeSelector  value. This can be added to a single  configuration, or in a Pod  template: 

apiVersion: v1 kind: Pod spec: nodeSelector: disktype: ssd ... 

Pods created when the node selector is in place are assigned to nodes with the specified labels. The labels specified here are used in conjunction with the labels added by a cluster administrator. 

For example, if a project has the type=user-node  and region=east  labels added to a project by the cluster administrator, and you add the above disktype: ssd  label to a pod, the pod is only ever scheduled on nodes that have all three labels. 

## NOTE 

Labels can only be set to one value, so setting a node selector of region=west  in a Pod  configuration that has region=east  as the administrator-set default, results in a pod that will never be scheduled. 

## 3.2.1.12. Running a pod with a different service account 

You can run a pod with a service account other than the default. 

## Procedure 

1. Edit the DeploymentConfig  object: 

$ oc edit dc/<deployment_config> 

2. Add the serviceAccount  and serviceAccountName  parameters to the spec  field, and specify the service account you want to use: 

## 3.3. USING DEPLOYMENT STRATEGIES 

spec: securityContext: {} serviceAccount: <service_account > serviceAccountName: <service_account > 

