To provide a GitLab bundle with CI/CD pipeline as code setup which executes CI/CD pipeline build steps in Docker containers.
Dependent Eiffel services will be loaded from the Eiffel bundle to provide capability to log/vizualize pipeline activities via Eiffel events.
CI:
- 2 Java Microservices to be imported (ms-frontend & ms-backend) with .gitlab-ci.yml files
- GitLab CI engine with pipeline as code (ms-frontend & ms-backend)
- Pre & post-merge pipelines
- Eiffel event generated
CD:
- CD Pipelines with kubectl deployment via HELM templates, helm charts included in ms-frontend & ms-backend microservices
- Pre-merge CD pipeline (merge request) deployment to dev
- Post-merge CD pipeline (merge request) deployment to stage
- Deployment to production is triggered via manually decision in GiLab GUI
- Immutable Docker Images are used together with microservices config injection to configure microservices in the different K8S target environments
The GitLab bundle is only applicable for deployments in Kubernetes.
The following name is used to refer to this bundle in the easy2use CLI:
GitLab
Component | Service name | User/PSW | Ingress | Info |
---|---|---|---|---|
GitLab | gitlab_gitlab | NA | gitlab-<domainname> | user account needs to be created after startup |
Services Loaded from Eiffel Bundle* | ||||
RabbitMQ (Message Bus) | rabbitmq | myuser / myuser | eiffel-rabbitmq-<namespace>.<domainname> | |
MongoDB & Data Seeding | mongodb mongo_seed |
N/A | N/A | The seed-data folder in Easy2Use contains data that can be seeded into the MongoDB instance. |
RemRem Generate | remrem_generate | N/A | eiffel-remrem-generate-<namespace>.<domainname> | |
RemRem Publish | remrem_publish | N/A | eiffel-remrem-publish-<namespace>.<domainname> | |
Nexus3 | nexus | admin/admin123 | eiffel-nexus3-<namespace>.<domainname> | |
Event Repository REST API | er | N/A | eiffel-er-<namespace>.<domainname> | |
Eiffel Vici | vici | N/A | eiffel-vici-<namespace>.<domainname> |
OS | Minimum Requirements | Preferably | Comments |
---|---|---|---|
Windows 'Docker Toolbox' | ? | 24 GB RAM 50 GB Disk? |
This recommendation is valid when assigning 4 CPU cores to the Docker machine. With less cores less memory would be consumed, but the performance will be worse. The assigned amount of RAM will be allocated to the Docker machine until it is stopped |
Windows 'Docker for Windows' | ? | 20 GB RAM? 50 GB Disk? |
The assigned amount of RAM is dynamically allocated and only used by the Docker machine when needed? |
Linux | 8 GB RAM | 16 GB RAM or more | ~11 GB of RAM will be use under the load. When all containers is loaded, the memory usage is ~6 GB RAM. Computer with 8 GB RAM works, but it will takes some more time to load all containers due to swapping data between memory and hard drive. |
- Docker 18.06 CE or newer
- Docker-Compose 1.22 or newer
- Kubernetes cluster (local or remote)
- Kubectl
- Helm
Eiffel bundle components
See the getting starting page: Getting Started Bundles
This is a schematic picture of the environment:
Print bundle information from Easy2Use CLI:
./easy2use info GitLab
If running in local K8S cluster, minikube or docker-for-windows (windows 10 Hyper-v). Local K8S cluster configuration is required.
- Local K8S cluster (windows 10 Hyper-v) do:
./easy2use configure-local-k8s-hyper-v GitLab -t Kubernetes
- Local K8S cluster (minikube) do:
./easy2use configure-local-k8s-minikube GitLab -t Kubernetes
Gitlab can only be deployed once per cluster (one ingress used).
Note: the GitLab startup can take a few minutes, so be patient!
./easy2use start GitLab -t Kubernetes -n <namespace> -d <basedomainname>
basedomain name is the basedomainname for the K8S cluster, if using local k8s kluster use ex. mylocalkube.com
OBS You need to answer "Y" twice, first for the GitLab bundle installs and then the dependent services from the Eiffel bundle!
Easy2Use list command will both list URLs (ingresses) to the deployed K8S services and user/psw for the services.
./easy2use list GitLab -t Kubernetes -n <namespace>
OBS For included Eiffel components do:
./easy2use list Eiffel -t Kubernetes -n <namespace>
If you running the GitLab bundle on a local K8S cluster, you need to update your ..etc/hosts file with ingresses. To print the ingresses to use do:
-
Local K8S cluster (windows 10 Hyper-v) do:
./easy2use generate-local-hosts-file-hyper-v GitLab -t Kubernetes
-
Local K8S cluster (minikube) do:
./easy2use generate-local-hosts-file-minikube GitLab -t Kubernetes
Update your hosts file with the output from the printout!
- Linux: /etc/hosts
- Windows: C:\Windows\System32\drivers\etc\hosts (OBS you need to open cmd in Administrator mode!)
The deployed applications ms-frontend & ms-backend (GitLab CD pipelines) will not be removed via Easy2Use CLI.
./easy2use remove GitLab -t Kubernetes -n <namespace>
OBS You need to answer "Y" twice, first for the GitLab bundle removals and then the dependent services from the Eiffel bundle!
NA
- Login to GitLab (gitlab.<domainname>)
- Change password
- Click Rigister tab
- Fill-in required text fields
- Click Register
- Click Create a project
- Click Import project tab
- Click git Repo by URL, add Git Repo URL:
- Tick Public
- Click Create project
- Click Settings -> CI/CD -> Expand Secrets variables:
- Print vars to add via:
- ./easy2use list GitLab -t Kubernetes -n
- Click Save variables
- Click New project (plus sign on top bar)
- Click Import project tab
- Click git Repo by URL, add Git Repo URL:
- Tick Public
- Click Create project
- Click Settings -> CI/CD -> Expand Secrets variables:
- Print vars to add via:
- ./easy2use list GitLab -t Kubernetes -n
- Click Save variables
For both ms-fontend and ms-backend do:
-
Click CI/CD -> Run Pipeline -> Create pipeline
After initial piplines are now executed, the piplines will be started when changes are commited & pushed from now on!
- dev (CD only executed for merge-requests)
- ms-frontend-dev-<namespace>.<domainname>/api/greeting
- ms-backend-dev-<namespace>.<domainname>/api/hellobackend
- stage (CD only executed on master branch changes)
- ms-frontend-stage-<namespace>.<domainname>/api/greeting
- ms-backend-stage-<namespace>.<domainname>/api/hellobackend Info: 2 replicas created
- prod (CD only executed when manually triggered in pipeline)
- ms-frontend-prod-<namespace>.<domainname>/api/greeting
- ms-backend-prod-<namespace>.<domainname>/api/hellobackend Info: 3 replicas created
Ingresses visible after deployement in cmd:
- ./easy2use list GitLab -t Kubernetes -n