Skip to content

Commit

Permalink
Merge pull request #86 from ministryofjustice/LCAM-1152
Browse files Browse the repository at this point in the history
LCAM-1152
  • Loading branch information
skasthuri36326 authored Feb 22, 2024
2 parents 8a99161 + f49b01c commit 20b2918
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
- uses: actions/checkout@main
- uses: ministryofjustice/github-actions/code-formatter@main
with:
ignore-files: "docker-compose.override.yml,values-dev.yaml,values-test.yaml,values-staging.yaml,values-uat.yaml,values-prod.yaml,ingress.yaml"
ignore-files: "docker-compose.override.yml,values-dev.yaml,values-test.yaml,values-staging.yaml,values-uat.yaml,values-prod.yaml,ingress.yaml,scheduled-downtime-cronjob.yaml"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{- if .Values.scheduledDowntime.enabled -}}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "laa-crime-evidence.fullname" . }}-shutdown
labels:
{{- include "laa-crime-evidence.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.scheduledDowntime.shutdown }}
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 5
jobTemplate:
spec:
ttlSecondsAfterFinished: 345600 # 4 days
template:
spec:
containers:
- name: cloud-platform-tools
securityContext:
runAsNonRoot: true
runAsUser: 1000
image: ministryofjustice/cloud-platform-tools
args:
- kubectl
- scale
- deploy
- {{ include "laa-crime-evidence.fullname" . }}
- --replicas=0
restartPolicy: OnFailure
serviceAccountName: {{ .Values.scheduledDowntime.serviceAccountName }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "laa-crime-evidence.fullname" . | trunc 43 }}-startup
labels:
{{- include "laa-crime-evidence.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.scheduledDowntime.startup }}
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 5
jobTemplate:
spec:
ttlSecondsAfterFinished: 345600 # 4 days
template:
spec:
containers:
- name: cloud-platform-tools
securityContext:
runAsNonRoot: true
runAsUser: 1000
image: ministryofjustice/cloud-platform-tools
args:
- kubectl
- scale
- deploy
- {{ include "laa-crime-evidence.fullname" . }}
- --current-replicas=0
- --replicas={{ .Values.replicaCount }}
restartPolicy: OnFailure
serviceAccountName: {{ .Values.scheduledDowntime.serviceAccountName }}
{{- end }}
Binary file modified helm_deploy/laa-crime-evidence/values-dev.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-prod.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-staging.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-test.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-uat.yaml
Binary file not shown.

0 comments on commit 20b2918

Please sign in to comment.