Bartosz Bierkowski - Low dose cloud

OpenShift

OpenShift CLI morsels: updating objects non-interactively

OpenShift CLI morsels: updating objects non-interactively

morsels, OpenShift, OpenShift CLI morsels
Recently, when I tried to answer the question: Openshift: how to edit scc non-interactively? I learned about nice feature of [crayon-667a0709e3d40016924703-i/] . It allows to change single values in OpenShift objects. Patching the resources For this scenario, let's say we have a deployment config called paprika. Standard way to update it is to run [crayon-667a0709e3d45207452153-i/]  and change fields. That works only until it is not a repeatable task or something that needs to be done often. Changing single value Using [crayon-667a0709e3d47918427638-i/]  you can easily automate simple tasks. Setting the rolling update timeout using this approach looks like this: [crayon-667a0709e3d48190927945/] The patch is an array of objects with the following fields: op - one of the operation
OpenShift CLI morsels: getting docs from oc client

OpenShift CLI morsels: getting docs from oc client

morsels, OpenShift, OpenShift CLI morsels
The documentation is not the only place with information about OpenShift CLI. The tool itself contains a huge amount of data about the managed resources itself. Finding the managed resources A good starting point is to read output of [crayon-667a0709e41be878544916-i/] that returns description of used concept and types. These are not all of them, but the ones used during development. You will not find there details about [crayon-667a0709e41c1894814922-i/] or [crayon-667a0709e41c3024983859-i/] . For the listed types you can run [crayon-667a0709e41c4014574695-i/] Exploring type's details Armed with the knowledge of various types, further details can be displayed for it with[crayon-667a0709e41c5837509990-i/] . The command prints our all the fields, their types and descriptions. [crayon...
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-667a0709e43e2844458567-i/] flag has to be used to show them. [crayon-667a0709e43e5261860786/] 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-667a0709e43e6682749761/] 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-667a0709e4590913588980-i/] role to the default[crayon-667a0709e4593572838525-i/] user. [crayon-667a0709e4594226620300/] Using the new role Starting from now, the [crayon-667a0709e4596714164643-i/] user can execute commands as a [crayon-667a0709e4597639001035-i/]. For example listing all nodes is possible, which does not work without the impersonation. [crayon-667a0709e4598371728005/] Environment I executed the commands using minishift and the following cli...
MiniShift setup on Windows

MiniShift setup on Windows

OpenShift
I've been constrained to Windows recently and decided that such a small inconvenience won't stop me from trying out MiniShift on my desktop. Since constraints liberate [ref]Constraints Liberate, Liberties Constrain - Fantastic talk by Runar Bjarnason from Scala World 2015[/ref] that could also be an interesting experience. Installation Here are just some notes to start with it. I started with installing: VirtualBox 5.1 Minishift release 0.9.0 OpenShift client 1.2.2 After configuring it minishift to use the VirtualBox: [crayon-667a0709e49cf403821813-i/] - configure minishift to use VirtualBox Since I installed it on h: drive, it fails to start. Related issue is https://github.com/kubernetes/minikube/issues/459 [crayon-667a0709e49d3137308702/] The problematic part is:...