Commit 9e680b64 authored by David Mendez's avatar David Mendez

Add k8s deployment file

parent 36a80e0a
......@@ -149,8 +149,8 @@ deploy_to_staging:
- kubectl config use-context ${CHEMBL_NS_STAGING}
- echo ${CHEMBL_NS_STAGING} ${KUBE_URL_HX} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
- kubectl get pods -n ${CHEMBL_NS_STAGING}
- kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_STAGING} --from-file=RUN_CONFIG.yml=${CONFIG_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl apply -f -
- kubectl create secret generic ${GUNICORN_CONFIG_SECRET_NAME_STAGING} --from-file=GUNICORN_CONFIG.py=${CONFIG_GUNICORN_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl apply -f -
- kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_STAGING} --from-file=RUN_CONFIG.yml=${CONFIG_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl replace -f -
- kubectl create secret generic ${GUNICORN_CONFIG_SECRET_NAME_STAGING} --from-file=GUNICORN_CONFIG.py=${CONFIG_GUNICORN_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl replace -f -
- cat ${CONFIG_STAGING_FILE_PATH}
- cat ${CONFIG_GUNICORN_STAGING_FILE_PATH}
# - sed -i "s~<NAMESPACE>~${CHEMBL_NS_STAGING}~" k8s-deployment.yaml
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: es-subset-generator
namespace: <NAMESPACE>
spec:
replicas: <NUM_REPLICAS>
selector:
matchLabels:
app: es-subset-generator
template:
metadata:
labels:
app: es-subset-generator
spec:
containers:
- name: es-subset-generator-api
image: <SERVER_IMAGE_TAG>
imagePullPolicy: Always
resources:
limits:
cpu: <CPU_LIMIT>
requests:
cpu: <CPU_REQUESTED>
volumeMounts:
- name: run-config
mountPath: '/etc/run_config/'
readOnly: true
- name: gunicorn-config
mountPath: '/etc/gunicorn_config/'
readOnly: true
- name: es-subset-generator-tasks-daemon
image: <STATUS_DAEMON_IMAGE_TAG>
imagePullPolicy: Always
resources:
limits:
cpu: <CPU_LIMIT>
requests:
cpu: <CPU_REQUESTED>
volumeMounts:
- name: run-config
mountPath: '/etc/run_config/'
readOnly: true
- name: gunicorn-config
mountPath: '/etc/gunicorn_config/'
readOnly: true
volumes:
- name: run-config
secret:
secretName: <RUN_CONFIG_SECRET_NAME>
- name: gunicorn-config
secret:
secretName: <GUNICORN_CONFIG_SECRET_NAME>
---
apiVersion: v1
kind: Service
metadata:
name: es-subset-generator
namespace: <NAMESPACE>
spec:
type: NodePort
selector:
app: es-subset-generator
ports:
- port: 5000
targetPort: 5000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment