Skip to content

Commit

Permalink
[Spider][k8s]Environment cleanup in the affiliation cron
Browse files Browse the repository at this point in the history
Creation of the share folder and cleanup of the environment in the affiliation cron (as it will not need most of the secrets)
  • Loading branch information
cronosnull committed Jun 2, 2020
1 parent cc2e839 commit 4020976
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 58 deletions.
61 changes: 6 additions & 55 deletions k8s/cronjobs/spider-cron-affiliation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
command:
- bash
- -c
- sudo chmod 0777 $AFFILIATION_DIR_LOCATION; sudo chown spider:spider $AFFILIATION_DIR_LOCATION; ls -al $AFFILIATION_DIR_LOCATION
- sudo chmod 0777 $AFFILIATION_DIR_LOCATION; sudo chown 1414:1414 $AFFILIATION_DIR_LOCATION; ls -al $AFFILIATION_DIR_LOCATION
env:
- name: AFFILIATION_DIR_LOCATION
value: /cms_shared/affiliation_dir.json
Expand All @@ -35,68 +35,19 @@ spec:
value: redis://$(REDIS_SERVICE_HOST):$(REDIS_SERVICE_PORT_6379)/1
- name: CELERY_TEST
value: '"true"'
- name: CMS_AMQ_PASSWORD_FILE
value: /cms_secrets/amq-password/amq-password
- name: CMS_AMQ_USERNAME_FILE
value: /cms_secrets/amq-username/amq-username
- name: CMS_ES_CONF_FILE
value: /cms_secrets/es-conf/es-conf
- name: CMS_HTCONDOR_BROKER
value: cms-test-mb.cern.ch
- name: CMS_HTCONDOR_PRODUCER
value: condor-test
- name: CMS_HTCONDOR_TOPIC
value: /topic/cms.jobmon.condor
- name: COLLECTORS_FILE_LOCATION
value: /cms_secrets/collectors/collectors
- name: C_FORCE_ROOT
value: '"true"'
- name: PYTHONPATH
value: /cms-htcondor-es/src:$PYTHONPATH
- name: REQUESTS_CA_BUNDLE
value: /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
- name: SPIDER_CHECKPOINT
value: redis://$(REDIS_CHECKPOINT_SERVICE_HOST):$(REDIS_CHECKPOINT_SERVICE_PORT)/0

volumeMounts:
- mountPath: /cms_secrets/amq-username
name: amq-username
- mountPath: /cms_secrets/amq-password
name: amq-password
- mountPath: /cms_secrets/es-conf
name: es-conf
- mountPath: /cms_secrets/collectors
name: collectors
- mountPath: /cms_shared
name: shared-spider

volumes:
- name: shared-spider
persistentVolumeClaim:
claimName: affilations-cephfs-claim
restartPolicy: Never
securityContext:
fsGroup: 1414
volumes: &spider_volumes
- name: amq-username
secret:
items:
- key: amq-username
path: amq-username
secretName: amq-username
- name: amq-password
secret:
items:
- key: amq-password
path: amq-password
secretName: amq-password
- name: es-conf
secret:
items:
- key: es-conf
path: es-conf
secretName: es-conf
- name: collectors
secret:
items:
- key: collectors
path: collectors
secretName: collectors
- name: shared-spider
emptyDir: {}
fsGroup: 1414
3 changes: 2 additions & 1 deletion k8s/cronjobs/spider-cron-queues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ spec:
path: collectors
secretName: collectors
- name: shared-spider
emptyDir: {}
persistentVolumeClaim:
claimName: affilations-cephfs-claim

5 changes: 3 additions & 2 deletions k8s/deployments/spider-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- worker
resources:
requests:
cpu: 500m
cpu: 100m
memory: 200Mi
limits:
cpu: 2000m
Expand Down Expand Up @@ -102,4 +102,5 @@ spec:
path: collectors
secretName: collectors
- name: shared-spider
emptyDir: {}
persistentVolumeClaim:
claimName: affilations-cephfs-claim
12 changes: 12 additions & 0 deletions k8s/storages/shared_spider.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: affilations-cephfs-claim
namespace: spider
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1G
storageClassName: meyrin-cephfs

0 comments on commit 4020976

Please sign in to comment.