-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
5ee1862
commit d8fc4e7
Showing
35 changed files
with
830 additions
and
285 deletions.
There are no files selected for viewing
This file contains 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
15 changes: 15 additions & 0 deletions
15
...es/schulcloud-server-core/templates/data-deletion-trigger-failed-cronjob-configmap.yml.j2
This file contains 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,15 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: {{ NAMESPACE }} | ||
name: data-deletion-trigger-failed-cronjob-configmap | ||
labels: | ||
app: data-deletion-trigger-failed-cronjob | ||
data: | ||
NODE_OPTIONS: "--max-old-space-size=3072" | ||
NEST_LOG_LEVEL: "error" | ||
EXIT_ON_ERROR: "true" | ||
SC_DOMAIN: "{{ DOMAIN }}" | ||
FEATURE_PROMETHEUS_METRICS_ENABLED: "true" | ||
ETHERPAD__PAD_URI: "https://{{ DOMAIN }}/etherpad/p" | ||
|
111 changes: 111 additions & 0 deletions
111
ansible/roles/schulcloud-server-core/templates/data-deletion-trigger-failed-cronjob.yml.j2
This file contains 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,111 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: data-deletion-trigger-failed | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
app.kubernetes.io/name: data-deletion-trigger-failed | ||
app.kubernetes.io/component: data-deletion | ||
app.kubernetes.io/managed-by: ansible | ||
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }} | ||
name: data-deletion-trigger-failed-cronjob | ||
spec: | ||
concurrencyPolicy: Forbid | ||
schedule: "{{ SERVER_DATA_DELETION_TRIGGER_FAILED_CRONJOB_SCHEDULE|default("@daily", true) }}" | ||
jobTemplate: | ||
metadata: | ||
labels: | ||
app: data-deletion-trigger-failed | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
app.kubernetes.io/name: data-deletion-trigger-failed | ||
app.kubernetes.io/component: data-deletion | ||
app.kubernetes.io/managed-by: ansible | ||
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }} | ||
spec: | ||
template: | ||
spec: | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
runAsNonRoot: true | ||
containers: | ||
- name: data-deletion-trigger-failed-cronjob | ||
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
envFrom: | ||
- configMapRef: | ||
name: data-deletion-trigger-failed-cronjob-configmap | ||
- secretRef: | ||
name: admin-api-client-secret | ||
- secretRef: | ||
name: api-files-secret | ||
command: ['/bin/sh', '-c'] | ||
args: ['npm run nest:start:deletion-console -- execution trigger -f true'] | ||
resources: | ||
limits: | ||
cpu: {{ API_CPU_LIMITS|default("2000m", true) }} | ||
memory: {{ API_MEMORY_LIMITS|default("2Gi", true) }} | ||
requests: | ||
cpu: {{ API_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }} | ||
restartPolicy: OnFailure | ||
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %} | ||
affinity: | ||
podAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 20 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/part-of | ||
operator: In | ||
values: | ||
- schulcloud-verbund | ||
topologyKey: "kubernetes.io/hostname" | ||
namespaceSelector: {} | ||
- weight: 10 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: git.repo | ||
operator: In | ||
values: | ||
- {{ SCHULCLOUD_SERVER_REPO_NAME }} | ||
topologyKey: "kubernetes.io/hostname" | ||
namespaceSelector: {} | ||
- weight: 10 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: git.branch | ||
operator: In | ||
values: | ||
- {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
topologyKey: "kubernetes.io/hostname" | ||
namespaceSelector: {} | ||
- weight: 10 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/version | ||
operator: In | ||
values: | ||
- {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
topologyKey: "kubernetes.io/hostname" | ||
namespaceSelector: {} | ||
{% endif %} | ||
metadata: | ||
labels: | ||
app: data-deletion-trigger-failed | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
app.kubernetes.io/name: data-deletion-trigger-failed | ||
app.kubernetes.io/component: data-deletion | ||
app.kubernetes.io/managed-by: ansible | ||
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }} |
12 changes: 5 additions & 7 deletions
12
...r/src/modules/deletion-console/builder/trigger-deletion-execution-options.builder.spec.ts
This file contains 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
4 changes: 2 additions & 2 deletions
4
...server/src/modules/deletion-console/builder/trigger-deletion-execution-options.builder.ts
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { TriggerDeletionExecutionOptions } from '../interface'; | ||
|
||
export class TriggerDeletionExecutionOptionsBuilder { | ||
static build(limit: number): TriggerDeletionExecutionOptions { | ||
return { limit }; | ||
static build(limit: number, runFailed: boolean): TriggerDeletionExecutionOptions { | ||
return { limit, runFailed }; | ||
} | ||
} |
This file contains 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 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 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 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
3 changes: 2 additions & 1 deletion
3
...er/src/modules/deletion-console/interface/trigger-deletion-execution-options.interface.ts
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export interface TriggerDeletionExecutionOptions { | ||
limit: number; | ||
limit: string | number; | ||
runFailed: string | boolean; | ||
} |
Oops, something went wrong.