Network Policy to Explicitly Allow access from all Namespaces

The Default network policy in OpenShift allows all access from all pods in all namespaces via the cluster IP. However, once you start enforcing policy on a project, all policy decision need to be made explicit. If you want to still allow access from all projects, you can use the following policy file.

kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: allow-all-namespaces
spec:
  ingress:
  - from:
    - namespaceSelector: {}

Deploying a Minimalistic Flask Application to OpenShift

Some colleagues and I were discussing the network access policy of OpenShift. I realized it would be very helpful to have a trivial app that I could deploy to OpenShift that would then try to make a call to another service. So I wrote it using Python3 and Flask. Now that I have it working, I want to deploy it in OpenShift, again, in a trivial manner.

I would not deploy a Flask App into production without a Web server to front it. But that is what I am going to do for this test app.

Continue reading →

18 Triadic Permutations

I use the term permutations loosely here. But for any given chord inversion, there are 6 variations of the tones in the pitch you can play in order to play each tone once. What makes this an impure use of the term permutations is that the second and third notes of the sequence can go both above the starting note in one variation, and below it in another.

Continue reading →

An Ansible Approach to Registering RHEL Systems

I am constantly creating and deleting virtual machines. These virtual machines often are RHEL systems, and need to be registered with Red Hat’s CDN. While In the past I had a Role that was wrapped into other provisioning playbooks to perform this task, I find that there are enough one-offs to make it useful to do this as a stand alone playbook. Here is how I set it up, including my rational.

Continue reading →

PXE Lessons learned

When provisioning goes wrong, it can eat up a lot of time. I need to install and configure a RHEL 8 machine to act as an HA proxy for an OpenShift install, and it was somewhat resistant to my efforts. I learned a couple things worth recording:

  1. The minimum size of a VM for a PXE install is roughtly 3 GB now, as that is what it takes to properly handle the initrd. If you make the VM too small, the Filesystem in the initrd gets corrupted.
  2. If the kickstart fails, you can change “graphical” or “cmdline” to text and get an interactive install, which should set you up with a properly formatted kickstart config in the VM /root/anaconda-ks.conf file when you are done.
  3. You are going to want to keep an index file based on the MAC addresses of the Hardware you are provisioning. Right now, I am using the symlinks in the tftp directory to play that role. The script I use to set the symlinks is below.
  4. I really should be using Cobbler to manage all this. I’ll learn it some day.
#!/bin/sh
 
function reset_link(){
 
MACHINE=$1
TARGET=$2
echo  ---------------------------------------
echo reset          $MACHINE
rm             $MACHINE
ln -s $TARGET  $MACHINE
}
 
r610s='01-00-21-9b-93-d0-90 01-00-21-9b-98-a3-1f 01-00-21-9b-9b-c4-21'
 
kvms='01-52-54-00-2d-74-f1 01-52-54-00-dc-37-cb 01-52-54-00-52-fa-3d'
 
LB=01-52-54-00-b1-5b-16
BOOTSTRAP=01-52-54-00-29-0b-bf
 
for MACHINE in $r610s
do
reset_link $MACHINE rhel8.2-r610
done
 
for MACHINE in $kvms
do
reset_link $MACHINE rhcoreos-4.4.3-kvm-control
done
 
reset_link $BOOTSTRAP rhcoreos-4.4.3-kvm-bootstrap
reset_link $LB rhel8.2-kvm

This is obviously ripe for a YAML type config file.

To convert a MAC to the appropriate form for pxelinux.cfg use this bash. note that I prepended 01: to the mac address so that it is ends up in the right place in the final file name:

echo  01:52:54:00:e0:f0:fd | sed 's!:!-!g