Solving the Ansible error 'This module requires the OpenShift Python client'

If you are using MacOS to develop Operators based on Ansible or simply running Ansible playbooks straight from your Mac, you might encounter this error: This module requires the OpenShift Python client. When coping with this error message, two items need to be checked: The openshift python module needs to be installed using the pip command bundled with your Ansible. If you are not using the implicit localhost, your inventory needs to be updated. Continue reading

Enable global policies on Apicast 3.6

Recent versions of Apicast have a pluggable policy mechanism to apply different treatments to each exposed API. This is very powerful since each service receives its specific configuration. However, if the same treatment has to be applied to every service exposed, it becomes an administration overhead. Hopefully, Apicast has the concept of Global Policies that applies to every service exposed by itself. Continue reading

Use QLKube to query the Kubernetes API

QLKube is a project that exposes the Kubernetes API as GraphQL. GraphQL is a data query and manipulation language for APIs developed initially by Facebook and released as open-source. It strives to reduce the chattiness clients can experience when querying REST APIs. It is very useful for mobile application and web development: by reducing the number of roundtrips needed to fetch the relevant data and by fetching only the needed field, the network usage is greatly reduced. Continue reading

One-liner to decode a Kubernetes secret (base64 encoded)

Creating a Kubernetes secret from a value is easy: $ oc create secret generic my-secret --from-literal=secretValue=super-secret secret/my-secret created But getting back this value (from a Shell script, for instance) is not so easy since it is now base64 encoded: $ oc get secret my-secret -o yaml apiVersion: v1 kind: Secret metadata: name: my-secret namespace: qlkube type: Opaque data: secretValue: c3VwZXItc2VjcmV0 Hopefully, since the latest versions of Kubernetes, there is now a one-liner to extract the field and base64 decode it: Continue reading

Bash Snippet: Print a config file without comments

Logging in on a server, printing a configuration file and trying to find the relevant setting from thousands of comment lines. Sounds familiar? Not that comments are useless in a configuration file but sometimes it’s handy to print a configuration file without the comment lines. Especially when the file is thousand lines long but the useful lines fit the twenty five lines of a standard terminal. Continue reading

Is my NTP daemon working?

If the time on your workstation or server is not stable, strange errors might appear, such as: $ tar zxvf /tmp/archive.tgz tar: my-file: time stamp 2019-03-28 14:04:45 is 0.042713488 s in the future This can happen when your NTP daemon is not synchronized. This means it cannot reliably determine the current time. Continue reading

Testing hard-drive or SSD performance on Fedora

If your Linux system appears to be slow, it might be an issue with your disks, either hard drive or SSD. Hopefully, with a few commands you can get an idea of the performances of your disks. Continue reading

Bash Snippet: CLI World Clock

When working in a global organization, colleagues are all around the world! And thus answering to “What time is it in their timezone?” becomes a frequent task. I initially used an online service for this but it is cumbersome and requires me to leave my terminal. Let’s meet the CLI World clock! Continue reading

M4 as a replacement for sed

Writing a tutorial often involves to replace a placeholder in a file, such as: Replace FOO with the actual name of your image: sed 's|IMAGE_NAME||g' template.yaml |kubectl apply -f - But this approach has several drawbacks: If you have to replace multiple placeholders, the sed syntax becomes cumbersome. If the delimiter appears in your replacement string, you will have to find another delimiter (such as in the previous example where the usual slash has been replaced by a pipe to accomodate the slash in the image name). Continue reading

Writing workshop instructions with Hugo and deploying in OpenShift

This is the third part of my series covering how to Write workshop instructions with Hugo. In this article, we will deploy our Hugo mini-training as a container in OpenShift. Continue reading