Bartosz Bierkowski - Low dose cloud

morsels

OpenShift CLI morsels: showing labels of nodes in columns

OpenShift CLI morsels: showing labels of nodes in columns

morsels, OpenShift, OpenShift CLI morsels
With more than one node and more advanced setup than in minishift, you can use labels to add metadata to nodes. There are two ways to display later this information. Showing all labels of a node The following command returns all labels of all nodes. Normally the labels are not displayed and the [crayon-614f0dcd97d4b879337250-i/] flag has to be used to show them. [crayon-614f0dcd97d53268568203/] Displaying only selected labels As the number of labels and nodes grows, the output becomes unreadable. Usually just some of the metadata is useful at a time. The displayed labels can be then narrowed just to few that are helpful. Lets show only architecture and os. [crayon-614f0dcd97d54759300071/] I like that the selected labels are shortened and presented in columns. This adds a lot to t...
OpenShift CLI morsels: sudo and user impersonation

OpenShift CLI morsels: sudo and user impersonation

morsels, OpenShift, OpenShift CLI morsels
On linux machine you can use sudo to execute commands and so far I thought there is no equivalent approach in OpenShift. How mistaken I was! It looks like since OpenShift 3.1 the APIs allow to pass additional argument with the name of the user to impersonate. Give the developer a sudoers role On my minishift instance I add[crayon-614f0dcd987d3962968616-i/] role to the default[crayon-614f0dcd987d7575248433-i/] user. [crayon-614f0dcd987da711282063/] Using the new role Starting from now, the [crayon-614f0dcd987dc897655219-i/] user can execute commands as a [crayon-614f0dcd987de830194164-i/]. For example listing all nodes is possible, which does not work without the impersonation. [crayon-614f0dcd987df624414801/] Environment I executed the commands using minishift and the following cli...