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

move data extract jobs to use k8s #36137

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions apps/probate/aat/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- ../../probate-cron-make-dormant-cases/probate-cron-make-dormant-cases.yaml
- ../../probate-cron-reactivate-dormant-cases/probate-cron-reactivate-dormant-cases.yaml
- ../../probate-cron-hmrc-extract/probate-cron-hmrc-extract.yaml
- ../../probate-cron-iron-mountain-extract/probate-cron-iron-mountain-extract.yaml
- ../../probate-cron-smee-and-ford-extract/probate-cron-smee-and-ford-extract.yaml
- ../../../rbac/nonprod-role.yaml
- ../../../base/slack-provider/aat
Expand All @@ -17,6 +18,7 @@ patches:
- path: ../../probate-cron-make-dormant-cases/aat/aat.yaml
- path: ../../probate-cron-reactivate-dormant-cases/aat/aat.yaml
- path: ../../probate-cron-hmrc-extract/aat/aat.yaml
- path: ../../probate-cron-iron-mountain-extract/aat/aat.yaml
- path: ../../probate-cron-smee-and-ford-extract/aat/aat.yaml
- path: ../../identity/aat.yaml
- path: ../../serviceaccount/aat.yaml
2 changes: 2 additions & 0 deletions apps/probate/demo/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- ../../probate-cron-make-dormant-cases/probate-cron-make-dormant-cases.yaml
- ../../probate-cron-reactivate-dormant-cases/probate-cron-reactivate-dormant-cases.yaml
- ../../probate-cron-hmrc-extract/probate-cron-hmrc-extract.yaml
- ../../probate-cron-iron-mountain-extract/probate-cron-iron-mountain-extract.yaml
- ../../probate-cron-ccd-data-migration-tool/probate-cron-ccd-data-migration-tool.yaml
- ../../probate-cron-smee-and-ford-extract/probate-cron-smee-and-ford-extract.yaml
- ../../../rbac/nonprod-role.yaml
Expand All @@ -22,5 +23,6 @@ patches:
- path: ../../probate-cron-reactivate-dormant-cases/demo/demo.yaml
- path: ../../probate-cron-smee-and-ford-extract/demo/demo.yaml
- path: ../../probate-cron-ccd-data-migration-tool/demo/demo.yaml
- path: ../../probate-cron-iron-mountain-extract/demo/demo.yaml
- path: ../../identity/demo.yaml
- path: ../../serviceaccount/demo.yaml
1 change: 1 addition & 0 deletions apps/probate/perftest/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- ../../probate-cron-ccd-data-migration-tool/probate-cron-ccd-data-migration-tool.yaml
- ../../probate-cron-hmrc-extract/probate-cron-hmrc-extract.yaml
- ../../probate-cron-smee-and-ford-extract/probate-cron-smee-and-ford-extract.yaml
- ../../probate-cron-iron-mountain-extract/probate-cron-iron-mountain-extract.yaml
- ../../../rbac/nonprod-role.yaml
- ../../../base/slack-provider/perftest
namespace: probate
Expand Down
17 changes: 17 additions & 0 deletions apps/probate/probate-cron-iron-mountain-extract/aat/aat.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we expected the env directories to ever contain anything bar these env.yaml files? if not can we have them as just env.yaml in the main directory?

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: probate-cron-iron-mountain-extract
spec:
releaseName: probate-cron-iron-mountain-extract
values:
job:
schedule: "0 5 2 * *"
environment:
TASK_NAME: IronMountainExtractTask
args: []
global:
jobKind: CronJob
enableKeyVaults: true
tenantId: "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
environment: aat
17 changes: 17 additions & 0 deletions apps/probate/probate-cron-iron-mountain-extract/demo/demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: probate-cron-iron-mountain-extract
spec:
releaseName: probate-cron-iron-mountain-extract
values:
job:
image: hmctspublic.azurecr.io/probate/back-office:pr-2897-8ad23f9-20250115094341 #{"$imagepolicy": "flux-system:demo-probate-back-office"}
schedule: "0 5 2 * *"
environment:
TRIG: trig-1
global:
jobKind: CronJob
enableKeyVaults: true
tenantId: "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
environment: demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImagePolicy
metadata:
name: probate-cron-iron-mountain-extract
spec:
imageRepositoryRef:
name: probate-cron-iron-mountain-extract
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
name: probate-cron-iron-mountain-extract
spec:
image: hmctspublic.azurecr.io/probate/back-office
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: probate-cron-iron-mountain-extract
spec:
releaseName: probate-cron-iron-mountain-extract
values:
job:
image: hmctspublic.azurecr.io/probate/back-office:prod-6707e09-20250109124038 #{"$imagepolicy": "flux-system:probate-back-office"}
schedule: "0 5 2 * *"
global:
jobKind: CronJob
enableKeyVaults: true
tenantId: "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
environment: perftest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: probate-cron-iron-mountain-extract
spec:
releaseName: probate-cron-iron-mountain-extract
values:
job:
environment:
TASK_NAME: IronMountainExtractTask
VAR_FV2: trigger-2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this var actually do anything for the cron trigger jobs?

