Advertisement
Guest User

Just Me | Openshift NodeSelector

a guest
Oct 19th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. ~ 🞂🞂 minishift status
  2. Minishift: Running
  3. Profile: minishift
  4. OpenShift: Running (openshift v3.11.0+bd0bee4-337)
  5. DiskUsage: 19% of 19G (Mounted On: /mnt/sda1)
  6. CacheUsage: 1.682 GB (used by oc binary, ISO or cached images)
  7.  
  8. ~ 🞂🞂 oc version
  9. oc v3.11.0+0cbc58b
  10. kubernetes v1.11.0+d4cacc0
  11. features: Basic-Auth GSSAPI Kerberos SPNEGO
  12. Server https://192.168.99.100:8443
  13. kubernetes v1.11.0+d4cacc0
  14.  
  15. ~ 🞂🞂 oc whoami
  16. system:admin
  17.  
  18. ~ 🞂🞂 oc label node localhost machinespec=high
  19. node/localhost labeled
  20.  
  21. ~ 🞂🞂 oc get nodes --show-labels
  22. NAME STATUS ROLES AGE VERSION LABELS
  23. localhost Ready <none> 21m v1.11.0+d4cacc0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=localhost,machinespec=high
  24.  
  25. ~ 🞂🞂 cat /tmp/nginx.yaml
  26. apiVersion: apps/v1
  27. kind: Deployment
  28. metadata:
  29. labels:
  30. run: nginx
  31. name: nginx-deploy
  32. spec:
  33. replicas: 1
  34. selector:
  35. matchLabels:
  36. run: nginx
  37. template:
  38. metadata:
  39. labels:
  40. run: nginx
  41. spec:
  42. containers:
  43. - image: twalter/openshift-nginx
  44. name: nginx
  45. nodeSelector:
  46. machinespec: high
  47.  
  48. ~ 🞂🞂 oc create -f /tmp/nginx.yaml
  49. deployment.apps/nginx-deploy created
  50.  
  51. ~ 🞂🞂 oc get pod
  52. NAME READY STATUS RESTARTS AGE
  53. pod/nginx-deploy-c96c64d6-ld8fs 1/1 Running 0 25s
  54.  
  55. ~ 🞂🞂 oc delete -f /tmp/nginx.yaml
  56. deployment.apps "nginx-deploy" deleted
  57.  
  58. ~ 🞂🞂 oc label node localhost machinespec-
  59. node/localhost labeled
  60.  
  61. ~ 🞂🞂 oc get nodes --show-labels
  62. NAME STATUS ROLES AGE VERSION LABELS
  63. localhost Ready <none> 27m v1.11.0+d4cacc0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=localhost
  64.  
  65. ~ 🞂🞂 oc create -f /tmp/nginx.yaml
  66. deployment.apps/nginx-deploy created
  67.  
  68. ~ 🞂🞂 oc get pod
  69. NAME READY STATUS RESTARTS AGE
  70. nginx-deploy-c96c64d6-wm7pr 0/1 Pending 0 28s
  71.  
  72. ~ 🞂🞂 oc describe pod nginx-deploy-c96c64d6-wm7pr | tail -1
  73. Warning FailedScheduling 8s (x21 over 3m) default-scheduler 0/1 nodes are available: 1 node(s) didn't match node selector.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement