- Python monitoring script for daily GSC reports - Kubernetes CronJob for automated execution - Tracks search analytics, crawl errors, and sitemap status - Includes full setup documentation
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: gsc-monitoring
|
|
namespace: manoonoils
|
|
spec:
|
|
schedule: "0 9 * * *" # Run daily at 9 AM
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: gsc-monitor
|
|
image: gcr.io/manoonoils/gsc-monitoring:latest
|
|
env:
|
|
- name: GSC_KEY_FILE
|
|
value: /etc/gsc-monitoring/service-account.json
|
|
- name: PYTHONUNBUFFERED
|
|
value: "1"
|
|
volumeMounts:
|
|
- name: gsc-credentials
|
|
mountPath: /etc/gsc-monitoring
|
|
readOnly: true
|
|
- name: logs
|
|
mountPath: /var/log/gsc-monitoring
|
|
volumes:
|
|
- name: gsc-credentials
|
|
secret:
|
|
secretName: gsc-service-account
|
|
- name: logs
|
|
emptyDir: {}
|
|
restartPolicy: OnFailure
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: gsc-service-account
|
|
namespace: manoonoils
|
|
type: Opaque
|
|
stringData:
|
|
service-account.json: |
|
|
# PLACEHOLDER - Replace with actual service account JSON
|
|
# Run: kubectl create secret generic gsc-service-account \
|
|
# --namespace=manoonoils \
|
|
# --from-file=service-account.json=/path/to/your/service-account-key.json
|