-
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.
- Loading branch information
Showing
973 changed files
with
11,241 additions
and
5,936 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
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
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,3 @@ | ||
SERVER_VIDIS_SYNC_CRONJOB_SCHEDULE: "20 4 * * *" | ||
VIDIS_API_CLIENT_BASE_URL: "" | ||
VIDIS_SYNC_REGION: "" |
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,9 @@ | ||
galaxy_info: | ||
role_name: media-licenses | ||
author: Schul-Cloud Verbund | ||
description: media-licenses role for the vidis synchronization purposes | ||
company: Schul-Cloud Verbund | ||
license: license (AGPLv3) | ||
min_ansible_version: 2.8 | ||
galaxy_tags: [] | ||
dependencies: [] |
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,17 @@ | ||
- name: media licenses sync CronJob ConfigMap | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: vidis-sync-cronjob-configmap.yml.j2 | ||
state: "{{ 'present' if WITH_MEDIA_LICENSES is defined and WITH_MEDIA_LICENSES|bool else 'absent'}}" | ||
tags: | ||
- configmap | ||
|
||
- name: media licenses sync CronJob | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: vidis-sync-cronjob.yml.j2 | ||
state: "{{ 'present' if WITH_MEDIA_LICENSES is defined and WITH_MEDIA_LICENSES|bool else 'absent'}}" | ||
tags: | ||
- cronjob |
13 changes: 13 additions & 0 deletions
13
ansible/roles/media-licenses/templates/vidis-sync-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,13 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: {{ NAMESPACE }} | ||
name: vidis-sync-cronjob-configmap | ||
labels: | ||
app: vidis-sync-cronjob | ||
data: | ||
NODE_OPTIONS: "--max-old-space-size=3072" | ||
NEST_LOG_LEVEL: "error" | ||
EXIT_ON_ERROR: "true" | ||
VIDIS_API_CLIENT_BASE_URL: "{{ VIDIS_API_CLIENT_BASE_URL }}" | ||
VIDIS_SYNC_REGION: "{{ VIDIS_SYNC_REGION }}" |
97 changes: 97 additions & 0 deletions
97
ansible/roles/media-licenses/templates/vidis-sync-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,97 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: vidis-sync-cronjob | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
app.kubernetes.io/name: vidis-sync-cronjob | ||
app.kubernetes.io/component: sync | ||
app.kubernetes.io/managed-by: ansible | ||
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }} | ||
name: vidis-sync-cronjob | ||
spec: | ||
schedule: {{ SERVER_VIDIS_SYNC_CRONJOB_SCHEDULE|default("20 4 * * *", true) }} | ||
concurrencyPolicy: Forbid | ||
jobTemplate: | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: vidis-sync-cronjob | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/version: {{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
app.kubernetes.io/name: vidis-sync-cronjob | ||
app.kubernetes.io/component: sync | ||
app.kubernetes.io/managed-by: ansible | ||
git.branch: {{ SCHULCLOUD_SERVER_BRANCH_NAME }} | ||
git.repo: {{ SCHULCLOUD_SERVER_REPO_NAME }} | ||
spec: | ||
containers: | ||
- name: vidis-sync-cronjob | ||
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
envFrom: | ||
- configMapRef: | ||
name: api-configmap | ||
- secretRef: | ||
name: api-secret | ||
- configMapRef: | ||
name: vidis-sync-cronjob-configmap | ||
command: ['/bin/sh','-c'] | ||
args: ['npm run nest:start:sync:vidis'] | ||
resources: | ||
limits: | ||
cpu: {{ MEDIA_ACTIVATION_CPU_LIMITS|default("2000m", true) }} | ||
memory: {{ MEDIA_ACTIVATION_MEMORY_LIMITS|default("2Gi", true) }} | ||
requests: | ||
cpu: {{ MEDIA_ACTIVATION_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ MEDIA_ACTIVATION_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 %} | ||
|
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
Oops, something went wrong.