Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

intelsdi-x/snap-integration-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

This project has been identified as having known security escapes.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

Running Snap in various environments

Snap can be deployed to collect metrics in various environments including Docker containers and Kubernetes. It can be run in a Docker container to gather metrics i.e. from host and other containers. Deployment of Snap in Kubernetes cluster gives a possibility to monitor pods in the cluster. In this repo you will find information on how to run Snap in those environments.

  1. Running Snap
  1. Customization and configuration
  2. Contributing
  3. License

1. Running Snap

First step is to download this repo. All of the needed files are in the snap-integration-kubernetes directory.

$ git clone https://github.com/intelsdi-x/snap-integration-kubernetes/
$ cd ./snap-integration-kubernetes

Snap in Docker container

To learn about running Snap in a Docker container run example Running Snap in Docker container.

Snap in Kubernetes

To learn about running Snap in Kubernetes run example Running Snap in Kubernetes pod.

Here you'll find an example of running Snap with Kubernetes on Google Compute Engine.

2. Customization and configuration

Inside Docker container it is possible to load most of the Snap plugins. The list of all Snap plugins is available in plugin catalog. After you choose plugin you click the plugin name. This redirects you to the plugin repository.

To use plugin inside the container you need to download its binary. In order to get plugin binary URL you go to the release section...

...and copy the link for the latest plugin release.

Many of the plugins require prior configuration and adjustment of container or Kubernetes manifest. The example of such plugin is Snap Docker collector plugin. The Docker collector allows to collect runtime metrics from Docker containers and its host machine. It gathers information about resource usage and performance characteristics. More information about docker collector can be found here.

All of the plugins requirements can be found in their documentation. The documentation of the Snap Docker plugin collector can be found here. Docker plugin collector needs access to files residing in the host machine:

  • /var/run/docker.sock
  • /proc
  • /usr/bin/docker
  • /var/lib/docker
  • /sys/fs/cgroup

This means that the original host files have to be available inside of the container. Running this plugin inside the container requires mapping of those files inside of the container. What is more, Docker collector plugin requires enviroment variable PROCFS_MOUNT to be set. It should point to the directory inside the container where original host directorry /proc is mounted. This has to be done in both cases: Docker container and Kubernetes pod.

Reconfiguration

The default Snap images are using autoload feature to simplify re-configuration of running Snap instance. The default autoload directory is /opt/snap/autoload, and can be chaged in snapteld.conf file - please refer to Snap configuration documentation for details. It is recommended to store plugins and tasks in autoload directory, so that plugins are automatically loaded, and tasks are automatically started, after snapteld restart.

To change configuration of running Snap follow this steps (inside Snap container).

  • edit config file /etc/snap/snapteld.conf
  • restart snapteld:
$ kill -HUP `pidof snapteld`

3. Contributing

We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.

4. License

Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.