Commit 1a387f47 authored by Dipayan Gupta's avatar Dipayan Gupta
Browse files

Setup request and limit for K8 deployment and remove cluster file

parent fec8ca8a
......@@ -2,9 +2,6 @@ image: docker:latest
services:
- docker:dind
before_script:
- export KUBECONFIG=./Kubernetes-cluster.yaml
variables:
DOCKER_DRIVER: overlay
DOCKER_TLS_CERTDIR: ""
......@@ -25,7 +22,7 @@ docker-build-dev:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --build-arg configuration=dev --build-arg basePath=/ena/dev/submit/webin/ .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
docker-build-test:
stage: package
......@@ -38,7 +35,7 @@ docker-build-test:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --build-arg configuration=test --build-arg basePath=/ena/submit/webin/ .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
docker-build-prod:
stage: package
......@@ -52,7 +49,7 @@ docker-build-prod:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG --build-arg configuration=production --build-arg basePath=/ena/submit/webin/ .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
k8s-deploy-dev:
image: dtzar/helm-kubectl
......@@ -64,11 +61,14 @@ k8s-deploy-dev:
- triggers
script:
- sed -i s#%DOCKER_IMAGE%#$CI_REGISTRY_IMAGE\:$CI_COMMIT_TAG#g Kubernetes-dev-deploy.yaml
- kubectl delete secret gitlab --namespace=ena-dev
- kubectl create secret docker-registry gitlab --docker-server=$CI_REGISTRY --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL --namespace=ena-dev
- kubectl config set-cluster ena-cluster --server="${K8_HX_SERVER}"
- kubectl config set clusters.ena-cluster.certificate-authority-data ${K8_HX_CERTIFICATE_AUTHORITY_DATA}
- kubectl config set-credentials ena-user --token="${K8_HX_CREDENTIALS}"
- kubectl config set-context ena-context --cluster=ena-cluster --user=ena-user
- kubectl config use-context ena-context
- kubectl apply -f Kubernetes-dev-deploy.yaml --namespace=ena-dev
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
when: manual
k8s-deploy-test:
......@@ -80,11 +80,14 @@ k8s-deploy-test:
- triggers
script:
- sed -i s#%DOCKER_IMAGE%#$CI_REGISTRY_IMAGE\:$CI_COMMIT_TAG#g Kubernetes-test-deploy.yaml
- kubectl delete secret gitlab --namespace=ena-test
- kubectl create secret docker-registry gitlab --docker-server=$CI_REGISTRY --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL --namespace=ena-test
- kubectl config set-cluster ena-cluster --server="${K8_HX_SERVER}"
- kubectl config set clusters.ena-cluster.certificate-authority-data ${K8_HX_CERTIFICATE_AUTHORITY_DATA}
- kubectl config set-credentials ena-user --token="${K8_HX_CREDENTIALS}"
- kubectl config set-context ena-context --cluster=ena-cluster --user=ena-user
- kubectl config use-context ena-context
- kubectl apply -f Kubernetes-test-deploy.yaml --namespace=ena-test
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
when: manual
k8s-deploy-prod:
......@@ -97,9 +100,12 @@ k8s-deploy-prod:
- triggers
script:
- sed -i s#%DOCKER_IMAGE%#$CI_REGISTRY_IMAGE\:$CI_COMMIT_TAG#g Kubernetes-prod-deploy.yaml
- kubectl delete secret gitlab --namespace=ena-prod
- kubectl create secret docker-registry gitlab --docker-server=$CI_REGISTRY --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL --namespace=ena-prod
- kubectl config set-cluster ena-cluster --server="${K8_HX_SERVER}"
- kubectl config set clusters.ena-cluster.certificate-authority-data ${K8_HX_CERTIFICATE_AUTHORITY_DATA}
- kubectl config set-credentials ena-user --token="${K8_HX_CREDENTIALS}"
- kubectl config set-context ena-context --cluster=ena-cluster --user=ena-user
- kubectl config use-context ena-context
- kubectl apply -f Kubernetes-prod-deploy.yaml --namespace=ena-prod
tags:
- ena-dcap-gitlab-runner
- ena-dcap-gitlab-runner
when: manual
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN3akNDQWFxZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFTTVJBd0RnWURWUVFERXdkcmRXSmwKTFdOaE1CNFhEVEl3TURReU9URXhOVFUwTjFvWERUTXdNRFF5TnpFeE5UVTBOMW93RWpFUU1BNEdBMVVFQXhNSAphM1ZpWlMxallUQ0NBU0l3RFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQUtxeDUzaDczbFZsCnZSSmZFdUZCc2djQ0hNODhrUGpXdFRpMm9VdEUxcUtIQytQQWdVS1ozWmdBNkRKa0NvS21XU1J4L0xDZUFOdDkKR20xRFkzVjNjWkcyTFNhTlpnRlBCUE5rV3FzMW1sR0E5MmY4UDdzSEtaRU5nRjhmWWdKVlN4UjZNd3lIZVZkMwpiWm5tMGtsNTNNS3k4SU44dUs3bTdMdWFnQnpYeDUxN0xNa3hCWWdYZHRYR1c0VWp3Rzk1RnZxdmtOYUNkUitjCkxrZzZJNHN1SFo0WHNRSDJsNkRWWk1XeVdjTVhJK0JOcUZhcGZQWkNrTnlTbmpEUW1SaXl4dThESmFJNkJqa3EKc3BwbnNlRElZWHpkbEpKQ3ZBMTBXeUQzaTF2SC9YWWJMeFkrS3FwWmY0TG9zc1FYYnRYR3dJb0FhMloyWUE5SApENlpXYzAxenAzTUNBd0VBQWFNak1DRXdEZ1lEVlIwUEFRSC9CQVFEQWdLa01BOEdBMVVkRXdFQi93UUZNQU1CCkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBSm1WUEV2czdiTnNueXVQRUZUZURlMHBhUnZNVnBCaTdiY2IKUHZQWG1nWjd1Rlo4MFQxQm1RTmppRmFwN2UvbDdqejFSR2RTUk9uSnVjWGNmcGkreTkxQTZWWllTOWJkU3g2cgpUNXBneEZtb2hwdTE5RHNqWDcrbHRtamdTam85QWltL2NCV25rdnBBcDdWQmxUdUI0UHp0RVYzSzdLUXp4QU5aCkk3aXI2K2FHeHN1U0FBVkxvTmJmSlo1ZHRZT1J0UWxNMEU4MUhvZk1XT0xKeGZjUjVGdGVHbnVmdCtwV1dubU0KQjhBYlpMYUhxYURndkpkTlFqaFArVjhJUmpkWVBPRGE1SDdLbWFSQ0lvbVVaOHMwVXhiakovTFJiUmVOb3E1bwo2S0k3VWwraDk0VlFIRlpjR2xFSXBRU0NQTW14eHdZRDh2VXlERlg1cWpMOC9Ta3ZDaDQ9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://hx-wp-webadmin-17.wp-k8s.ebi.ac.uk:30030
name: hx-wp-webadmin-17
contexts:
- context:
cluster: hx-wp-webadmin-17
user: team-admin-hx-wp-webadmin-17
name: team-admin-hx-wp-webadmin-17
current-context: team-admin-hx-wp-webadmin-17
kind: Config
preferences: {}
users:
- name: team-admin-hx-wp-webadmin-17
user:
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6InRlYW0tYWRtaW4tdG9rZW4tbW52azgiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoidGVhbS1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6Ijc1ZDI2OTE5LTVjMDItNDFhNC1iNDliLWUzNmVlYjdkODMyOSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OnRlYW0tYWRtaW4ifQ.XffZYtJjxdWBJEiV-gse8Wkjvfc__h5pNBEbqzmQFkN8iDY-cIryBkLZ_hs_G4mzXrzQrmZf8AxQc9MAfrTuEtWGJKvXYA1YIEkkcrGwrpItAjLIiuCcAtbmJWGixUVWsMBnyuMpqGYloO1WYFOQDHaypU_rMV_tslav4YiOWEicU3lRC2jaOO6-a-fKPpTrYMT1lDVqwQmUeDbidpN_cjwijDTNwG2TSP91V8fwzJ56mBPJQgbNufEHFASoVo9lP30ipQjzusSwO5sEPbliCBL2Ms-9pfTQVtfQFYChDJLjfhoV2g8brK0rJBLlRD5ir0f9KIcY1kXuv8k4Fd-2UA
......@@ -15,6 +15,11 @@ spec:
containers:
- name: webin-portal
image: %DOCKER_IMAGE%
resources:
requests:
memory: "2Gi"
limits:
memory: "2Gi"
ports:
- containerPort: 80
# - containerPort: 443
......
......@@ -15,9 +15,14 @@ spec:
containers:
- name: webin-portal
image: %DOCKER_IMAGE%
resources:
requests:
memory: "2Gi"
limits:
memory: "2Gi"
ports:
- containerPort: 80
# - containerPort: 443
# - containerPort: 443
imagePullSecrets:
- name: gitlab
---
......
......@@ -15,9 +15,14 @@ spec:
containers:
- name: webin-portal
image: %DOCKER_IMAGE%
resources:
requests:
memory: "2Gi"
limits:
memory: "2Gi"
ports:
- containerPort: 80
# - containerPort: 443
# - containerPort: 443
imagePullSecrets:
- name: gitlab
---
......
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