<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>InfluxData Blog - Jack Zampolin</title>
    <description>Posts by Jack Zampolin on the InfluxData Blog</description>
    <link>https://www.influxdata.com/blog/author/jackzampolin/</link>
    <language>en-us</language>
    <lastBuildDate>Mon, 10 Jul 2017 14:36:32 -0700</lastBuildDate>
    <pubDate>Mon, 10 Jul 2017 14:36:32 -0700</pubDate>
    <ttl>1800</ttl>
    <item>
      <title>InfluxData On The Road: CloudFoundry Summit</title>
      <description>&lt;h2&gt;CloudFoundry Summit&lt;/h2&gt;
&lt;p&gt;&lt;img class="alignnone size-medium wp-image-9373" src="/images/legacy-uploads/cloud_foundry-225x300.jpg" alt="" width="225" height="300" /&gt;&lt;/p&gt;

&lt;p&gt;InfluxData was at CloudFoundry summit last week! We met a bunch of users who were very excited to see the &lt;a href="https://www.influxdata.com/time-series-platform/chronograf/"&gt;new version&lt;/a&gt; of Chronograf.&lt;/p&gt;
&lt;h3&gt;CloudFoundry and InfluxDB&lt;/h3&gt;
&lt;p&gt;While InfluxDB can ingest metrics from a variety of sources, each one requires something different. In CloudFoundry metrics (application, host, container, etc…) are aggregated in a system called the &lt;a href="https://docs.cloudfoundry.org/loggregator/architecture.html"&gt;Loggregator&lt;/a&gt;. This is extremely useful, but requires a special piece of infrastructure called a &lt;a href="https://docs.cloudfoundry.org/loggregator/nozzle-tutorial.html"&gt;“Nozzle”&lt;/a&gt; to read off of the &lt;a href="https://docs.cloudfoundry.org/loggregator/nozzle-tutorial.html"&gt;“Firehose”&lt;/a&gt;, the stream of metrics coming out of Loggregator.&lt;/p&gt;

&lt;p&gt;Prior to the conference I found an existing implementation of a Firehose Nozzle that outputs to InfluxDB. I &lt;a href="https://github.com/influxdata/influxdb-firehose-nozzle"&gt;updated it&lt;/a&gt; to work with the latest CF as well as the latest InfluxDB. We also did a &lt;a href="https://www.influxdata.com/resources/ingest-your-cloud-foundry-firehose-metrics-into-influxcloud/?ao_campid=70137000000MpYj"&gt;webinar on deploying that Firehose&lt;/a&gt; that I would encourage you to check out. Also if you have any feedback please let us know! If it is an issue with the code, please open an issue on the repo. Or, if I’m approaching this all wrong, you can let me know over on &lt;a href="https://community.influxdata.com"&gt;community.influxdata.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While at the show we met a number of InfluxData users who deploy on CloudFoundry. &lt;a href="https://www.express-scripts.com"&gt;ExpressScripts&lt;/a&gt; and the &lt;a href="https://github.com/ECSTeam/"&gt;ECSTeam&lt;/a&gt; introduced us to some work they had done on an &lt;a href="https://github.com/ECSTeam/influxdb-nozzle-bosh-release"&gt;InfluxDB firehose nozzle&lt;/a&gt; (complete with a Bosh Release) that they run in production. They also have a &lt;a href="https://docs.pivotal.io/tiledev/tile-structure.html"&gt;tile&lt;/a&gt; to deploy an &lt;a href="https://github.com/ECSTeam/influxdb-tile"&gt;InfluxDB instance&lt;/a&gt; in your cluster!&lt;/p&gt;
</description>
      <pubDate>Mon, 10 Jul 2017 14:36:32 -0700</pubDate>
      <link>https://www.influxdata.com/blog/influxdata-road-cloudfoundry-summit/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/influxdata-road-cloudfoundry-summit/</guid>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Telegraf Update - 1.3 and How to Write Plugins</title>
      <description>&lt;p&gt;&lt;img class="aligncenter wp-image-8900 size-medium" src="/images/legacy-uploads/TelegrafTiger-300x203.png" alt="Telegraf Tiger" width="300" height="203" /&gt;&lt;/p&gt;

&lt;p&gt;We recently released the &lt;a href="https://community.influxdata.com/t/telegraf-v1-3-0/954"&gt;1.3 version of Telegraf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have a python script that grabs some custom metrics? Use the &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec"&gt;exec plugin&lt;/a&gt;. Have some logfiles that contain metrics? Use the &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/logparser"&gt;logparser plugin&lt;/a&gt;. Need to measure API response time? The &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping"&gt;ping plugin&lt;/a&gt; has your back. With over 300 different committers and over 100 plugins in Telegraf, it’s the data Swiss Army Knife you need.&lt;/p&gt;

