Skip to content
Snippets Groups Projects
Commit 1cb622cb authored by Thomas  MENARD's avatar Thomas MENARD
Browse files

Update README.md

parent 3e506f45
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ RUN pip install --default-timeout=100 --upgrade pip && pip install -r /app/requi ...@@ -68,7 +68,7 @@ RUN pip install --default-timeout=100 --upgrade pip && pip install -r /app/requi
# We add the current content of the git repo in the /app directory # We add the current content of the git repo in the /app directory
ADD . /app ADD . /app
WORKDIR /app WORKDIR /app
RUN rm -rf .gitlab-ci.yml Dockerfile README.md img RUN rm -rf .gitlab-ci.yml Dockerfile README.md img solution
# We use the CMD command to start the gunicorn daemon # We use the CMD command to start the gunicorn daemon
# when we start the container. # when we start the container.
# Note the $PORT variable, we will need to define it when we start the container # Note the $PORT variable, we will need to define it when we start the container
...@@ -333,7 +333,7 @@ metadata: ...@@ -333,7 +333,7 @@ metadata:
name: polls name: polls
spec: spec:
rules: rules:
- host: ${GITLAB_USER_LOGIN}.k8s-dev.pasteur.fr - host: ${GITLAB_USER_LOGIN}-${CI_PROJECT_NAME}.k8s-dev.pasteur.fr
http: http:
paths: paths:
- backend: - backend:
...@@ -398,12 +398,11 @@ deploy: ...@@ -398,12 +398,11 @@ deploy:
stage: deploy stage: deploy
image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image
variables: variables:
NAMESPACE: "<your gitlab user>-django" NAMESPACE: ${GITLAB_USER_LOGIN}-${CI_PROJECT_NAME}
environment: environment:
name: <your gitlab user>-django name: ${GITLAB_USER_LOGIN}-${CI_PROJECT_NAME}
url: https://<your gitlab user>-django.k8s-dev.pasteur.fr url: https://${GITLAB_USER_LOGIN}-${CI_PROJECT_NAME}.k8s-dev.pasteur.fr
script: script:
- yum install -y gettext
- kubectl delete secret registry-gitlab -n ${NAMESPACE} --ignore-not-found=true - kubectl delete secret registry-gitlab -n ${NAMESPACE} --ignore-not-found=true
- kubectl create secret docker-registry -n ${NAMESPACE} registry-gitlab --docker-server=registry-gitlab.pasteur.fr --docker-username=${DEPLOY_USER} --docker-password=${DEPLOY_TOKEN} --docker-email=kubernetes@pasteur.fr - kubectl create secret docker-registry -n ${NAMESPACE} registry-gitlab --docker-server=registry-gitlab.pasteur.fr --docker-username=${DEPLOY_USER} --docker-password=${DEPLOY_TOKEN} --docker-email=kubernetes@pasteur.fr
- envsubst < manifest.yaml | kubectl apply -n ${NAMESPACE} -f - - envsubst < manifest.yaml | kubectl apply -n ${NAMESPACE} -f -
...@@ -412,7 +411,34 @@ deploy: ...@@ -412,7 +411,34 @@ deploy:
- kubectl patch deployment polls -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}" - kubectl patch deployment polls -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
``` ```
### Take a look at your Gitlab CI pipeline
If everything goes well, you should see that you have a pipeline with two steps:
- build
- deploy
You can see the log output by clicking on each one
### Informations available in Gitlab
Gitlab offer a basic set of features in order to manage your Kubernetes web application.
In the `Operations` section on the left panel you are able to view :
* Metrics : It will display basic memory and cpu graphs
* Environements : It will list all the environements you have created (you can have several deploy stages in your `.gitlab-ci.yml` : dev, stagging, production....) and give direcrt access to :
* Website link
* Monitoring
* Open a remote shell on the container
* Error Tracking : If your application implement error tracking on [sentry]: https://sentry.io/ errors are displayed here.
* Serverless : Feature not available here at Pasteur
## What else ? ## What else ?
### Is my deployed application is working ?
Now we want to know if what we have done is working; to do that just go in `Operations/Environements` and click on the first icon on the right hand side, it should open your web app.
You may have a `404 page not found` error, that's unfortunately normal for the first deployement.
### Kubernetes dashboard ### Kubernetes dashboard
#### View your running workload #### View your running workload
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment