Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kubernetes manifests that create a kubernetes cronjob and necessa… #44

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions k8s/base/daily-openshift-metrics-collector-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: daily-openshift-metrics-collector
spec:
schedule: "0 12 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: daily-openshift-metrics-collector
image: ghcr.io/cci-moc/openshift-usage-scripts:latest
env:
- name: OPENSHIFT_PROMETHEUS_URL
value: "https://thanos-querier-openshift-monitoring.apps.shift.nerc.mghpcc.org"
- name: OPENSHIFT_TOKEN
valueFrom:
secretKeyRef:
name: metrics-reader
key: token
- name: S3_OUTPUT_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: openshift-metrics-b2-bucket
key: access-key-id
- name: S3_OUTPUT_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: openshift-metrics-b2-bucket
key: secret-access-key
volumeMounts:
- name: data-volume
mountPath: /data
command: ["/bin/sh", "-c", "cd /data && python /app/openshift_metrics/openshift_prometheus_metrics.py --upload-to-s3"]
volumes:
- name: data-volume
emptyDir: {}
restartPolicy: OnFailure
2 changes: 2 additions & 0 deletions k8s/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- daily-openshift-metrics-collector-cronjob.yaml
5 changes: 5 additions & 0 deletions k8s/overlay/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- ../../base
- openshift-metrics-b2-bucket.yaml
- metrics-reader-token.yaml
namespace: xdmod-reader
8 changes: 8 additions & 0 deletions k8s/overlay/dev/metrics-reader-token.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: metrics-reader
type: Opaque
data:
token: <b64-encoded-token>

8 changes: 8 additions & 0 deletions k8s/overlay/dev/openshift-metrics-b2-bucket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: openshift-metrics-b2-bucket
type: Opaque
data:
access-key-id: 1234
secret-access-key: secret
Loading