Created
September 30, 2021 14:51
-
-
Save vmorris/4ae8a9da4a46e41a5adf73a0eafd9bf8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(oc --kubeconfig /root/deployment/auth/kubeconfig get csr | grep -i pending | awk '{ print $1 }'); do | |
echo "Approving CSR $i" | |
oc --kubeconfig /root/deployment/auth/kubeconfig adm certificate approve $i | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OCP CSR Automatic Approval Service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/sbin/approve_csr.sh | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OCP CSR Automatic Approval Timer | |
[Timer] | |
#check every 5 seconds for pending CSR and approve them | |
OnCalendar=*-*-* *:*:0/5 | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment