Repository navigation
feat(deploy): run the portal retention purge as a daily CronJob #620
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Runs the portal retention purge once a day (server/README.md, "Retention purge | ||
| # job"), with the release's own image: kustomization.yaml copies the WebApp's | ||
| # pinned image into it. It reads the migration Job's Secret as the migration | ||
| # role, and its pods carry the migration Job's label, so the platform's migration | ||
| # network policy is the only path to the database. A failed run deletes nothing | ||
| # and the next day's run tries again. | ||
| apiVersion: batch/v1 | ||
| kind: CronJob | ||
| metadata: | ||
| name: business-site-portal-retention | ||
| namespace: business-site | ||
| spec: | ||
| schedule: "17 3 * * *" | ||
| timeZone: Europe/Copenhagen | ||
| concurrencyPolicy: Forbid | ||
| startingDeadlineSeconds: 3600 | ||
| successfulJobsHistoryLimit: 1 | ||
| failedJobsHistoryLimit: 3 | ||
| jobTemplate: | ||
| spec: | ||
| backoffLimit: 0 | ||
| activeDeadlineSeconds: 300 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: business-site-portal-migration | ||
| app.kubernetes.io/component: retention-purge | ||
| spec: | ||
| restartPolicy: Never | ||
| automountServiceAccountToken: false | ||
| enableServiceLinks: false | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 65532 | ||
| runAsGroup: 65532 | ||
| fsGroup: 65532 | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - name: purge | ||
| args: | ||
| - --retention-purge | ||
| - --migration-database-projection | ||
| - /run/portal-migration/database-url | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
| memory: 32Mi | ||
| limits: | ||
| cpu: 500m | ||
| memory: 128Mi | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| volumeMounts: | ||
| - name: migration | ||
| mountPath: /run/portal-migration | ||
| readOnly: true | ||
| - name: tmp | ||
| mountPath: /tmp | ||
| volumes: | ||
| - name: migration | ||
| secret: | ||
| secretName: business-site-portal-db-migration | ||
| defaultMode: 0400 | ||
| items: | ||
| - key: database-url | ||
| path: database-url | ||
| - key: ca.crt | ||
| path: ca.crt | ||
| # As for the migration Job: the CA copy needs a sticky temp directory, | ||
| # and only a memory emptyDir is 1777. | ||
| - name: tmp | ||
| emptyDir: | ||
| medium: Memory | ||
| sizeLimit: 1Mi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.