diff --git a/infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml b/infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml index 2227e976..d104222d 100644 --- a/infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml +++ b/infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml @@ -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 \ No newline at end of file +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 \ No newline at end of file