Skip to content

Commit

Permalink
Add profile app cronjobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Jun 11, 2024
1 parent cd4d798 commit 8552f2a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 131 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: apply prom

apply:
kubectl apply --prune --all --kustomize .
kubectl apply --prune --all --validate=false --kustomize .

prom:
kubectl port-forward svc/prom 8080:80
1 change: 0 additions & 1 deletion kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ resources:
- manifests/homeassistant.yaml
- manifests/keycloak.yaml
- manifests/nvidia.ext.yaml
- manifests/profile-staging.yaml
- manifests/profile.yaml
- manifests/prom.yaml
- manifests/psql-keycloak.yaml
Expand Down
128 changes: 0 additions & 128 deletions manifests/profile-staging.yaml

This file was deleted.

103 changes: 102 additions & 1 deletion manifests/profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: svc
# Image is set in the profile app's deploy github action
image: ghcr.io/thelab-ms/profile:sha-109b545
volumeMounts:
- name: keycloak-creds
mountPath: /var/lib/keycloak
Expand Down Expand Up @@ -158,3 +158,104 @@ spec:
services:
- name: profile
port: 80

---
apiVersion: batch/v1
kind: CronJob
metadata:
name: visit-check-job
spec:
schedule: "0 5 * * *"
jobTemplate:
spec:
backoffLimit: 4
template:
spec:
nodeName: supermicro1
restartPolicy: Never
containers:
- name: job
imagePullPolicy: IfNotPresent
image: ghcr.io/thelab-ms/profile/visit-check-job:sha-109b545
volumeMounts:
- name: keycloak-creds
mountPath: /var/lib/keycloak
env:
- name: SELF_URL
value: https://profile.thelab.ms
- name: KEYCLOAK_URL
value: http://keycloak.default.svc.cluster.local
- name: KEYCLOAK_MEMBERS_GROUP_ID
value: 4eea9c17-f9b1-41eb-8f25-721ae04b66f6
- name: EVENT_PSQL_USERNAME
value: postgres
- name: EVENT_PSQL_ADDR
value: "psql-reporting.default.svc.cluster.local"
- name: EVENT_PSQL_PASSWORD
valueFrom:
secretKeyRef:
name: reporting-psql
key: password
volumes:
- name: keycloak-creds
csi:
driver: identity.keycloak.org
volumeAttributes:
clientID: profile-app

---
apiVersion: batch/v1
kind: CronJob
metadata:
name: paypal-check-job
spec:
schedule: "0 4 * * *"
jobTemplate:
spec:
backoffLimit: 4
template:
spec:
nodeName: supermicro1
restartPolicy: Never
containers:
- name: job
imagePullPolicy: IfNotPresent
image: ghcr.io/thelab-ms/profile/paypal-check-job:sha-109b545
volumeMounts:
- name: keycloak-creds
mountPath: /var/lib/keycloak
- name: root-ca
mountPath: /etc/ssl/certs
env:
- name: SELF_URL
value: https://profile.thelab.ms
- name: KEYCLOAK_URL
value: http://keycloak.default.svc.cluster.local
- name: KEYCLOAK_MEMBERS_GROUP_ID
value: 4eea9c17-f9b1-41eb-8f25-721ae04b66f6
- name: EVENT_PSQL_USERNAME
value: postgres
- name: EVENT_PSQL_ADDR
value: "psql-reporting.default.svc.cluster.local"
- name: EVENT_PSQL_PASSWORD
valueFrom:
secretKeyRef:
name: reporting-psql
key: password
- name: PAYPAL_CLIENT_ID
value: "AQVBErG_0lJAN5lhC_fSYUWvMjYpQrGxoCuO0jdAs7yiLVghlT0PpQflGIyL6DUAn5AFC_R9A0dHKkzu"
- name: PAYPAL_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: stripe-creds
key: paypal-secret
volumes:
- name: keycloak-creds
csi:
driver: identity.keycloak.org
volumeAttributes:
clientID: profile-app
- name: root-ca
hostPath:
path: /etc/ssl/certs/
type: Directory

0 comments on commit 8552f2a

Please sign in to comment.