diff --git a/README.md b/README.md index 157f0b6bd00cf792924ca6cb7121a92244e608e5..fef6372cbbc70eefce5838d5e00da12fba8ac0fc 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ This is the directory structure * `/kubernetes` - Kubernetes files * `/kubernetes/helm` - Chart Directory. Refer to https://github.com/kubernetes/helm/blob/master/docs/charts.md#the-chart-file-structure * `/kubernetes/yaml` - Useful for tests, but helm is a more flexible approach - -# Requirements +# Introduction +# Prerequisites * Kubernetes cluster @@ -38,8 +38,14 @@ This is the directory structure # How to use it ## Workflow -First of all, check if a docker image already exist. -If exist, pull it, otherwise you neeed to build one. +First of all, check if a docker image already exists. +If it exist, pull, otherwise, you need to build one. +If necessary create a [personal token](https://gitlab.scientificnet.org/profile/personal_access_tokens) and login into GitLab Registry. + +```console +docker login gitlab.scientificnet.org:4567 +``` + ### Use existing Docker image ```console docker image ls -a gitlab.scientificnet.org:4567/commul/dspace/* @@ -53,4 +59,71 @@ docker pull gitlab.scientificnet.org:4567/commul/dspace/<my_image>:<my tag> ```console docker build -t gitlab.scientificnet.org:4567/commul/dspace/<my_image>:<my tag> -f Dockerfile.XX . docker push gitlab.scientificnet.org:4567/commul/dspace/<my_image>:<my tag> +``` + +# Installation +Provide gitlab credentials + +```console +$ kubectl -n dspace-dev create -f gitlab-scientificnet-org-registry.yaml +``` +```console +$ kubectl -n dspace-dev create -f rbd-secret.yaml +``` +## PostgreSQL +To install PostgreSQL, we need some passwords, so we need Kubernetes secrets + +```console +$ kubectl -n dspace-dev create -f postgresql-secret.yaml +secret "dspace-postgresql" created +``` + +```console +$ kubectl -n dspace-dev create -f dspace-secrets.yaml +secret "dspace-secrets" created +``` + +```console +$ kubectl -n dspace-dev get secrets +NAME TYPE DATA AGE +ceph-rbd-secret kubernetes.io/rbd 1 14m +default-token-c1pd4 kubernetes.io/service-account-token 3 4d +dspace-postgresql Opaque 1 1h +dspace-secrets Opaque 1 1m +gitlab-scientificnet-org-registry kubernetes.io/dockerconfigjson 1 46m +``` + + + +Next, create a RBD Claim +```console +$ kubectl -n dspace-dev create -f postgresql-pvc.yaml +persistentvolumeclaim "dspace-postgresql" created + +$ kubectl -n dspace-dev get pvc +NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE +dspace-postgresql Bound pvc-610c358d-a518-11e7-b21c-b60483de6a40 8Gi RWO auto 2s +``` + +Ok, now we are ready to deploy our PostgreSQL! +```console +$ kubectl -n dspace-dev create -f postgresql.yaml + +$ kubectl -n dspace-dev get po +NAME READY STATUS RESTARTS AGE +dspace-postgresql-1806947503-cj077 0/1 ContainerCreating 0 2s + +$ kubectl -n dspace-dev get po +NAME READY STATUS RESTARTS AGE +dspace-postgresql-1806947503-qw8q4 0/1 Running 0 9s + +$ kubectl -n dspace-dev get po +NAME READY STATUS RESTARTS AGE +dspace-postgresql-1806947503-qw8q4 1/1 Running 0 46s +``` + +when the container will be in running +```console +$ kubectl -n dspace-dev exec -it dspace-postgresql-1806947503-qw8q4 bash +root@dspace-postgresql-1806947503-qw8q4:/# ``` \ No newline at end of file