-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
dbed067
commit f08eb6c
Showing
1 changed file
with
111 additions
and
76 deletions.
There are no files selected for viewing
187 changes: 111 additions & 76 deletions
187
infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml
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,76 +1,111 @@ | ||
# apiVersion: batch/v1 | ||
# kind: CronJob | ||
# metadata: | ||
# name: iam-reana-sync | ||
# namespace: reana | ||
# spec: | ||
# schedule: "0 1 * * *" # every day at 1 am | ||
# concurrencyPolicy: Forbid | ||
# successfulJobsHistoryLimit: 1 | ||
# jobTemplate: | ||
# spec: | ||
# template: | ||
# spec: | ||
# restartPolicy: OnFailure | ||
# containers: | ||
# - name: iam-sync | ||
# image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7 # to be changed to correct version | ||
|
||
# env: | ||
|
||
# # needed to poll the iam service | ||
|
||
# - name: IAM_SERVER | ||
# value: "https://iam-escape.cloud.cnaf.infn.it" | ||
# - name: CLIENT_SECRET | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-vre-iam-client | ||
# key: client_secret | ||
# - name: CLIENT_ID | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-vre-iam-client | ||
# key: client_id | ||
|
||
# # needed to add users | ||
# - name: REANA_ADMIN_TOKEN | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-admin-access-token | ||
# key: ADMIN_ACCESS_TOKEN | ||
|
||
# # needed for correct DB connection - internals of reana | ||
# - name: REANA_SECRET_KEY | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-secrets | ||
# key: REANA_SECRET_KEY | ||
|
||
# # to connect to DB | ||
# - name: REANA_DB_NAME | ||
# value: "reana" | ||
# - name: REANA_DB_PORT | ||
# value: "6600" | ||
# - name: REANA_DB_HOST | ||
# value: "dbod-vre.cern.ch" | ||
# - name: REANA_DB_USERNAME | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-db | ||
# key: user | ||
# - name: REANA_DB_PASSWORD | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: reana-db | ||
# key: password | ||
|
||
# tty: true | ||
# imagePullPolicy: Always | ||
# command: | ||
# - /bin/sh | ||
# - -c | ||
# - date; echo Hello from iam-reana-sync container; | ||
# flask reana-admin user-list --admin-access-token $REANA_ADMIN_TOKEN; | ||
# python3 /home/generate_email_list.py; | ||
# python3 /home/add_reana_users.py | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: iam-reana-sync | ||
namespace: reana | ||
spec: | ||
schedule: "0 1 * * *" # every day at 1 am | ||
concurrencyPolicy: Forbid | ||
successfulJobsHistoryLimit: 1 | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: iam-sync | ||
image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7 # to be changed to correct version | ||
env: | ||
# needed to poll the iam service | ||
- name: IAM_SERVER | ||
value: "https://iam-escape.cloud.cnaf.infn.it" | ||
- name: CLIENT_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-vre-iam-client | ||
key: client_secret | ||
- name: CLIENT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-vre-iam-client | ||
key: client_id | ||
# needed to add users | ||
- name: REANA_ADMIN_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-admin-access-token | ||
key: ADMIN_ACCESS_TOKEN | ||
# needed for correct DB connection - internals of reana | ||
- name: REANA_SECRET_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-secrets | ||
key: REANA_SECRET_KEY | ||
# to connect to DB | ||
- name: REANA_DB_NAME | ||
value: "reana" | ||
- name: REANA_DB_PORT | ||
value: "6600" | ||
- name: REANA_DB_HOST | ||
value: "dbod-vre.cern.ch" | ||
- name: REANA_DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-db | ||
key: user | ||
- name: REANA_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-db | ||
key: password | ||
tty: true | ||
imagePullPolicy: Always | ||
command: | ||
- /bin/sh | ||
- -c | ||
- date; echo Hello from iam-reana-sync container; | ||
flask reana-admin user-list --admin-access-token $REANA_ADMIN_TOKEN; | ||
python3 /home/generate_email_list.py; | ||
python3 /home/add_reana_users.py | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: reana-client | ||
namespace: reana | ||
spec: | ||
containers: | ||
- name: rucio-client | ||
image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7 | ||
imagePullPolicy: Always | ||
command: ["sleep","3600"] | ||
env: | ||
# needed to add users | ||
- name: REANA_ADMIN_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-admin-access-token | ||
key: ADMIN_ACCESS_TOKEN | ||
# needed for correct DB connection - internals of reana | ||
- name: REANA_SECRET_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-secrets | ||
key: REANA_SECRET_KEY | ||
# to connect to DB | ||
- name: REANA_DB_NAME | ||
value: "reana" | ||
- name: REANA_DB_PORT | ||
value: "6600" | ||
- name: REANA_DB_HOST | ||
value: "dbod-vre.cern.ch" | ||
- name: REANA_DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-db | ||
key: user | ||
- name: REANA_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: reana-db | ||
key: password |