useInterpodAntiAffinity: true
image: hmctspublic.azurecr.io/probate/back-office:prod-6707e09-20250109124038 #{"$imagepolicy": "flux-system:probate-back-office"}
schedule: 0 * * * *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if an environment doesn't override this it will run on the hour every hour?

chart:
spec:
chart: probate-cron
version: 0.0.26
sourceRef:
kind: HelmRepository
name: hmctspublic
namespace: flux-system
19 changes: 19 additions & 0 deletions apps/probate/probate-cron-iron-mountain-extract/prod/prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: probate-cron-iron-mountain-extract
spec:
releaseName: probate-cron-iron-mountain-extract
values:
job:
environment:
CCD_GATEWAY_HOST: https://manage-case.platform.hmcts.net
IDAM_SERVICE_HOST: https://idam-api.platform.hmcts.net
PRINTSERVICE_HOST: https://return-case-doc.ccd.platform.hmcts.net
TASK_NAME: IronMountainExtractTask
schedule: "0 5 2 * *"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is 0500 every 2nd of the month? is that what we intend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been updated to be 5 mins past 2am every day
the others are set to match their previous times from the orch service. This issue here came about as the old cron has 6 values not 5

Copy link
Contributor

@tom-saunders-cts tom-saunders-cts Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-syntax is this the cron schedule type being used? if so this is 0500 every 2nd of the month was looking at the old version, ignore

global:
jobKind: CronJob
enableKeyVaults: true
tenantId: "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
environment: prod
2 changes: 2 additions & 0 deletions apps/probate/prod/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
- ../../probate-cron-reactivate-dormant-cases/probate-cron-reactivate-dormant-cases.yaml
- ../../probate-cron-ccd-data-migration-tool/probate-cron-ccd-data-migration-tool.yaml
- ../../probate-cron-hmrc-extract/probate-cron-hmrc-extract.yaml
- ../../probate-cron-iron-mountain-extract/probate-cron-iron-mountain-extract.yaml
- ../../probate-cron-smee-and-ford-extract/probate-cron-smee-and-ford-extract.yaml
- ../../../base/slack-provider/prod
namespace: probate
Expand All @@ -20,6 +21,7 @@ patches:
- path: ../../probate-cron-make-dormant-cases/prod/prod.yaml
- path: ../../probate-cron-hmrc-extract/prod/prod.yaml
- path: ../../probate-cron-reactivate-dormant-cases/prod/prod.yaml
- path: ../../probate-cron-iron-mountain-extract/prod/prod.yaml
- path: ../../probate-cron-smee-and-ford-extract/prod/prod.yaml
- path: ../../probate-cron-ccd-data-migration-tool/prod/prod.yaml
- path: ../../serviceaccount/prod.yaml
Loading