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

Update README

parent 3d8524c0
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,10 @@ In order to deploy this app on Kubernetes we will need to complete the following
### Step by step guide
1. Create Docker Registry Access Token
One of the many Gitlab feature is the ability to host docker images.
In order to permit Kubernetes to fetch those images, you need to provide an access token.
Please follow the following steps in order to create the access token :
![alt text](img/access_token_1.png)
![alt text](img/access_token_2.png)
......@@ -30,13 +34,20 @@ In order to deploy this app on Kubernetes we will need to complete the following
2. Declare the docker registry access token in variables
We will reuse the previously created access token in order to reuse them in the Continuous Integration pipeline.
To do that we will store them in CI variables that we will use during our CI pipeline.
> This will prevent from storing credentials in the Git repository. Note that only owners of the project can access to those variables.
![alt text](img/access_token_4.png)
![alt text](img/access_token_5.png)
![alt text](img/access_token_6.png)
3. Create the Dockerfile
In the root directory of your project create `Dockerfile` file and fill it like the following :
```docker
# https://docs.docker.com/engine/reference/builder/
# FROM refer the image where we start from
......@@ -70,9 +81,12 @@ CMD gunicorn -b :$PORT mysite.wsgi
4. Setup Gitlab CI
```yaml
image: docker:latest
At the root of your git repository create a `.gitlab-ci.yaml` file.
We will use a special docker image which contain the docker binary.
We will attach to the running docker daemon in order to build the image.
```yaml
stages:
- build
- deploy
......@@ -84,6 +98,7 @@ variables:
DOCKER_HOST: tcp://localhost:2375
build:
image: docker:latest
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......@@ -94,6 +109,11 @@ build:
- k8s
```
Save, commit and push; you should be abble to see your first running pipeline
![alt text](img/ci_pipeline.png)
Once succesfully completed, you can see the docker image in the `Registry`section on the left pane.
5. Create manifest yaml file
* PostgreSQL Server
* Persistent Volume Claim
......
img/ci_pipeline.png

113 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment