Raspberry Pi: Securing your Raspberry Pi

February 16, 2020

All the steps on this post are in my Ansible playbook for my Raspberry PI.

Disable devices

You can disable differents components via /boot/config.txt which use Device Tree Overlays.

Device Tree makes it possible to support many hardware configurations with a single kernel and without the need to explicitly load or blacklist kernel modules.

Disable Wifi

Edit the file /boot/config.txt and add the following line.

dtoverlay=disable-wifi

Disable Bluetooth

Edit the file /boot/config.txt and add the following line.

dtoverlay=disable-bt
Read more

Kubernetes: Delete pods older than X days

February 14, 2020

I'm working with Airflow and the Kubernetes operator which deploys from Airflow a container to Kubernetes. The pods created by Airflow have ended so the final status of the pod could be Succeeded or Failed. I was looking for to delete the pods created by Airflow but older than 5 days, so we can still read the logs from the pods until they are deleted.

I created a Python script that uses the Kubernetes API and a service account with permissions for reading and delete pods from a particular namespace. Also, I create a Docker image base on Python to execute the script and finally create a cronjob in Kubernetes to trigger this Docker every day at 2 am.

I don't want to copy and paste my README.md from my Github repository so here is the link:

Here is the link to the Docker image in Docker hub.