Configuring Prometheus to scrape metrics – Containerization with Docker

We will now configure Prometheus on the Prometheus machine so that it can scrape the metrics from cAdvisor. To do so, modify the /etc/prometheus/prometheus.yml file so that it includes the following within the server running Prometheus: $ sudo vim /etc/prometheus/prometheus.yml … scrape_interval: 5s static_configs: After changing this configuration, we need to restart the Prometheus service. […]

Read More… from Configuring Prometheus to scrape metrics – Containerization with Docker

Challenges with container monitoring – Containerization with Docker

From a conceptual point of view, there is no difference between container monitoring and the traditional method. You still need metrics, logs, health checks, and service discovery. These aren’t things that are unknown or haven’t been explored before. The problem with containers is the abstraction that they bring with them; let’s look at some of […]

Read More… from Challenges with container monitoring – Containerization with Docker

Typical challenges and best practices to address these challenges with Docker logging – Containerization with Docker

Docker allows you to run multiple applications in a single machine or a cluster of machines. Most organizations run a mix of virtual machines and containers, and they have their logging and monitoring stack configured to support virtual machines. Most teams struggle to make Docker logging behave the way virtual machine logging works. So, most […]

Read More… from Typical challenges and best practices to address these challenges with Docker logging – Containerization with Docker

Configuring logging drivers – Containerization with Docker

Let’s start by finding the current logging driver: $ docker info | grep “Logging Driver” Logging Driver: json-file Currently, the default logging driver is set to json-file. If we want to use journald or Splunk as the default logging driver, we must configure the default logging driver in the daemon.json file. Edit the /etc/docker/daemon.json file […]

Read More… from Configuring logging drivers – Containerization with Docker

Logging drivers – Containerization with Docker

Docker logging and logging drivers Docker not only changed how applications are deployed but also the workflow for log management. Instead of writing logs to files, containers write logs to the console (stdout/stderr). Docker then uses a logging driver to export container logs to the specified destinations. Container log management Log management is an essential […]

Read More… from Logging drivers – Containerization with Docker

Putting it all together – Containerization with Docker

The best setting for a highly available NGINX container should be something like the following: $ docker run -d –name nginx –restart unless-stopped \ -p 80:80 –memory 1000M –memory-reservation 250M nginx:1.18.0 Let’s take a look at this in more detail: We will look into other flags in the subsequent sections as we get more hands-on. […]

Read More… from Putting it all together – Containerization with Docker

Troubleshooting containers – Containerization with Docker

To see what’s going on within the container, you can use the docker logs command. But before using that, we need to know the container’s ID or name to see the container’s logs. To get a list of containers running within the host, run the following command $ docker ps           […]

Read More… from Troubleshooting containers – Containerization with Docker

Running your first container – Containerization with Docker

You can create Docker containers out of Docker container images. While we will discuss container images and their architecture in the following chapters, an excellent way to visualize them is as a copy of all files, application libraries, and dependencies comprising your application environment, similar to a virtual machine image. To run a Docker container, […]

Read More… from Running your first container – Containerization with Docker

Configuring a storage driver – Containerization with Docker

For this discussion, we will configure overlay2 as the storage driver. Although it is configured by default, and you can skip the steps if you are following this book, it is worth a read in case you want to change it to something else. First, let’s list the existing storage driver: $ docker info | […]

Read More… from Configuring a storage driver – Containerization with Docker

Docker storage drivers – Containerization with Docker

If you mount a host directory that already contains files to an empty volume of the container, the container can see the files stored in the host. This is an excellent way to pre-populate files for your container(s) to use. However, if the directory does not exist in the host filesystem, Docker will create the […]

Read More… from Docker storage drivers – Containerization with Docker