&lt;p&gt;What makes Telegraf such an active project? The ease of plugin development. Below I’ll briefly describe that architecture and show how easy it is to contribute to Telegraf.&lt;/p&gt;
&lt;h3&gt;Telegraf Architecture&lt;/h3&gt;
&lt;p&gt;Telegraf is a configuration-driven agent. Each of the input plugins satisfies a &lt;a href="https://gobyexample.com/interfaces"&gt;simple golang interface&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;type Input interface {
  // SampleConfig returns the default configuration of the Input
  SampleConfig() string
  // Description returns a one-sentence description on the Input
  Description() string
  // Gather takes in an accumulator and adds the metrics that the Input
  // gathers. This is called every "interval"
  Gather(Accumulator) error
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;SampleConfig()&lt;/code&gt; and &lt;code&gt;Description()&lt;/code&gt; functions are used when generating the configuration file. The real magic happens in the &lt;code&gt;Gather()&lt;/code&gt; function. The Accumulator that gets passed in is shared by all the plugins. It takes a representation of a single metric from the plugin and gives it to Telegraf:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;Accumulator.AddFields(measurement, fields, tags, time)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Gather function gets called on an interval that is set in the configuration file (&lt;code&gt;[agent]interval&lt;/code&gt;). Every ‘interval’ Telegraf calls the Gather function for each of its plugins and stores the resulting metrics from all the &lt;code&gt;AddFields&lt;/code&gt; calls in its metric buffer.&lt;/p&gt;

&lt;p&gt;The output interface is slightly more complex than the input interface as it needs to deal with database connections and writes:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;type Output interface {
  // Connect to the Output
  Connect() error
  // Close any connections to the Output
  Close() error
  // Description returns a one-sentence description on the Output
  Description() string
  // SampleConfig returns the default configuration of the Output
  SampleConfig() string
  // Write takes in group of points to be written to the Output
  Write(metrics []Metric) error
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The metric buffer then gets cleared by the configured output plugins every flush interval (&lt;code&gt;[agent]flush_interval&lt;/code&gt;) by a &lt;code&gt;Write()&lt;/code&gt; call. Connect() and Close() help manage the connection to the metric output and are called on startup and shutdown by Telegraf.&lt;/p&gt;

&lt;p&gt;This simple, yet powerful architecture is very extensible and makes Telegraf easy to contribute to.&lt;/p&gt;
&lt;h3&gt;Config Generation&lt;/h3&gt;
&lt;p&gt;One of the cool features the above architecture allows for is the config file generation which makes Telegraf self-documenting. I’ve found it particularly useful for getting monitoring started on a new project, or seeing what kind of metrics I can get out of existing systems.&lt;/p&gt;

&lt;p&gt;For example if you are trying to see what kind of metrics Telegraf can generate from your databases, you might generate the following config:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ telegraf -sample-config -input-filter elasticsearch:mysql:mongodb -output-filter influxdb&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And if you have a RabbitMQ instance you would like to route the data through on the way to InfluxDB, Telegraf makes that easy too:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ telegraf -sample-config -input-filter elasticsearch:mysql:mongodb -output-filter amqp
$ telegraf -sample-config -input-filter amqp_consumer -output-filter influxdb&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I could go on about processor and aggregator plugins, queuing integrations, input and output service plugins, and the countless things that make Telegraf cool, but I’ll leave those topics for another day!&lt;/p&gt;
&lt;h3&gt;Contributors&lt;/h3&gt;
&lt;p&gt;I also want to take this opportunity to thank our contributors to the 1.3 release: @ablagoev, @AntoineAugusti, @bullshit, @calerogers, @cosmopetrich, @d-ulyanov, @danielnelson, @ddryden, @djjorjinho, @einhirn, @francois2metz, @gioxchopper, @j-vizcaino, @jackzampolin, @JamesClonk, @jeremydenoun, @johnrengelman, @ldep30, @lpic10, @lpic10, @lrsmith, @martinseener, @nevins-b, @nfirvine, @njwhite, @pdcleyn, @phemmer, @PierreF, @ririsoft, @rossmcdonald, @sebito91, @seuf, @sparrc, @ssorathia, @tjmcs, @vlasad, @vtg&lt;/p&gt;
&lt;h3&gt;Helpful Resources&lt;/h3&gt;
&lt;p&gt;We have a number of great resources to help you get started with Telegraf as well as information on how to build your own plugin.&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://w2.influxdata.com/training/introduction-influxdb-telegraf/?ao_campid=70137000000JhDZ"&gt;An introduction to InfluxDB and Telegraf&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://w2.influxdata.com/training/write-your-own-telegraf-plugin/?ao_campid=70137000000Jkq0"&gt;Write your own Telegraf plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://docs.influxdata.com/telegraf/v1.3/introduction/getting_started/"&gt;Getting Started documentation&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://community.influxdata.com/c/ts-collect"&gt;InfluxData Community&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Fri, 09 Jun 2017 10:20:25 -0700</pubDate>
      <link>https://www.influxdata.com/blog/telegraf-update-1-3/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/telegraf-update-1-3/</guid>
      <category>Use Cases</category>
      <category>Product</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Draft for Kubernetes - A Prototyping Tool</title>
      <description>&lt;h2&gt;Overview&lt;/h2&gt;

&lt;p&gt;&lt;img src="/images/legacy-uploads/draft-logo-300x108.png" alt="Draft for Kubernetes" width="300" height="108" /&gt;
&lt;a href="https://github.com/Azure/draft"&gt;Draft&lt;/a&gt; for Kubernetes is a tool to help prototype microservices and expose them on a publicly available domain. This makes quickly iterating on things like webhooks or APIs quick and painless. Draft utilizes docker, &lt;a href="http://github.com/kubernetes/helm"&gt;Helm&lt;/a&gt;, and &lt;a href="https://github.com/kubernetes/ingress/tree/master/controllers"&gt;Kubernetes Ingress Controllers&lt;/a&gt; to make your ‘drafts’ publicly available in a hurry. Under the hood, it generates a generic &lt;code&gt;Dockerfile&lt;/code&gt; and helm chart for your application to get you up and running quickly. The &lt;a href="/packaged-kubernetes-deployments-writing-helm-chart/"&gt;helm chart&lt;/a&gt; creates an ingress resource to expose your chart at a url. You will need the following running for this walkthrough:&lt;/p&gt;
&lt;ol&gt;
 	&lt;li&gt;A Kubernetes Cluster
&lt;ul&gt;
 	&lt;li&gt;I've developed this walkthrough on GKE.&lt;/li&gt;
 	&lt;li&gt;It's &lt;a href="https://cloud.google.com/container-engine/docs/quickstart"&gt;pretty easy to get up and running&lt;/a&gt; there.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;A domain name you can add A or CNAME records to&lt;/li&gt;
 	&lt;li&gt;An account at quay.io or hub.docker&lt;/li&gt;
 	&lt;li&gt;A working Helm installation
&lt;ul&gt;
 	&lt;li&gt;Install instructions can be found &lt;a href="https://github.com/kubernetes/helm#install"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;A golang development environment
&lt;ul&gt;
 	&lt;li&gt;Draft also supports basic python, ruby, php, node, and java applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this walkthrough, we are going to first install the dependencies for Draft, then create our sample application, install Draft and deploy our app.&lt;/p&gt;

&lt;h3&gt;Installing Draft Dependencies&lt;/h3&gt;

&lt;p&gt;An Ingress Controller creates a loadBalancer with a Public IP (or a CNAME record on AWS) to expose your applications to the internet. It is a quick and secure abstraction for routing traffic into the applications running on your cluster. To install an Ingress Controller, use the &lt;a href="https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress"&gt;Nginx Ingress&lt;/a&gt; provided by helm:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;# Install Ingress Controller
$ helm install stable/nginx-ingress --namespace=kube-system --name=nginx-ingress
# Wait for load balancer to have IP
$ kubectl --namespace kube-system get services -w nginx-ingress-nginx-ingress-controller

# If you have an existing ingress controller find its IP 
echo $(kubectl get svc --namespace kube-system nginx-ingress-nginx-ingress-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}')&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you get the IP or CNAME you can create the appropriate DNS record. Make it something like &lt;code&gt;*.draft.mydomain.mytld&lt;/code&gt;. The steps to do this will vary depending on where your domain is registered. I use &lt;a href="https://www.whatsmydns.net"&gt;What’s My DNS&lt;/a&gt; to check propagation. Once you see that the change has propagated, you should get the following response from curl:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ curl foo.draft.mydomain.mytld
default backend - 404&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;Note: If you want to know more about default backends, I've found &lt;a href="https://github.com/kubernetes/contrib/tree/master/404-server"&gt;this article&lt;/a&gt; scintillating reading.&lt;/blockquote&gt;
&lt;h3&gt;Prepare Golang App&lt;/h3&gt;
&lt;p&gt;Make a new project directory and create a golang application. I’ve used a simple server:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;// main.go
 package main

import (
  "log"
  "net/http"
)

func sayHello(w http.ResponseWriter, r *http.Request) {
  message := "hello world\n"
  w.Write([]byte(message))
}

func main() {
  http.HandleFunc("/", sayHello)
  err := http.ListenAndServe(":8080", nil)
  if err != nil {
    log.Fatal("ListenAndServe: ", err)
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will also want to add some type of dependency management to your application. This is because of the &lt;a href="https://github.com/Azure/draft/tree/master/docs" target="_blank" rel="noopener noreferrer"&gt;script Draft uses to detect different application types&lt;/a&gt;. The golang pack looks to see if there is a &lt;code&gt;glide.yaml&lt;/code&gt;, &lt;code&gt;Godeps/Godeps.json&lt;/code&gt;, or &lt;code&gt;vendor/vendor.json&lt;/code&gt; file in your project. If you are using &lt;a href="https://github.com/Masterminds/glide"&gt;glide&lt;/a&gt;, a simple &lt;code&gt;glide create&lt;/code&gt; will satisfy this requirement.&lt;/p&gt;

&lt;h3&gt;Install Draft&lt;/h3&gt;

&lt;p&gt;Download the &lt;a href="https://github.com/Azure/draft/blob/master/docs/install-cloud.md" target="_blank" rel="noopener noreferrer"&gt;draft binary&lt;/a&gt; for your OS and move it into your path. After that you will need to run &lt;code&gt;draft init&lt;/code&gt; with some arguments:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;draft init --set
 registry.url=docker.io,
 registry.org=mydockerorg,
 registry.authtoken=$(echo '{"username":"myDockerUsername","password":"myDockerPassword","email":"my@email.com"}' | base64),
 basedomain=mydomain.mytld&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;Note: Be sure to run the above command all on one line with no spaces between the different &lt;code&gt;key=value&lt;/code&gt; pairs! Also, I had some &lt;a href="https://github.com/Azure/draft/issues/49"&gt;trouble getting the Google Container Registry&lt;/a&gt; to work, but it seems to be supported.&lt;/blockquote&gt;
&lt;p&gt;This spins up a &lt;code&gt;draftd&lt;/code&gt; deployment and some draft pods in your kube-system namespace. These help manage the connection with the docker image repository.&lt;/p&gt;

&lt;h3&gt;Deploy Your App!&lt;/h3&gt;

&lt;p&gt;Phew! That was a lot of setup! Now that this is done, it’s time to use Draft! The first command to run is &lt;code&gt;draft create&lt;/code&gt;. That will scaffold out your helm chart (&lt;code&gt;/chart&lt;/code&gt;) and &lt;code&gt;/Dockerfile&lt;/code&gt;. It will also create a &lt;code&gt;draft.toml&lt;/code&gt; that allows you to control different environments for your application as well as where it is installed in your cluster. To give your app a name (the default works just fine too!) edit &lt;code&gt;draft.toml&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;[environments]
  [environments.development]
    name = "cool-beans"
    namespace = "draft"
    watch = true
    watch_delay = 2&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then run &lt;code&gt;draft up&lt;/code&gt; and watch the magic happen:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ draft up
 --&amp;gt; Building Dockerfile
 Step 1 : FROM golang:onbuild
 # Executing 3 build triggers...
 Step 1 : COPY . /go/src/app
 Step 1 : RUN go-wrapper download
 ---&amp;gt; Running in 825771ecaf59
 ...
 # Some docker output...
 ...
 --&amp;gt; Deploying to Kubernetes
 --&amp;gt; Status: DEPLOYED
 --&amp;gt; Notes:
http://cool-beans.mydomain.mytld to access your application

Watching local files for changes...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will build your docker image, push your docker image to the configured container registry under the &lt;code&gt;{{ .environments.development.name }}&lt;/code&gt; repository, and run &lt;code&gt;helm install&lt;/code&gt; on the preconfigured helm chart at the root of the repo! It might take a second for all the resources to spin up and for the Ingress to register your new application, but you will be able to curl your application at that address:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ curl http://cool-beans.mydomain.mytld
 hello world&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But, to see the real magic, make a change to your application:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;// main.go

func sayHello(w http.ResponseWriter, r *http.Request) {
  message := "I don't know Margo...\n"
  w.Write([]byte(message))
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Draft will rebuild your image and push those changes live with a &lt;code&gt;helm upgrade&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-markup"&gt;$ curl http://cool-beans.mydomain.mytld
 I don't know Margo...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hooking in a datasource or performing more advanced actions is just a handler edit away now!&lt;/p&gt;
</description>
      <pubDate>Tue, 06 Jun 2017 04:00:26 -0700</pubDate>
      <link>https://www.influxdata.com/blog/draft-for-kubernetes-a-prototyping-tool/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/draft-for-kubernetes-a-prototyping-tool/</guid>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>InfluxData and Docker</title>
      <description>&lt;p&gt;Getting ready for the 2017 DockerCon this past week has had me thinking about all of the different ways we use Docker at InfluxData. From our official images, backing InfluxDB Cloud, and in our everyday development work. Furthermore, we share a commitment to open source and here are a couple of ways the two are great together.&lt;/p&gt;
&lt;h3&gt;Shared Commitment to Open Source&lt;/h3&gt;
&lt;p&gt;Both Docker and InfluxData are major open source contributors. All of InfluxData’s major projects &lt;a href="https://github.com/influxdata/influxdb"&gt;InfluxDB&lt;/a&gt;, &lt;a href="https://github.com/influxdata/kapacitor"&gt;Kapacitor&lt;/a&gt;, &lt;a href="https://github.com/influxdata/telegraf"&gt;Telegraf&lt;/a&gt;, and &lt;a href="https://github.com/influxdata/chronograf"&gt;Chronograf&lt;/a&gt; as well as Docker’s Docker Community Edition and ContainerD are open source. Developers trust open source software due to its inherent visibility, transparency, and active communities behind the projects—characteristics shared by both Docker and InfluxData.&lt;/p&gt;
&lt;h3&gt;InfluxData Sandbox and the Official Docker Images&lt;/h3&gt;
&lt;p&gt;We recently launched &lt;a href="http://github.com/influxdata/sandbox"&gt;InfluxData’s official Sandbox&lt;/a&gt; for experimenting with the full TICK Stack in an easy-to–get-started way. It is at its core a &lt;code&gt;docker-compose.yml&lt;/code&gt; file and a script to help users unfamiliar with docker accomplish common tasks.&lt;/p&gt;

&lt;p&gt;With &lt;em&gt;millions&lt;/em&gt; of pulls, the images behind sandbox are production tested and included in the official Docker image repository. I know this has saved me a bunch of time, and really helps me get started on projects quickly! Want to spin up monitoring for an IOT side project? Need to do a proof of concept for your new monitoring system? No problem. There is also an example &lt;code&gt;docker-compose&lt;/code&gt; file in the &lt;a href="https://github.com/influxdata/sandbox/blob/master/docker-compose.yml"&gt;sandbox&lt;/a&gt; if you want to run the full stack together and want a place to start. Here are the links to our official Docker images:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="https://hub.docker.com/_/telegraf" target="_blank" rel="noopener noreferrer"&gt;Telegraf&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://hub.docker.com/_/influxdb" target="_blank" rel="noopener noreferrer"&gt;InfluxDB&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="https://hub.docker.com/_/kapacitor" target="_blank" rel="noopener noreferrer"&gt;Kapacitor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Autoscaling and Docker&lt;/h3&gt;
&lt;p&gt;We recently did a &lt;a href="https://w2.influxdata.com/resources/influxdata-helps-docker-auto-scale-monitoring/?ao_campid=70137000000Jgw7"&gt;webinar&lt;/a&gt; on how to automatically scale containers running on Docker Swarm, or the infrastructure underlying those containers, using the TICK stack. We wrote a small Golang program called &lt;a href="https://github.com/gianarb/orbiter" target="_blank" rel="noopener noreferrer"&gt;Orbiter&lt;/a&gt; to make sending scaling messages to different providers a breeze. For the webinar, we implemented Digital Ocean and &lt;a href="https://github.com/gianarb/orbiter/blob/master/provider/swarm.go"&gt;Docker Swarm&lt;/a&gt; as scaling targets.&lt;/p&gt;

&lt;p&gt;Using Kapacitor to trigger autoscaling makes it very easy to setup, and allows you to target different metrics to scale on. Want to scale your RabbitMQ Cluster based on queue depth, or your Nginx servers based on requests per second? No problem with Orbiter and the TICK Stack.&lt;/p&gt;

&lt;p&gt;In addition to scaling Docker Swarm we also have a &lt;a href="https://docs.influxdata.com/kapacitor/v1.2/about_the_project/releasenotes-changelog/#release-notes-2"&gt;Kapacitor alert handler&lt;/a&gt; to &lt;a href="https://github.com/influxdata/k8s-kapacitor-autoscale"&gt;scale Kubernetes deployments&lt;/a&gt; based on any metric you choose. Want to scale your CI workers based on … the weather outside? Well that might be getting carried away, but with a Raspberry Pi and some gumption you could make it happen!&lt;/p&gt;
&lt;h3&gt;InfluxDB Cloud&lt;/h3&gt;
&lt;p&gt;At InfluxData, our cloud service (&lt;a href="https://cloud.influxdata.com/"&gt;cloud.influxdata.com&lt;/a&gt;—go check it out!) runs on Docker. Even the smallest sized cluster requires at least four different pieces of infrastructure with multiple copies of each. While this can be painful with some configuration management tools, with Docker it is a breeze. By eating our own dogfood we can tighten the iteration cycles on our products and deliver a better experience to all of our users.&lt;/p&gt;
&lt;h3&gt;DockerCon&lt;/h3&gt;
&lt;p&gt;Last but not least, InfluxData is at the 2017 DockerCon! Don’t forget to drop by the booth and come say hello! &lt;a href="https://w2.influxdata.com/blog/author/timhall/"&gt;Tim Hall&lt;/a&gt; and &lt;a href="https://jackzampolin.com"&gt;I&lt;/a&gt; will be there all week.&lt;/p&gt;
</description>
      <pubDate>Mon, 17 Apr 2017 08:00:52 -0700</pubDate>
      <link>https://www.influxdata.com/blog/influxdata-and-docker/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/influxdata-and-docker/</guid>
      <category>Product</category>
      <category>Use Cases</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Denver DevOps Days</title>
      <description>&lt;p&gt;&lt;img class="alignnone" src="https://devopsdays.org/events/2017-denver/logo.png" alt="Denver DevOps Days" width="786" height="315" /&gt;&lt;/p&gt;

&lt;p&gt;We had a great DevOps Days in Denver! The venue had an excellent cloud theme, an energetic crowd, and a hard-working group of organizers, making for a smooth and fun conference.&lt;/p&gt;

&lt;p&gt;This DevOps Days continued the tradition of excellent talks and breakout sessions. Of the talks, I found the one about the recent GitLab Database outage from their Community Advocate, &lt;a href="https://gitlab.com/connorshea"&gt;Connor Shea&lt;/a&gt; most interesting. If you haven’t already, go check out the &lt;a href="https://about.gitlab.com/2017/02/10/postmortem-of-database-outage-of-january-31/"&gt;postmortem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;InfluxData will be at these upcoming events:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Dockercon - Austin, April 17-21&lt;/li&gt;
 	&lt;li&gt;DevOpsDays - Austin, May 4-5&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="/images/legacy-uploads/watts-rain-clouds-300x225.jpeg" alt="InfluxData at the Event" width="300" height="225" /&gt;&lt;/p&gt;
</description>
      <pubDate>Fri, 14 Apr 2017 16:54:38 -0700</pubDate>
      <link>https://www.influxdata.com/blog/denver-devops-days/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/denver-devops-days/</guid>
      <category>Use Cases</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Autoscaling Docker Swarm with the TICK Stack</title>
      <description>&lt;p&gt;&lt;b&gt;TICK Stack and Docker&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;With each successive release of the TICK Stack, InfluxData is improving the ease of use, depth of metrics, and level of control we provide in maintaining and monitoring Docker installations. InfluxDB has been an integral part of most Docker monitoring solutions. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;From its use as a primary sink for CAdvisor, to our native &lt;/span&gt;&lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker"&gt;&lt;span style="font-weight: 400;"&gt;Telegraf plugin&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; for gathering container level metrics, InfluxDB and the TICK stack have a part to play in monitoring any Docker setup. It can also scale from a single host to a complex multi-host cluster.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Docker Background&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;Docker has also been moving forward. In their last two releases they have added support for orchestration with their Swarm feature in the core Docker daemon. &lt;/span&gt;&lt;a href="https://blog.docker.com/2016/06/docker-1-12-built-in-orchestration/"&gt;&lt;span style="font-weight: 400;"&gt;Docker 1.12&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; was released in June 2016 and many Docker users began using this version. For Docker 1.13, they focused on feedback from the community and added features such as secret manager and the new CLI re-design.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;Now that Docker has solved the orchestration problem and you can manage a cluster of Docker hosts without other tools or frameworks, however, you need to have a solid environment. This means that you need to be able to trust how your system behaves and have visibility into each part. This makes logging and monitoring skills mandatory for any Docker Swarm administrator&lt;/span&gt;&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;That might leave you asking questions like: “How can I scale application components when my queue backs up or my cache fills up?”&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Orbiter&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;Enter &lt;/span&gt;&lt;a href="https://github.com/gianarb/orbiter"&gt;&lt;span style="font-weight: 400;"&gt;Orbiter&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, an open source tool to scale Docker Swarm clusters. You can use this piece of infrastructure along with Kapacitor to scale services on your Swarm cluster based on any of your monitoring metrics. The &lt;a href="https://github.com/gianarb/orbiter"&gt;README&lt;/a&gt; on Orbiter contains the information needed to spin the system up or down. There is also a &lt;a href="https://w2.influxdata.com/resources/influxdata-helps-docker-auto-scale-monitoring/?ao_campid=70137000000Jgw7"&gt;webinar&lt;/a&gt; with a demo showing how to use Orbiter to scale your Docker Swarm. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight: 400;"&gt;What are you waiting for? Go try it out!&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Resources&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://community.influxdata.com"&gt;InfluxData Community&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://w2.influxdata.com/resources/influxdata-helps-docker-auto-scale-monitoring/?ao_campid=70137000000Jgw7"&gt;Docker Autoscaling Webinar&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://w2.influxdata.com/kubernetes-monitoring-and-autoscaling-with-telegraf-and-kapacitor/"&gt;Kubernetes Autoscaling with the TICK Stack&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/gianarb/orbiter"&gt;Orbiter Github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 06 Apr 2017 04:00:37 -0700</pubDate>
      <link>https://www.influxdata.com/blog/autoscaling-docker-swarm-tick-stack/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/autoscaling-docker-swarm-tick-stack/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Announcing the InfluxData Sandbox</title>
      <description>&lt;p&gt;&lt;img class=" wp-image-7490 aligncenter" src="/images/legacy-uploads/influx-sandbox-300x87.png" alt="" width="1200" height="347" /&gt;&lt;/p&gt;

&lt;p&gt;Today I’m happy to announce the InfluxData sandbox. The sandbox runs the entire suite of InfluxData products for use as a learning tool. With all of our previous full stack tutorials, such as &lt;a href="https://docs.influxdata.com/kapacitor/v1.2/introduction/getting_started/"&gt;this one for Kapacitor&lt;/a&gt;, you need to install each of the products separately and configure them to work together. This sandbox eliminates all the extra work and confusion.&lt;/p&gt;

&lt;h3&gt;Working with the Sandbox&lt;/h3&gt;

&lt;p&gt;Many operations have additional steps to be taken at each level of the stack. For example, adding a new input to Telegraf gives additional metrics to alert on, graph, and downsample. The &lt;code&gt;sandbox makes the setup transparent &lt;/code&gt;so that you can focus on understanding the task you need to perform.&lt;/p&gt;

&lt;p&gt;Working with the &lt;code&gt;sandbox&lt;/code&gt; is meant to simulate a production InfluxData installation running on separate machines without the management complexity. Currently the sandbox hosts a number of tutorials for setting up authentication for the TICK Stack, and creating your first alert in Kapacitor using the UI in Chronograf. We will be adding more tutorials to the sandbox as features are added and at users’ requests. To request a new tutorial &lt;a href="https://github.com/influxdata/sandbox/issues/new"&gt;open an issue on &lt;code&gt;sandbox&lt;/code&gt;&lt;/a&gt;, or post your request over on &lt;a href="https://community.influxdata.com"&gt;community.influxdata.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This project was built using &lt;a href="https://docker.com"&gt;Docker&lt;/a&gt;. The necessary network and volume configurations are specified in the &lt;code&gt;./docker-compose.yaml&lt;/code&gt; file at the root of the project. That file contains comments to show how to change the versions of each product run by the sandbox.&lt;/p&gt;

&lt;h3&gt;Get the Sandbox!&lt;/h3&gt;

&lt;p&gt;The sandbox is available on github (&lt;a href="https://github.com/influxdata/sandbox"&gt;&lt;code&gt;influxdata/sandbox&lt;/code&gt;&lt;/a&gt;). To get started just clone the repo and run &lt;code&gt;./sandbox up&lt;/code&gt;. This downloads docker images for each of the products and starts them in the proper configuration. You browser will open Chronograf and the tutorials in separate tabs. Just follow the quick instructions in the &lt;a href="https://github.com/influxdata/sandbox"&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/a&gt; to connect InfluxDB and Kapacitor to Chronograf and you are ready to go!&lt;/p&gt;

&lt;p&gt;The sandbox persists data in the cloned directory to make for easy install/uninstall as well as inspection of the data directories for each product. This means that you can stop the standbox and easily come back to your previous state, or just as easily wipe everything and start from scratch.&lt;/p&gt;

&lt;p&gt;So what are you waiting for? Go give it a try!&lt;/p&gt;
</description>
      <pubDate>Wed, 05 Apr 2017 04:00:27 -0700</pubDate>
      <link>https://www.influxdata.com/blog/announcing-influxdata-sandbox/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/announcing-influxdata-sandbox/</guid>
      <category>Product</category>
      <category>Use Cases</category>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>tick-charts Update</title>
      <description>&lt;p&gt;This is an update to an earlier &lt;a href="https://w2.influxdata.com/how-to-spin-up-the-tick-stack-in-a-kubernetes-instance/"&gt;blog&lt;/a&gt; post I did on &lt;code&gt;tick-charts&lt;/code&gt;, the project to make the InfluxData stack as easy to run on Kubernetes as possible. While developing the project I’ve learned that some of the original implementation decisions were not the right way to go! Also, Chronograf has matured significantly since that time and has required additions to the chart to support a few different flavors of OAuth: Heroku, Github, and Google.&lt;/p&gt;
&lt;h2&gt;Telegraf Changes&lt;/h2&gt;
&lt;p&gt;The primary change from the first version is the re-architecture of the &lt;code&gt;telegraf&lt;/code&gt; chart. Initially I thought that a monolithic chart for telegraf would be the best way to go. That chart put host-level monitoring, as well as polling, in one &lt;code&gt;values.yaml&lt;/code&gt; file. This becomes complicated because telegraf is primarily configuration driven, and holding both configurations in one file quickly becomes too complex. Another downside of that chart was that spinning up a single telegraf instance required deleting a bunch of configurations for the &lt;code&gt;daemonset&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To reduce this complexity I’ve taken a two-prong approach. First I split up the telegraf chart into two, providing a much cleaner interface for users. Next I reduced the amount of configuration required for the &lt;code&gt;daemonset&lt;/code&gt; (&lt;code&gt;telegraf-ds&lt;/code&gt;). The defaults provide the basics for host-level monitoring in Kubernetes: &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/kubernetes"&gt;Kubelet&lt;/a&gt; and &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker"&gt;Docker&lt;/a&gt; polling, &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system"&gt;cpu, mem, disk, system load&lt;/a&gt;, and network statistics. All that is required of the user is to set &lt;code&gt;config.outputs.influxdb.url&lt;/code&gt;. If you don’t want to host your InfluxDB, you can easily spin up an &lt;a href="https://cloud.influxdata.com/"&gt;InfluxDB Cloud&lt;/a&gt; instance to hold the data.&lt;/p&gt;

&lt;p&gt;The chart for spinning up single telegraf instances is now called &lt;code&gt;telegraf-s&lt;/code&gt;. Currently, it is implemented in much the same way as the old telegraf chart: using some custom golang templates to generate the configuration. This is difficult for plugins that require a substantial amount of configuration such as &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/snmp"&gt;&lt;code&gt;snmp&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/snmp"&gt;&lt;code&gt;jolokia&lt;/code&gt;&lt;/a&gt; and is error prone. In order to eliminate that complexity and the difficulty of maintaining custom code, I’ve added a &lt;a href="https://github.com/kubernetes/helm/pull/2050"&gt;&lt;code&gt;toToml&lt;/code&gt;&lt;/a&gt; template function to Helm. Once the &lt;a href="https://github.com/kubernetes/helm/wiki/Roadmap"&gt;2.3 release&lt;/a&gt; of Helm is available, the &lt;code&gt;telegraf-s&lt;/code&gt; chart will be modified to use it. This will make creating telegraf instances in your cluster extremely easy. Using a tool like &lt;a href="https://github.com/dbohdan/remarshal"&gt;&lt;code&gt;remarshal&lt;/code&gt;&lt;/a&gt; to convert the &lt;code&gt;toml&lt;/code&gt;output by telegraf into &lt;code&gt;yaml,&lt;/code&gt; the workflow for generating a new telegraf instance to monitor a piece of your cluster will look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;# On mac at least...
$ telegraf -sample-config -input-filter nginx:cloudwatch -output-filter 
kafka_producer | toml2yaml | pbcopy&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting blob of yaml can be added directly to your values.yaml file under the config section and edited there.&lt;/p&gt;
&lt;h2&gt;Next Steps&lt;/h2&gt;
&lt;p&gt;I plan to continue improving the production readiness, examples, and user experience for deploying the TICK stack. The following items are on my &lt;code&gt;# TODO:&lt;/code&gt; for this project:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Production Readiness
&lt;ul&gt;
 	&lt;li&gt;Make InfluxDB deploy with basic authentication enabled&lt;/li&gt;
 	&lt;li&gt;Add backup/restore job examples to back up InfluxDB to s3 or other object store&lt;/li&gt;
 	&lt;li&gt;Create job to dynamically reload configuration for &lt;code&gt;telegraf&lt;/code&gt; on upgrade&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;User Experience
&lt;ul&gt;
 	&lt;li&gt;Create a top-level chart so that the whole deployment can be managed from one chart&lt;/li&gt;
 	&lt;li&gt;Reduce the time from zero to dashboards to as short as possible&lt;/li&gt;
 	&lt;li&gt;Address any pain points that begin to show with increasing usage&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;Examples
&lt;ul&gt;
 	&lt;li&gt;Monitoring Prometheus endpoints with Telegraf&lt;/li&gt;
 	&lt;li&gt;Using queues in Kubernetes with Telegraf&lt;/li&gt;
 	&lt;li&gt;Monitoring &lt;code&gt;{{ .telegraf_plugin.name }}&lt;/code&gt; (suggestions welcome!)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would also love some input as to what features you would like to see in this integration. Please post your questions/concerns/suggestions or other comments on &lt;a href="https://community.influxdata.com/t/tick-charts-discussion/349"&gt;this post&lt;/a&gt; on our Community site. I can’t wait to hear from you!&lt;/p&gt;
</description>
      <pubDate>Wed, 29 Mar 2017 04:00:39 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tick-charts-update/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tick-charts-update/</guid>
      <category>Use Cases</category>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
    <item>
      <title>Packaged Kubernetes Deployments - Writing a Helm Chart</title>
      <description>&lt;p&gt;Throughout my time at InfluxData, and even before, I have been working with containers, and occasionally doing useful things with them! This led me to try out Kubernetes, which I have found to be very useful. In my job, I end up having to deploy random code for things like internal dashboards, demos, reporting, and data collection. Much of this code lives on a small Kubernetes cluster that I maintain.&lt;/p&gt;

&lt;p&gt;At first when I started running Kubernetes, I found that keeping track of all my &lt;code&gt;*.yaml&lt;/code&gt; files to be a pain. Even though I had a repository where I would keep the current state of my deployments, it was a management nightmare. I would end up copying from old projects to get started with new ones, and keeping the repo up to date was a pain! I even wrote a quick little bash program to help with this.&lt;/p&gt;

&lt;p&gt;Bottom line is that when you are running Kubernetes, you quickly get to a place where the management of your deployment files is cumbersome and often not using deployment best practices.&lt;/p&gt;

&lt;p&gt;Enter &lt;code&gt;helm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kubernetes/helm"&gt;Helm&lt;/a&gt; is a templating packaging and deployment manager for Kubernetes. Think of it like &lt;code&gt;apt-get&lt;/code&gt; or &lt;code&gt;brew&lt;/code&gt; for Kubernetes. It consists of a server that runs in your cluster and renders your templates, &lt;code&gt;tiller&lt;/code&gt;, and a command line interface &lt;code&gt;helm&lt;/code&gt;. (If you’re totally new to Helm charts, scroll to the bottom of this article for some handy reference content).&lt;/p&gt;

&lt;p&gt;Through this experience, I thought it would make sense to develop a quick guide to writing a simple &lt;code&gt;helm&lt;/code&gt; chart with a focus on workflow. If you want to follow along, download &lt;code&gt;helm&lt;/code&gt;. &lt;strong&gt;&lt;em&gt;Please note&lt;/em&gt;&lt;/strong&gt;: A familiarity with Kubernetes and Docker is required.&lt;/p&gt;
&lt;h2&gt;1. Find an application to deploy&lt;/h2&gt;
&lt;p&gt;I’ll be deploying a small node app that has been sitting in my Github. &lt;a href="https://github.com/jackzampolin/wec/"&gt;WEC&lt;/a&gt; is a small nodejs application that subscribes to the &lt;a href="https://www.mediawiki.org/wiki/Manual:RCFeed"&gt;Wikipedia Recent Changes&lt;/a&gt; feed. When it receives an event, it parses and inserts the event into an InfluxDB instance. I’m using the excellent &lt;a href="https://github.com/node-influx/node-influx"&gt;node-influx/node-influx&lt;/a&gt; Javascript client to write to the database.&lt;/p&gt;

&lt;p&gt;You can check out the code in &lt;code&gt;&lt;a href="https://github.com/jackzampolin/wec/blob/master/server.js"&gt;/server.js.&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;2. Dockerize it!&lt;/h2&gt;
&lt;p&gt;When creating a &lt;code&gt;helm&lt;/code&gt; chart, you first need an image to run. I’ve created a Dockerfile for this server. The next step is to push it to a Docker Registry that is accessible from your cluster. I use &lt;code&gt;gcr.io&lt;/code&gt; because of its ease of use in Google Cloud. Other options are &lt;a href="https://hub.docker.com/"&gt;Docker Hub&lt;/a&gt; and &lt;a href="https://quay.io/"&gt;Quay.io&lt;/a&gt;. You could also push to a private registry. To build and push the image from this repository run:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;$ cd wec
$ export ORG=myorg
$ export REGISTRY=gcr.io
$ docker build -t $REGISTRY/$ORG/wec:latest .
$ docker push $REGISTRY/$ORG/wec:latest&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3. Stub out helm chart&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;helm&lt;/code&gt; cli has a command to stub out your chart. This makes getting projects started quick and easy. To create the chart files for WEC just run &lt;code&gt;helm create wec&lt;/code&gt;. A directory, &lt;code&gt;wec&lt;/code&gt;, will be created in the current directory with the following files:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;$ tree wec/
wec/
??? Chart.yaml
??? charts
??? templates
?   ??? NOTES.txt
?   ??? _helpers.tpl
?   ??? deployment.yaml
?   ??? service.yaml
??? values.yaml

2 directories, 6 files&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;Chart.yaml&lt;/code&gt; contains metadata about the chart. You can use the defaults.&lt;/li&gt;
 	&lt;li&gt;&lt;code&gt;charts/&lt;/code&gt; holds any dependency charts. You can delete this folder now. This is used when building a chart from component charts.&lt;/li&gt;
 	&lt;li&gt;&lt;code&gt;templates/&lt;/code&gt; holds all of your template files! This is where you do your work.&lt;/li&gt;
 	&lt;li&gt;&lt;code&gt;values.yaml&lt;/code&gt; holds any variables you want to reference in your templates. These are the configuration options you present to the end user.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’ve moved the chart into a directory called &lt;code&gt;chart&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;4. Write your .yaml files&lt;/h3&gt;
&lt;p&gt;Helm starts you off with a &lt;code&gt;deployment.yaml&lt;/code&gt; and a &lt;code&gt;service.yaml&lt;/code&gt;. If you need other types of Kubernetes objects in your chart the &lt;a href="https://github.com/kubernetes/charts/"&gt;&lt;code&gt;kubernetes/charts&lt;/code&gt;&lt;/a&gt; repo has some great examples:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/blob/master/stable/chronograf/templates/ingress.yaml"&gt;&lt;code&gt;ingress&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/blob/master/stable/influxdb/templates/pvc.yaml"&gt;&lt;code&gt;pvc&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/blob/master/stable/influxdb/templates/config.yaml"&gt;&lt;code&gt;configmap&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/blob/master/stable/nginx-ingress/templates/controller-service.yaml"&gt;&lt;code&gt;service&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/blob/master/stable/nginx-ingress/templates/controller-daemonset.yaml"&gt;&lt;code&gt;daemonset&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Helm uses &lt;a href="https://golang.org/pkg/text/template/"&gt;Golang templates&lt;/a&gt; as a tempting language. It will expand any variables in &lt;code&gt;{{}}&lt;/code&gt;. As a chart author, you have some &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/chart_template_guide/builtin_objects.md"&gt;built-in objects&lt;/a&gt; available for reference in your chart files (e.g. &lt;code&gt;{{ .Release.Namespace }}&lt;/code&gt;) as well as the &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/chart_template_guide/values_files.md"&gt;&lt;code&gt;values.yaml&lt;/code&gt;&lt;/a&gt; file (e.g. &lt;code&gt;{{ .Values.database_name }}&lt;/code&gt;). There are two sets of template helper functions as well: &lt;a href="https://github.com/Masterminds/sprig#functions"&gt;Sprig&lt;/a&gt; and &lt;a href="https://golang.org/pkg/text/template/"&gt;Golang template&lt;/a&gt; functions.&lt;/p&gt;

&lt;p&gt;Conveniently, for &lt;code&gt;wec&lt;/code&gt; we only require a &lt;code&gt;deployment&lt;/code&gt;. &lt;code&gt;wec&lt;/code&gt; subscribes to the Wikipedia feed and receives the data back without needing to expose an endpoint! Very easy! We will need to set a couple of &lt;code&gt;ENV&lt;/code&gt; as well to point to the database, other than that the stock file looks the same. We want to make those database connection parameters available in the &lt;code&gt;values.yaml&lt;/code&gt; file to make database configuration easy. Here is our deployment file:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  # Template helpers are stored in /templates/_helpers.yaml
  name: {{ template "fullname" . }}
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: {{ template "fullname" . }}
    spec:
      containers:
      - name: {{ .Chart.Name }}
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        env: 
        - name: DATABSE_NAME
          # `quote`-ing strings prevents type errors on yaml parsing
          value: {{ .Values.database_name | quote }}
        - name: INFLUX_URL
          value: {{ .Values.influx_url | quote }}
        - name: INFLUX_PORT
          value: {{ .Values.influx_port | quote }}
        - name: BATCH_SIZE
          value: {{ .Values.batch_size | quote }}
        - name: CONNECTION_URL
          value: {{ .Values.connection_url | quote }}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And the default &lt;code&gt;values.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;replicaCount: 1
image:
repository: gcr.io/influx-perf-testing/wec
tag: latest
pullPolicy: Always
database_name: 'wikipedia'
influx_url: "db-influxdb.prod"
influx_port: "8086"
batch_size: 10
connection_url: 'https://stream.wikimedia.org/rc'&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;5. Test your chart&lt;/h2&gt;
&lt;p&gt;Now that we have written a chart, we need to see if it produces the proper result. Luckily helm has some utilities to help with this. To see the deployment files that will be output by helm, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;$ helm install --dry-run --debug --name test --namespace test chart/wec/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This debug output is very helpful in chart development and is a great way to inspect the output of your chart and check for any errors before trying to install it on your cluster.&lt;/p&gt;
&lt;blockquote&gt;Tip: If you run helm install without &lt;code&gt;--dry-run --debug&lt;/code&gt; and your chart errors out sometimes there is a ghost release left. You can delete image by passing the &lt;code&gt;--purge&lt;/code&gt; option to &lt;code&gt;helm delete {{ .Release.Name }}.&lt;/code&gt;&lt;/blockquote&gt;
&lt;h2&gt;6. Deploy it!&lt;/h2&gt;
&lt;p&gt;When you are ready to deploy your chart just run &lt;code&gt;helm install --name wec --namespace wec ./chart/wec/&lt;/code&gt; to install!&lt;/p&gt;

&lt;p&gt;When you run the install, you should see the output of &lt;code&gt;NOTES.txt&lt;/code&gt;. This should give instructions on how to health check, or interact with the deployment:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;$ helm install --name wec --namespace wec ./chart/wec/
NAME: foo
LAST DEPLOYED: Fri Mar 10 09:04:37 2017
NAMESPACE: bar
STATUS: DEPLOYED

RESOURCES:
==&amp;gt; extensions/v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
foo-wec 1 1 1 0 0s

NOTES:
Watch for you pods to come up by running the following command:

- kubectl get pods --namespace bar -l app=foo-wec -w

Check the logs on a running pod with the following:

- kubectl logs $(kubectl get pods --namespace bar -l app=foo-wec -o jsonpath='{ .items[0].metadata.name }')&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once the deployment is running you should be able to see the events flowing into your InfluxDB instance. Then you can have fun exploring the data! Here is a graph of the number of bot vs human edits on Wikipedia (the humans are winning - for now):&lt;/p&gt;

&lt;p&gt;&lt;img class="aligncenter wp-image-7225 size-full" src="/images/legacy-uploads/wikipedia.png" alt="" width="2880" height="1190" /&gt;&lt;/p&gt;
&lt;h2&gt;7. Next steps&lt;/h2&gt;
&lt;p&gt;This guide just scratches the surface of &lt;code&gt;helm&lt;/code&gt; charts. Helm also offers &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/charts_hooks.md"&gt;&lt;code&gt;hooks&lt;/code&gt;&lt;/a&gt; to enable running jobs at different points in chart lifecycle. There is also an excellent &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/charts_tips_and_tricks.md"&gt;tips and tricks&lt;/a&gt; guide for debugging common issues. And &lt;a href="https://github.com/kubernetes/helm/blob/master/docs/chart_repository.md"&gt;packaging charts&lt;/a&gt; for distribution and building chart repos could be another blog post in and of itself. If you have further questions, the &lt;code&gt;helm&lt;/code&gt; community is active on the &lt;a href="http://slack.k8s.io/"&gt;Kubernetes slack&lt;/a&gt; in the &lt;code&gt;helm&lt;/code&gt; channel.&lt;/p&gt;

&lt;p&gt;If you are interested in experimenting more with the InfluxData stack, we have charts for all of our products available in the main charts repo:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li style="list-style-type: none;"&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/tree/master/stable/kapacitor"&gt;Kapacitor&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/tree/master/stable/influxdb"&gt;InfluxDB&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/tree/master/stable/chronograf"&gt;Chronograf&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/kubernetes/charts/tree/master/stable/telegraf"&gt;Telegraf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For those of you who are just beginning with Helm charts, here are some answers to basic questions about how Helm charts work.&lt;/p&gt;
&lt;h2&gt;What is a helm chart?&lt;/h2&gt;
&lt;p&gt;Helm is designed to help you manage all of your Kubernetes applications in one simple, easy-to-use place — and Helm charts are a big part of what helps you define, install and upgrade even the most complicated applications you happen to be working with. A chart is little more than a collection of files that describe a related grouping of Kubernetes resources.&lt;/p&gt;

&lt;p&gt;The directory name of the Kubernetes Helm chart in question will just be the name of the chart itself, without any type of versioning information. Inside that directory, Helm will create a structure that includes all listed file names. One of those will be the Chart.yaml file, which is required for a chart to properly function. Here, you’ll find important information like the name of the chart, the API version, the SemVer 2 version, a list of keywords about the project and more. You can also include other optional information like URLs for the source code of the project, the name and other contact information of the person maintaining the project and more.&lt;/p&gt;
&lt;h2&gt;Why are Helm charts used?&lt;/h2&gt;
&lt;p&gt;By design, Kubernetes Helm charts make it easy to create, version, share and publish your applications. It’s also built to support workflows that are far more advanced than you can complete with simple copying and pasting alone. A single chart might be used to deploy something simple, or something far more complex like a web app stack complete with servers, caches and more.&lt;/p&gt;

&lt;p&gt;Overall, Helm charts are created as files that are laid out in a very particular type of directory tree that makes sense given the project you’re working on at the time. They can then be packaged into archives depending on the most recently updated version, at which point they can be deployed in any way you see fit.&lt;/p&gt;
&lt;h2&gt;How to create a Helm chart&lt;/h2&gt;
&lt;p&gt;The process of creating a Helm chart is very straightforward — you can do so right from the command line. All you have to do is use the following command:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code class="language-markup"&gt;helm create [insert name here]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This single command will create a chart directory, along with all of the different common files and directories that are to be used within the chart. But most importantly, that final portion of the command will be the given name for everything that comes after. So if you wanted to create a Helm chart with the name of the project you’re currently working on, you would include it as the last portion of the command prior to execution.&lt;/p&gt;
&lt;h2&gt;How do I update a deployed helm chart?&lt;/h2&gt;
&lt;p&gt;Whenever a new version of a particular Helm chart is released, or if you want to make any changes to the configuration of the current release, you can always use the following command:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code class="language-markup"&gt;helm upgrade&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This will take your existing release and upgrade everything according to only the information you provide. It’s also important to note that because Kubernetes charts by nature can be incredibly large and complex, Helm will always try to perform the most straightforward upgrade possible. This means that it will update the things that have changed since the last release whenever you run that command. Because of this, Helm chart updates will happen far faster than you likely expect.&lt;/p&gt;

&lt;p&gt;Note that if you’re unhappy with any updates and would like to roll back to a previous version, you can also do so using the following command:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code class="language-markup"&gt;helm rollback&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What is the anatomy of a helm chart?&lt;/h2&gt;
&lt;p&gt;While the internal structure of your Helm chart will obviously vary depending on the deployment, any Helm chart tree will contain the aforementioned &lt;code class="language-markup"&gt;.yaml&lt;/code&gt; file, template files and a &lt;code class="language-markup"&gt;notes.txt&lt;/code&gt; file. The &lt;code class="language-markup"&gt;notes.txt&lt;/code&gt; file in particular will always print on the command line whenever you start your application.&lt;/p&gt;
&lt;h2&gt;How to create a helm chart from a docker image&lt;/h2&gt;
&lt;p&gt;After you have obtained the appropriate application source code and have built your docker image, the process of creating a new Helm chart from that image is straightforward. All you have to do is publish the image and use the “&lt;code&gt;helm create&lt;/code&gt;” command. Then, you can edit the &lt;code class="language-markup"&gt;values.yaml&lt;/code&gt; file and edit the &lt;code class="language-markup"&gt;deployment.yaml&lt;/code&gt; file as you see fit to include your own variables.&lt;/p&gt;

&lt;p&gt;Note that to publish your docker image, you will need to upload it to a public registry. Just a few of the options that you can choose from include Google Container Registry, Amazon EC2 Container Registry, Azure Container Registry, Quay and, of course, Docker Hub. Simply log into your public registry of choice and publish the image to your account. Once you have confirmed that the image is in your account and is visible on your dashboard, you can continue with the rest of the process.&lt;/p&gt;
&lt;h2&gt;How to deploy a helm chart in Kubernetes&lt;/h2&gt;
&lt;p&gt;Once you have connected to your Kubernetes cluster, you can deploy your Helm chart using the following command:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code class="language-markup"&gt;helm install [INSERT NAME HERE] ./helm-chart/go-k8s/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You should replace the [INSERT NAME HERE] placeholder with the name of your actual Helm chart release. Once the Helm chart has been deployed, you’ll be able to gather a lot of useful information about the chart itself that you can use to better manage your projects moving forward. Once you’ve properly configured your database, you’ll also be able to access your application and continue to work on it.&lt;/p&gt;
</description>
      <pubDate>Mon, 13 Mar 2017 04:00:25 -0700</pubDate>
      <link>https://www.influxdata.com/blog/packaged-kubernetes-deployments-writing-helm-chart/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/packaged-kubernetes-deployments-writing-helm-chart/</guid>
      <category>Developer</category>
      <author>Jack Zampolin (InfluxData)</author>
    </item>
  </channel>
</rss>
