Skip to content

Feature: Kubernetes CronJob for continuous drift monitoring #3

@catherinevee

Description

@catherinevee

Feature Request

Problem Statement

Currently, DriftMgr requires users to manually check for drift by running commands. For production environments, continuous monitoring with automatic alerts would be more valuable.

Proposed Solution

Implement a Kubernetes CronJob template and Helm chart that:

  • Runs drift detection on a schedule
  • Sends notifications to Slack/Teams/PagerDuty
  • Stores historical drift data
  • Provides a Grafana dashboard for visualization

Implementation Details

# Example CronJob configuration
apiVersion: batch/v1
kind: CronJob
metadata:
  name: driftmgr-monitor
spec:
  schedule: "*/30 * * * *"  # Every 30 minutes
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: driftmgr
            image: catherinevee/driftmgr:latest
            command:
            - /bin/sh
            - -c
            - |
              driftmgr drift detect --all-providers --output json | \
              driftmgr notify --slack-webhook $SLACK_WEBHOOK

Benefits

  • Proactive drift detection
  • Reduced manual oversight
  • Better compliance posture
  • Historical trend analysis

Additional Considerations

  • Support multiple notification channels
  • Configurable severity thresholds
  • Integration with existing monitoring stacks
  • Minimal resource footprint

Would this be something the team would consider adding? Happy to contribute the initial implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions