Git Product home page Git Product logo

snap-integration-kubernetes's Introduction

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.

snap-integration-kubernetes's People

Contributors

andrzej-k avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.