#!/bin/sh # Copy script into /etc/cron.daily/ # Make it executable chmod 0755 # TODO: Update path to actual kubeconfig export KUBECONFIG=/home/rancher/.kube/config for n in $(kubectl get namespaces -A -o=jsonpath="{.items[*]['metadata.name']}"); do kubectl patch serviceaccount default -p '{"automountServiceAccountToken": false}' -n $n done