- Creating Vagrantfile which creates three virtual machine with the following configuration:
- docker
- Box:
shekeriev/debian-11
- Host names:
containers.do1.exam
- Private network with dedicated IPs:
192.168.99.202
- Provisioning via provided bash scripts:
add-hosts.sh
,install_docker.sh
,setup_docker.sh
,setup_gitea.sh
andinstall_node_exporter.sh
- Shared folder configuration:
shared-files/
->/vagrant
- Set virtual machine memory size:
3072
- Box:
- jenkins
- Box:
shekeriev/debian-11
- Host names:
pipelines.do1.exam
- Private network with dedicated IPs:
192.168.99.201
- Provisioning via provided bash scripts:
add-hosts.sh
,install_jenkins.sh
,setup_jenkins.sh
andinstall_node_exporter.sh
- Shared folder configuration:
shared-files/
->/vagrant
- Set virtual machine memory size:
3072
- Box:
- monitoring
- Box:
shekeriev/debian-11
- Host names:
monitoring.do1.exam
- Private network with dedicated IPs:
192.168.99.203
- Provisioning via provided bash scripts:
add-hosts.sh
,install_docker.sh
andinstall_prometheus.sh
- Shared folder configuration:
shared-files/
->/vagrant
- Set virtual machine memory size:
3072
- Box:
- Create after trigger event to create an index pattern in Kibana using REST API
- Create another after trigger event to open default browser to view created Kibana dataviews at
http://192.168.34.201:5601/app/management/kibana/dataViews
- docker
- Sequence of actions:
- Install docker on docker machine:
- Change Docker configuration to expose Prometheus metrics by copying
daemon.json
to/etc/docker/
folder
- Change Docker configuration to expose Prometheus metrics by copying
- Install and setup gitea via docker compose using the following configuration file
docker-compose.yml
- Setup gitea with following data:
- GITEA__server__DOMAIN=[
192.168.99.202
] - GITEA__server__ROOT_URL=[
http://192.168.99.202:3000
] - GITEA__webhook__ALLOWED_HOST_LIST=[
192.168.99.0/24
]
- GITEA__server__DOMAIN=[
- Clone the following repository
shekeriev/fun-facts
- Copy local files to repository folder and push to gitea public project with name:
exam
- Add webhook for the
exam
project
- Setup gitea with following data:
- Install and run Node Exporter on docker VM
- Install Jenkins and needed components (like java-17)
- Setup Jenkins
- Set credentials for docker user: needed to push images to
docker hub
- Configure jenkins via configuration scripts to automate the process like creating admin account, installing needed plugins and etc.
- Download Jenkins CLI
- Create vagrant credentials
- Create Docker Hub credentials
- Add slave node
- Add and build the exam job
- Set credentials for docker user: needed to push images to
- Install and run Node Exporter on jenkins VM
- Install docker on monitoring VM
- Install and setup Prometheus and Grafana via docker compose using the following configuration file
docker-compose.yml
- Copy Prometheus custom configuration file
prometheus.yml
to /tmp folder- scrape metrics configuration for two job [
docker
] and [node-exporter
]
- scrape metrics configuration for two job [
- Grafana is provision by following configuration files:
dashboard.yml
datasource.yml
- Custom cofiguration file to create datasource and dashboard with needed metrics:
exam.json
- Using docker compose with the following configuration
docker-compose.yml
run the Prometheus & Grafana containers
- Copy Prometheus custom configuration file
- Install docker on docker machine:
- The result:
- Gitea repo can be seen at:
http://192.168.99.202:3000/vagrant/exam
- Credentials
- user:
admin
- password:
admin
- user:
- Credentials
- Jenkins job pipeline can be seen at:
http://192.168.99.201:8080/job/exam/
- Credentials
- user:
admin
- password:
admin
- user:
- Credentials
- The final result of builded images in docker can be seen at:
http://localhost:80/
orhttp://192.168.99.202:8080/
- The Grafana monitoring dashboard can be seen at:
http://localhost:8083
orhttp://192.168.99.203:3000/
- Credentials
- user:
admin
- password:
admin
- user:
- Credentials
- Created docker hub repositories can be seen at:
https://hub.docker.com/repositories/mark79
- Docker metrics exposed to Prometheus can be seen at:
http://192.168.99.202:9323/metrics
- Node exporter metrics exposed to Prometheus can be seen at:
http://192.168.99.201:9100/metrics
andhttp://192.168.99.202:9100/metrics
- Prometheus configuration can be seen at:
http://192.168.99.203:9090/targets
- Gitea repo can be seen at:
mark79-github/exam
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
DevOps - Containerization, CI/CD & Monitoring - January 2023 - SoftUni - Exam
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published