├── grafana ├── build ├── default ├── config.js ├── set_basic_auth.sh ├── Dockerfile ├── run.sh ├── set_elasticsearch.sh ├── set_influx_db.sh ├── README.md └── LICENSE ├── influxdb ├── build ├── start ├── Dockerfile └── config.toml ├── deploy ├── grafana-influxdb-service.json └── grafana-influxdb-pod.json └── README.md /grafana/build: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | docker build -t vish/k8s_grafana . 4 | -------------------------------------------------------------------------------- /influxdb/build: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | docker build -t vish/k8s_influxdb . 4 | -------------------------------------------------------------------------------- /deploy/grafana-influxdb-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "influx-master", 3 | "kind": "Service", 4 | "apiVersion": "v1beta1", 5 | "port": 8085, 6 | "selector": { "name": "influxdb" } 7 | } -------------------------------------------------------------------------------- /influxdb/start: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | docker kill influxdb 4 | docker rm influxdb 5 | 6 | docker run -d \ 7 | -p 8083:8083 \ 8 | -p 8086:8086 \ 9 | -p 8090:8090 \ 10 | -p 8099:8099 \ 11 | -v $PWD/run.sh:/run.sh \ 12 | --name influxdb vish/k8s_influxdb 13 | -------------------------------------------------------------------------------- /grafana/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | root /app; 6 | index index.html index.htm; 7 | 8 | server_name localhost; 9 | 10 | location /ping { 11 | return 200; 12 | } 13 | 14 | location / { 15 | auth_basic "Restricted"; 16 | auth_basic_user_file /app/.htpasswd; 17 | try_files $uri $uri/ =404; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /influxdb/Dockerfile: -------------------------------------------------------------------------------- 1 | # influxdb 2 | 3 | FROM ubuntu 4 | 5 | RUN mkdir -p /opt/influxdb/shared/data 6 | 7 | ADD http://s3.amazonaws.com/influxdb/influxdb_0.8.0-rc.3_amd64.deb /influxdb_latest_amd64.deb 8 | RUN dpkg -i /influxdb_latest_amd64.deb 9 | RUN rm -rf /opt/influxdb/shared/data 10 | 11 | ADD config.toml /opt/influxdb/shared/config.toml 12 | 13 | EXPOSE 8083 8086 8084 8090 8099 14 | 15 | ENTRYPOINT ["/usr/bin/influxdb"] 16 | CMD ["-config=/opt/influxdb/shared/config.toml"] 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | grafana-influxdb-k8s 2 | ==================== 3 | 4 | InfluxDB and Grafana setup in Kubernetes 5 | 6 | This repo contains an example with all the requirements for running an instance of InfluxDB and Grafana in a Kubernetes cluster. This will allow you to monitor your Kubernetes pods by agregating data from all the individual instances. The repo includes all the Docker images required along with the container manifest for starting a pod that runs InfluxDB and Grafana. 7 | 8 | To start the service on Kubernetes (by creating a pod) run: 9 | 10 | ``` 11 | $ cluster/kubecfg.sh -c manifest/grafana-influxdb.json create pods 12 | ``` 13 | -------------------------------------------------------------------------------- /grafana/config.js: -------------------------------------------------------------------------------- 1 | define(['settings'], 2 | function (Settings) { 3 | return new Settings({ 4 | //elasticsearch: "http://"+window.location.hostname+":9200", 5 | datasources: { 6 | influx: { 7 | default: true, 8 | type: 'influxdb', 9 | url: "<--PROTO-->://<--ADDR-->:<--PORT-->/db/<--DB_NAME-->", 10 | username: "<--USER-->", 11 | password: "<--PASS-->", 12 | } 13 | }, 14 | default_route: '/dashboard/file/default.json', 15 | timezoneOffset: null, 16 | grafana_index: "grafana-dash", 17 | unsaved_changes_warning: true, 18 | panel_names: ['text','graphite'] 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /grafana/set_basic_auth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ -f /.basic_auth_configured ]; then 6 | echo "=> Basic HTTP auth has been configured!" 7 | exit 0 8 | fi 9 | 10 | PASS=${HTTP_PASS:-$(pwgen -s 12 1)} 11 | _word=$([ ${HTTP_PASS} ] && echo "preset" || echo "random") 12 | 13 | echo "=> Creating basic auth for \" ${HTTP_USER}\" user with ${_word} password" 14 | echo ${PASS} | htpasswd -i -c /app/.htpasswd ${HTTP_USER} 15 | echo "=> Done!" 16 | touch /.basic_auth_configured 17 | 18 | echo "========================================================================" 19 | echo "You can now connect to Grafana with the following credential:" 20 | echo "" 21 | echo " ${HTTP_USER}:${PASS}" 22 | echo "" 23 | echo "========================================================================" 24 | -------------------------------------------------------------------------------- /deploy/grafana-influxdb-pod.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "influx-grafana", 3 | "kind": "Pod", 4 | "apiVersion": "v1beta1", 5 | "desiredState": { 6 | "manifest": { 7 | "version": "v1beta1", 8 | "id": "influxdb", 9 | "containers": [{ 10 | "name": "influxdb", 11 | "image": "vish/k8s_influxdb", 12 | "ports": [{"containerPort": 8086, "hostPort": 8086}, 13 | {"containerPort": 8083, "hostPort": 8083}, 14 | {"containerPort": 8090, "hostPort": 8090}, 15 | {"containerPort": 8099, "hostPort": 8099}] 16 | }, { 17 | "name": "grafana", 18 | "image": "vish/k8s_grafana", 19 | "ports": [{"containerPort": 80, "hostPort": 80}], 20 | "env": [{"name": HTTP_USER, "value": admin}, 21 | {"name": HTTP_PASS, "value": admin}], 22 | }, { 23 | "name": "elasticsearch", 24 | "image": "dockerfile/elasticsearch", 25 | "ports": [{"containerPort": 9200, "hostPort": 9200}, 26 | {"containerPort": 9300, "hostPort": 9300}], 27 | "env": [{"name": HTTP_USER, "value": admin}, 28 | {"name": HTTP_PASS, "value": admin}], 29 | }] 30 | }, 31 | }, 32 | "labels": { 33 | "name": "influxdb", 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /grafana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tutum/nginx 2 | MAINTAINER Vishnu Kannan 3 | 4 | RUN apt-get update 5 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget pwgen apache2-utils curl 6 | 7 | ENV GRAFANA_VERSION 1.6.1 8 | RUN wget http://grafanarel.s3.amazonaws.com/grafana-${GRAFANA_VERSION}.tar.gz -O grafana.tar.gz 9 | RUN tar zxf grafana.tar.gz && rm grafana.tar.gz && rm -rf app && mv grafana-${GRAFANA_VERSION} app 10 | 11 | ADD config.js /app/config.js 12 | ADD default /etc/nginx/sites-enabled/default 13 | 14 | # Environment variables for HTTP AUTH 15 | ENV HTTP_USER admin 16 | ENV HTTP_PASS **Random** 17 | 18 | ENV INFLUXDB_PROTO http 19 | ENV INFLUXDB_HOST localhost 20 | ENV INFLUXDB_PORT 8086 21 | ENV INFLUXDB_NAME k8s 22 | ENV INFLUXDB_USER root 23 | ENV INFLUXDB_PASS root 24 | 25 | ENV ELASTICSEARCH_PROTO http 26 | ENV ELASTICSEARCH_HOST localhost 27 | ENV ELASTICSEARCH_PORT 9200 28 | ENV ELASTICSEARCH_USER **None** 29 | ENV ELASTICSEARCH_PASS **None** 30 | 31 | 32 | ADD run.sh /run.sh 33 | ADD set_influx_db.sh /set_influx_db.sh 34 | ADD set_basic_auth.sh /set_basic_auth.sh 35 | ADD set_elasticsearch.sh /set_elasticsearch.sh 36 | RUN chmod +x /*.sh 37 | 38 | CMD ["/run.sh"] 39 | -------------------------------------------------------------------------------- /grafana/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | INFLUXDB_PASS=${INFLUXDB_ENV_INFLUXDB_INIT_PWD:-${INFLUXDB_PASS}} 6 | INFLUXDB_PASS=${INFLUXDB_1_ENV_INFLUXDB_INIT_PWD:-${INFLUXDB_PASS}} 7 | 8 | ELASTICSEARCH_USER=${ELASTICSEARCH_ENV_ELASTICSEARCH_USER:-${ELASTICSEARCH_USER}} 9 | ELASTICSEARCH_USER=${ELASTICSEARCH_1_ENV_ELASTICSEARCH_USER:-${ELASTICSEARCH_USER}} 10 | ELASTICSEARCH_PASS=${ELASTICSEARCH_ENV_ELASTICSEARCH_PASS:-${ELASTICSEARCH_PASS}} 11 | ELASTICSEARCH_PASS=${ELASTICSEARCH_1_ENV_ELASTICSEARCH_PASS:-${ELASTICSEARCH_PASS}} 12 | 13 | if [ "${ELASTICSEARCH_HOST}" == "**None**" ]; then 14 | unset ELASTICSEARCH_HOST 15 | fi 16 | 17 | if [ "${ELASTICSEARCH_USER}" == "**None**" ]; then 18 | unset ELASTICSEARCH_USER 19 | fi 20 | 21 | if [ "${ELASTICSEARCH_PASS}" == "**None**" ]; then 22 | unset ELASTICSEARCH_PASS 23 | fi 24 | 25 | if [ "${HTTP_PASS}" == "**Random**" ]; then 26 | unset HTTP_PASS 27 | fi 28 | 29 | if [ ! -f /.basic_auth_configured ]; then 30 | /set_basic_auth.sh 31 | fi 32 | 33 | if [ ! -f /.influx_db_configured ]; then 34 | /set_influx_db.sh 35 | fi 36 | 37 | if [ ! -f /.elasticsearch_configured ]; then 38 | /set_elasticsearch.sh 39 | fi 40 | 41 | echo "=> Starting and running Nginx..." 42 | /usr/sbin/nginx 43 | -------------------------------------------------------------------------------- /grafana/set_elasticsearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ -f /.elasticsearch_configured ]; then 6 | echo "=> Elasticsearch has been configured!" 7 | exit 0 8 | fi 9 | 10 | if [ -n "${ELASTICSEARCH_HOST}" ] && [ -n "${ELASTICSEARCH_PORT}" ]; then 11 | echo "=> Found Elasticsearch settings." 12 | ip=${ELASTICSEARCH_HOST} 13 | if [ "$ip" = "localhost" ]; then 14 | ip=$(curl "http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "X-Google-Metadata-Request: True") 15 | fi 16 | if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then 17 | echo "=> Set Elasticsearch url to \"${ELASTICSEARCH_PROTO}://${ELASTICSEARCH_USER}:${ELASTICSEARCH_PASS}@$ip:${ELASTICSEARCH_PORT}\"." 18 | sed -i "s#.*elasticsearch.*#elasticsearch:\"${ELASTICSEARCH_PROTO}://${ELASTICSEARCH_USER}:${ELASTICSEARCH_PASS}@$ip:${ELASTICSEARCH_PORT}\",#g" /app/config.js 19 | else 20 | echo "=> Set Elasticsearch url to \"${ELASTICSEARCH_PROTO}://$ip:${ELASTICSEARCH_PORT}\"." 21 | sed -i "s#.*elasticsearch.*#elasticsearch:\"${ELASTICSEARCH_PROTO}://$ip:${ELASTICSEARCH_PORT}\",#g" /app/config.js 22 | fi 23 | echo "=> Done!" 24 | else 25 | echo "=> Either address or port of Elasticsearch is not set or empty." 26 | echo "=> Skip setting Elasticsearch." 27 | fi 28 | 29 | touch /.elasticsearch_configured 30 | -------------------------------------------------------------------------------- /grafana/set_influx_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ -f /.influx_db_configured ]; then 5 | echo "=> InfluxDB has been configured!" 6 | exit 0 7 | fi 8 | 9 | dbIP=${INFLUXDB_HOST} 10 | if [ "$dbIP" = "localhost" ]; then 11 | dbIP=$(curl "http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "X-Google-Metadata-Request: True") 12 | elif [ "$dbIP" = "**ChangeMe**" ]; then 13 | echo "=> No address of InfluxDB is specified!" 14 | echo "=> Program terminated!" 15 | exit 1 16 | fi 17 | 18 | if [ "${INFLUXDB_PORT}" = "**ChangeMe**" ]; then 19 | echo "=> No PORT of InfluxDB is specified!" 20 | echo "=> Program terminated!" 21 | exit 1 22 | fi 23 | 24 | echo "=> Configuring InfluxDB" 25 | sed -i -e "s/<--PROTO-->/${INFLUXDB_PROTO}/g" \ 26 | -e "s/<--ADDR-->/$dbIP/g" \ 27 | -e "s/<--PORT-->/${INFLUXDB_PORT}/g" \ 28 | -e "s/<--DB_NAME-->/${INFLUXDB_NAME}/g" \ 29 | -e "s/<--USER-->/${INFLUXDB_USER}/g" \ 30 | -e "s/<--PASS-->/${INFLUXDB_PASS}/g" /app/config.js 31 | touch /.influx_db_configured 32 | echo "=> InfluxDB has been configured as follows:" 33 | echo " InfluxDB ADDRESS: $dbIP" 34 | echo " InfluxDB PORT: ${INFLUXDB_PORT}" 35 | echo " InfluxDB DB NAME: ${INFLUXDB_NAME}" 36 | echo " InfluxDB USERNAME: ${INFLUXDB_USER}" 37 | echo " InfluxDB PASSWORD: ${INFLUXDB_PASS}" 38 | echo " ** Please check your environment variables if you find something is misconfigured. **" 39 | echo "=> Done!" 40 | -------------------------------------------------------------------------------- /influxdb/config.toml: -------------------------------------------------------------------------------- 1 | bind-address = "0.0.0.0" 2 | 3 | [logging] 4 | level = "debug" 5 | file = "/opt/influxdb/shared/data/influxdb.log" # stdout to log to standard out 6 | 7 | [admin] 8 | port = 8083 # binding is disabled if the port isn't set 9 | assets = "/opt/influxdb/current/admin" 10 | 11 | [api] 12 | port = 8086 # binding is disabled if the port isn't set 13 | 14 | read-timeout = "5s" 15 | 16 | [input_plugins] 17 | 18 | [input_plugins.graphite] 19 | enabled = false 20 | 21 | [raft] 22 | port = 8090 23 | dir = "/opt/influxdb/shared/data/raft" 24 | 25 | [storage] 26 | dir = "/opt/influxdb/shared/data/db" 27 | # How many requests to potentially buffer in memory. If the buffer gets filled then writes 28 | # will still be logged and once the local storage has caught up (or compacted) the writes 29 | # will be replayed from the WAL 30 | write-buffer-size = 10000 31 | default-engine = "rocksdb" 32 | max-open-shards = 0 33 | point-batch-size = 100 34 | write-batch-size = 5000000 35 | retention-sweep-period = "10m" 36 | 37 | [storage.engines.rocksdb] 38 | max-open-files = 1000 39 | lru-cache-size = "200m" 40 | 41 | [storage.engines.leveldb] 42 | max-open-files = 1000 43 | lru-cache-size = "200m" 44 | 45 | [cluster] 46 | protobuf_port = 8099 47 | protobuf_timeout = "2s" # the write timeout on the protobuf conn any duration parseable by time.ParseDuration 48 | protobuf_heartbeat = "200ms" # the heartbeat interval between the servers. must be parseable by time.ParseDuration 49 | protobuf_min_backoff = "1s" # the minimum backoff after a failed heartbeat attempt 50 | protobuf_max_backoff = "10s" # the maxmimum backoff after a failed heartbeat attempt 51 | write-buffer-size = 10000 52 | max-response-buffer-size = 100000 53 | concurrent-shard-query-limit = 20 54 | 55 | [sharding] 56 | replication-factor = 1 57 | 58 | [sharding.short-term] 59 | duration = "7d" 60 | split = 1 61 | 62 | [sharding.long-term] 63 | duration = "30d" 64 | split = 1 65 | # split-random = "/^Hf.*/" 66 | 67 | [wal] 68 | dir = "/opt/influxdb/shared/data/wal" 69 | flush-after = 1000 # the number of writes after which wal will be flushed, 0 for flushing on every write 70 | bookmark-after = 1000 # the number of writes after which a bookmark will be created 71 | index-after = 1000 72 | requests-per-logfile = 10000 73 | -------------------------------------------------------------------------------- /grafana/README.md: -------------------------------------------------------------------------------- 1 | tutum-docker-grafana 2 | ==================== 3 | 4 | Grafana dashboard for Influx DB 5 | 6 | 7 | Usage 8 | ----- 9 | To create the image `tutum/grafana`, execute the following command on the tutum-docker-grafana folder: 10 | 11 | docker build -t tutum/grafana . 12 | 13 | To run the image and bind the port: 14 | 15 | docker run -d -p 80:80 tutum/grafana 16 | 17 | The first time that you run your container, a new user `admin` will be created for HTTP basic auth with a random password. To get the password, check the logs of the container by running: 18 | 19 | docker logs 20 | 21 | You will see an output like the following: 22 | ``` 23 | ======================================================================== 24 | You can now connect to Grafana with the following credential: 25 | 26 | admin:ilNfrVn68r1N 27 | 28 | ======================================================================== 29 | ``` 30 | In this case, `ilNfrVn68r1N` is the password allocated to the `admin` user. 31 | 32 | You can now login you to Grafana in your browser: `http://127.0.0.1/` 33 | 34 | 35 | Setting a specific password for Basic HTTP Authentication 36 | --------------------------------------------------------- 37 | 38 | You can specify username and password for HTTP Basic Auth of `tutum/grafana`: 39 | 40 | ``` 41 | HTTP_USER=admin Username for HTTP auth, using admin by default 42 | HTTP_PASS=**Random** Password for HTTP auth. Change it, otherwise system will generate a random password. 43 | ``` 44 | 45 | If you want to user a preset password instead of a random generated one, you can set the environment variable `HTTP_PASS` to you specific password when running the container: 46 | 47 | docker run -d -p 80:80 -e HTTP_USER=admin -e HTTP_PASS=mypass tutum/grafana 48 | 49 | You can now test it: `http://127.0.0.1/` 50 | 51 | 52 | Configure the connection to InfluxDB 53 | ------------------------------------ 54 | 55 | `tutum/grafana` needs to know the information of your InfluxDB for configuration. Please provide the following environment variables when running your Grafana container: 56 | ``` 57 | INFLUXDB_PROTO=http Protocol of your InfluxDB 58 | INFLUXDB_HOST=**ChangeMe** Host of your InfluxDB (without protocol) 59 | INFLUXDB_PORT=8086 Port number of your InfluxDB 60 | INFLUXDB_NAME=**ChangeMe** Database name of your InfluxDB 61 | INFLUXDB_USER=root Username of your InfluxDB 62 | INFLUXDB_PASS=root Password of your InfluxDB 63 | ``` 64 | 65 | Here is an example: 66 | 67 | docker run -d -p 80:80 -e INFLUXDB_HOST=influxdb-1-tifayuki.delta.tutum.io -e INFLUXDB_PORT=8086 -e INFLUXDB_NAME=testdb -e INFLUXDB_USER=root -e INFLUXDB_PASS=root tutum/grafana 68 | 69 | 70 | Configure Elasticsearch to save and load dashboards 71 | --------------------------------------------------- 72 | If you want you use Elasticsearch to save and load you dashboards, you can provide the following environment variables for configuration: 73 | 74 | ``` 75 | ELASTICSEARCH_PROTO=http Protocol of your Elasticsearch 76 | ELASTICSEARCH_HOST=**None** Host of your Elasticsearch (without protocol) 77 | ELASTICSEARCH_PORT=9200 Port number of your Elasticsearch 78 | ELASTICSEARCH_USER=**None** Username for elasticsearch if it has HTTP basic auth enabled (leave it to **None** if no HTTP basic auth is needed) 79 | ELASTICSEARCH_PASS=**None** Password for elasticsearch if it has HTTP basic auth enabled (leave it to **None** if no HTTP basic auth is needed) 80 | ``` 81 | 82 | Here is an example: 83 | 84 | docker run -d -p 80:80 -e INFLUXDB_HOST=influxdb-1-tifayuki.delta.tutum.io -e INFLUXDB_PORT=8086 -e INFLUXDB_NAME=testdb -e INFLUXDB_USER=root -e INFLUXDB_PASS=root -e ELASTICSEARCH_HOST=elasticsearch-1-tifayuki.beta.tutum.io -e ELASTICSEARCH_PORT=9200 -e ELASTICSEARCH_USER=admin -e ELASTICSEARCH_PASS=admin tutum/grafana 85 | 86 | 87 | **by http://www.tutum.co** 88 | -------------------------------------------------------------------------------- /grafana/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2013-2014 Tutum, Inc. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------