This configuration sets up a Kubernetes CronJob that runs every 6 hours to check for the latest stable Kubernetes version. If a new version is available, a notification is sent to a specified Telegram chat, and the version is stored in a ConfigMap to avoid duplicate alerts.
-
Secret:
Stores the Telegram Bot Token and Chat ID. -
ConfigMap:
Contains thecheck_k8s_version.shscript that checks for updates and sends notifications. -
CronJob:
Runs the script inside an Alpine container every 6 hours (0 */6 * * *). -
ServiceAccount, Role, and RoleBinding:
Grant permissions to read and update theConfigMapin the specified namespace.
- Uses
kubectlandcurlto fetch and compare Kubernetes versions. - Sends a Telegram message only when a new version is released.
- Stores the last known version in a
ConfigMapto prevent repeated alerts. - Easily deployable with minimal changes.
Runs every 6 hours: 0 */6 * * *
📦 Kubernetes update: new version v1.33.3 (previous: v1.33.2)
Note: Replace the values in telegram-secret with your actual Telegram Bot Token and Chat ID before deploying.