From bc4660ef60207d0a87259ca2951aedae29066582 Mon Sep 17 00:00:00 2001 From: Cedric Hauber Date: Wed, 29 Mar 2017 15:44:28 +0200 Subject: [PATCH] v2 --- .gitignore | 4 +- LICENSE | 23 + Makefile | 17 +- README.md | 457 +++++++++++++++++- .../cedbossneo/pidalio/api => api}/Server.go | 0 .../pidalio/etcd => etcd}/Client.go | 0 .../pidalio/glide.lock => glide.lock | 0 .../pidalio/glide.yaml => glide.yaml | 0 init.sh | 49 -- .../descriptors/ceph/ceph-mds-v1-dp.yaml | 74 --- .../ceph/ceph-mon-check-v1-dp.yaml | 64 --- .../descriptors/ceph/ceph-mon-v1-dp.yaml | 95 ---- .../descriptors/ceph/ceph-mon-v1-svc.yaml | 18 - .../descriptors/ceph/ceph-osd-v1-ds-dir.yaml | 79 --- .../descriptors/ceph/ceph-osd-v1-ds-disk.yaml | 76 --- .../descriptors/ceph/ceph-stats-v1-dp.yaml | 58 --- .../descriptors/ceph/ceph-stats-v1-svc.yaml | 17 - kube/kubelet/descriptors/dns/1-skydns.yaml | 157 ------ .../monitoring/1-prometheus-grafana.yaml | 416 ---------------- kube/kubelet/scripts/apiserver-bootstrap.sh | 6 - kube/kubelet/scripts/ceph/50-rbd.rules | 2 - kube/kubelet/scripts/ceph/ceph | 2 - kube/kubelet/scripts/ceph/ceph-disk | 2 - kube/kubelet/scripts/ceph/ceph-rbdnamer | 12 - .../scripts/ceph/install-ceph-tools.sh | 21 - kube/kubelet/scripts/ceph/install-ceph.sh | 21 - .../ceph/keys/ceph.client.admin.keyring | 6 - kube/kubelet/scripts/ceph/keys/ceph.conf | 71 --- .../scripts/ceph/keys/ceph.mds.keyring | 3 - .../scripts/ceph/keys/ceph.mon.keyring | 3 - .../scripts/ceph/keys/ceph.osd.keyring | 3 - .../scripts/ceph/keys/ceph.rgw.keyring | 3 - kube/kubelet/scripts/ceph/rados | 2 - kube/kubelet/scripts/ceph/rbd | 2 - kube/kubelet/scripts/ceph/resolv.conf | 2 - kube/kubelet/scripts/configure-dns.sh | 14 - kube/kubelet/scripts/create-descriptors.sh | 57 --- kube/kubelet/scripts/download-components.sh | 13 - kube/kubelet/scripts/launch-controller.sh | 8 - kube/kubelet/scripts/launch-kubelet.sh | 34 -- kube/kubelet/scripts/launch-proxy.sh | 6 - kube/kubelet/scripts/launch-scheduler.sh | 4 - kube/kubelet/scripts/prepare-units.sh | 6 - kube/kubelet/scripts/prepare-yaml.sh | 9 - kube/kubelet/scripts/retrieve-certificates.sh | 44 -- kube/units/master/pidalio-apiserver.service | 39 -- kube/units/master/pidalio-controller.service | 15 - kube/units/master/pidalio-scheduler.service | 15 - kube/units/pidalio-node.service | 15 - kube/units/pidalio-proxy.service | 15 - kube/units/pidalio.service | 19 - .../cedbossneo/pidalio/main.go => main.go | 0 .../cedbossneo/pidalio/ssl => ssl}/Client.go | 0 templates/baremetal/cloud-config.yaml | 234 --------- templates/gce/cloud-config.yaml | 229 --------- templates/openstack/cloud-config.yaml | 234 --------- .../pidalio/utils => utils}/Crypt.go | 0 57 files changed, 477 insertions(+), 2298 deletions(-) create mode 100644 LICENSE rename {src/github.com/cedbossneo/pidalio/api => api}/Server.go (100%) rename {src/github.com/cedbossneo/pidalio/etcd => etcd}/Client.go (100%) rename src/github.com/cedbossneo/pidalio/glide.lock => glide.lock (100%) rename src/github.com/cedbossneo/pidalio/glide.yaml => glide.yaml (100%) delete mode 100755 init.sh delete mode 100644 kube/kubelet/descriptors/ceph/ceph-mds-v1-dp.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-mon-check-v1-dp.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-mon-v1-dp.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-mon-v1-svc.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-dir.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-disk.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-stats-v1-dp.yaml delete mode 100644 kube/kubelet/descriptors/ceph/ceph-stats-v1-svc.yaml delete mode 100644 kube/kubelet/descriptors/dns/1-skydns.yaml delete mode 100644 kube/kubelet/descriptors/monitoring/1-prometheus-grafana.yaml delete mode 100755 kube/kubelet/scripts/apiserver-bootstrap.sh delete mode 100644 kube/kubelet/scripts/ceph/50-rbd.rules delete mode 100755 kube/kubelet/scripts/ceph/ceph delete mode 100755 kube/kubelet/scripts/ceph/ceph-disk delete mode 100755 kube/kubelet/scripts/ceph/ceph-rbdnamer delete mode 100755 kube/kubelet/scripts/ceph/install-ceph-tools.sh delete mode 100755 kube/kubelet/scripts/ceph/install-ceph.sh delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.client.admin.keyring delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.conf delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.mds.keyring delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.mon.keyring delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.osd.keyring delete mode 100644 kube/kubelet/scripts/ceph/keys/ceph.rgw.keyring delete mode 100755 kube/kubelet/scripts/ceph/rados delete mode 100755 kube/kubelet/scripts/ceph/rbd delete mode 100644 kube/kubelet/scripts/ceph/resolv.conf delete mode 100755 kube/kubelet/scripts/configure-dns.sh delete mode 100755 kube/kubelet/scripts/create-descriptors.sh delete mode 100755 kube/kubelet/scripts/download-components.sh delete mode 100755 kube/kubelet/scripts/launch-controller.sh delete mode 100755 kube/kubelet/scripts/launch-kubelet.sh delete mode 100755 kube/kubelet/scripts/launch-proxy.sh delete mode 100755 kube/kubelet/scripts/launch-scheduler.sh delete mode 100755 kube/kubelet/scripts/prepare-units.sh delete mode 100755 kube/kubelet/scripts/prepare-yaml.sh delete mode 100755 kube/kubelet/scripts/retrieve-certificates.sh delete mode 100644 kube/units/master/pidalio-apiserver.service delete mode 100644 kube/units/master/pidalio-controller.service delete mode 100644 kube/units/master/pidalio-scheduler.service delete mode 100644 kube/units/pidalio-node.service delete mode 100644 kube/units/pidalio-proxy.service delete mode 100644 kube/units/pidalio.service rename src/github.com/cedbossneo/pidalio/main.go => main.go (100%) rename {src/github.com/cedbossneo/pidalio/ssl => ssl}/Client.go (100%) delete mode 100644 templates/baremetal/cloud-config.yaml delete mode 100644 templates/gce/cloud-config.yaml delete mode 100644 templates/openstack/cloud-config.yaml rename {src/github.com/cedbossneo/pidalio/utils => utils}/Crypt.go (100%) diff --git a/.gitignore b/.gitignore index b6d6a4e..d12c44a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,11 @@ *.o *.a *.so - +.idea # Folders _obj _test - +vendor # Architecture specific extensions/prefixes *.[568vq] [568vq].out diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1c27440 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Glide +The Masterminds +Copyright (C) 2014-2016, Matt Butcher and Matt Farina +Copyright (C) 2016, Hewlett Packard Enterprise Development LP +Copyright (C) 2015, Google + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile index efc46f3..e59e0fd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ GOOS := darwin GOARCH := amd64 -GOPATH := $(shell pwd) LGOBIN := $(shell pwd)/bin ENVS := GOOS=$(GOOS) GOARCH=$(GOARCH) GOPATH=$(GOPATH) LGOBIN=$(LGOBIN) .PHONY: core glide test update_deps docker_build docker_pre docker_deps docker_deploy @@ -8,16 +7,16 @@ ENVS := GOOS=$(GOOS) GOARCH=$(GOARCH) GOPATH=$(GOPATH) LGOBIN=$(LGOBIN) default: core core: - $(ENVS) go build -o bin/pidalio-$(GOOS)-$(GOARCH) github.com/cedbossneo/pidalio + $(ENVS) go build -o bin/pidalio-$(GOOS)-$(GOARCH) docker_pre: docker build -t pidalio-build -f dockerfiles/build/Dockerfile dockerfiles/build/ docker_deps: docker_pre - docker run --rm -v "$(PWD)":/usr/src/myapp -w /usr/src/myapp pidalio-build make GOOS=linux deps + docker run --rm -v "$(PWD)":/go/src/github.com/cedbossneo/pidalio -w /go/src/github.com/cedbossneo/pidalio pidalio-build make GOOS=linux deps docker_build: docker_deps - docker run --rm -v "$(PWD)":/usr/src/myapp -w /usr/src/myapp pidalio-build make GOOS=linux + docker run --rm -v "$(PWD)":/go/src/github.com/cedbossneo/pidalio -w /go/src/github.com/cedbossneo/pidalio pidalio-build make GOOS=linux docker_deploy: docker_build cp -f bin/pidalio-linux-amd64 dockerfiles/deploy/ @@ -33,14 +32,10 @@ deps: echo "Glide not installed, downloading" ; \ curl -s -L https://github.com/Masterminds/glide/releases/download/v0.11.1/glide-v0.11.1-$(GOOS)-$(GOARCH).tar.gz | tar -xz --strip=1 && mv ./glide bin/glide ; \ fi ; \ - cd src/github.com/cedbossneo/pidalio ; \ - $(ENVS) $(LGOBIN)/glide install; \ - cd ../../../..; + $(ENVS) $(LGOBIN)/glide install; update_deps: - cd src/github.com/cedbossneo/pidalio ; \ - $(ENVS) $(LGOBIN)/glide update; \ - cd ../../../..; + $(ENVS) $(LGOBIN)/glide update; test: - $(ENVS) go test -v github.com/cedbossneo/pidalio/test/... + $(ENVS) go test -v ... diff --git a/README.md b/README.md index 154b131..39ef0e8 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,456 @@ -# Pidalio +# Glide: Vendor Package Management for Golang -Pidalio is a new way to deploy HA and multi-providers Kubernetes Stack +![glide logo](https://glide.sh/assets/logo-small.png) -It runs on CoreOS and shipped with Ceph Cluster and Prometheus Monitoring out of the box. +Are you used to tools such as Cargo, npm, Composer, Nuget, Pip, Maven, Bundler, +or other modern package managers? If so, Glide is the comparable Go tool. -You can extend your cluster on multiple Cloud Providers or regions just by launching new Coreos Nodes and thell them to join existing peers. +*Manage your vendor and vendored packages with ease.* Glide is a tool for +managing the `vendor` directory within a Go package. This feature, first +introduced in Go 1.5, allows each package to have a `vendor` directory +containing dependent packages for the project. These vendor packages can be +installed by a tool (e.g. glide), similar to `go get` or they can be vendored and +distributed with the package. -It has been tested on OpenStack, Google Compute Engine, Baremetal (for hybrid cluster) and AWS. +[![Build Status](https://travis-ci.org/Masterminds/glide.svg)](https://travis-ci.org/Masterminds/glide) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/glide)](https://goreportcard.com/report/github.com/Masterminds/glide) [![GoDoc](https://godoc.org/github.com/Masterminds/glide?status.svg)](https://godoc.org/github.com/Masterminds/glide) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=stable)](http://glide.readthedocs.org/en/stable/?badge=stable) [![Documentation Status](https://readthedocs.org/projects/glide/badge/?version=latest)](http://glide.readthedocs.org/en/latest/?badge=latest) [![Join the chat at https://gitter.im/Masterminds/glide](https://badges.gitter.im/Masterminds/glide.svg)](https://gitter.im/Masterminds/glide?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Have a look at the templates directory for cloud-config files. +### Features -These variables must be changed in templates are: +* Ease dependency management +* Support **versioning packages** including [Semantic Versioning + 2.0.0](http://semver.org/) support. Any constraint the [`github.com/Masterminds/semver`](https://github.com/Masterminds/semver) + package can parse can be used. +* Support **aliasing packages** (e.g. for working with github forks) +* Remove the need for munging import statements +* Work with all of the `go` tools +* Support the VCS tools that Go supports: + - git + - bzr + - hg + - svn +* Support custom local and global plugins (see docs/plugins.md) +* Repository caching including reuse of packages in the `$GOPATH` +* Flatten dependencies resolving version differences and avoiding the inclusion + of a package multiple times. +* Manage and install dependencies on-demand or vendored in your version control + system. -$PEER$ : The list of nodes to join +## How It Works -$TOKEN$ : A unique token (must be at least 16 chars) +The dependencies for a project are listed in a `glide.yaml` file. This can +include a version, VCS, repository location (that can be different from the +package name), etc. When `glide up` is run it downloads the packages (or updates) +to the `vendor` directory. It then recursively walks through the downloaded +packages looking for those with a `glide.yaml` file (or Godep, gb, gom, or GPM config +file) that don't already have a `vendor` directory and installing their +dependencies to their `vendor` directories. Once Glide has downloaded and figured +out versions to use in the dependency tree it creates a `glide.lock` file +containing the complete dependency tree pinned to specific versions. To install +the correct versions use `glide install`. -Peer must be at least 3 public / private ips of nodes +A projects is structured like this: -More documentation soon. +``` +- $GOPATH/src/myProject (Your project) + | + |-- glide.yaml + | + |-- glide.lock + | + |-- main.go (Your main go code can live here) + | + |-- mySubpackage (You can create your own subpackages, too) + | | + | |-- foo.go + | + |-- vendor + |-- github.com + | + |-- Masterminds + | + |-- ... etc. +``` + +*Take a look at [the Glide source code](http://github.com/Masterminds/glide) +to see this philosophy in action.* + +## Install + +The easiest way to install the latest release on Mac or Linux is with the following script: + +``` +curl https://glide.sh/get | sh +``` + +On Mac OS X you can also install the latest release via [Homebrew](https://github.com/Homebrew/homebrew): + +``` +$ brew install glide +``` + +On Ubuntu Precise(12.04), Trusty (14.04), Wily (15.10) or Xenial (16.04) you can install from our PPA: + +``` +sudo add-apt-repository ppa:masterminds/glide && sudo apt-get update +sudo apt-get install glide +``` + +[Binary packages](https://github.com/Masterminds/glide/releases) are available for Mac, Linux and Windows. + +To build from source you can: + +1. Clone this repository into `$GOPATH/src/github.com/Masterminds/glide` and + change directory into it +2. If you are using Go 1.5 ensure the environment variable GO15VENDOREXPERIMENT is set, for + example by running `export GO15VENDOREXPERIMENT=1`. In Go 1.6 it is enabled by default and + in Go 1.7 it is always enabled without the ability to turn it off. +3. Run `make build` + +This will leave you with `./glide`, which you can put in your `$PATH` if +you'd like. (You can also take a look at `make install` to install for +you.) + +The Glide repo has now been configured to use glide to +manage itself, too. + +## Usage + +``` +$ glide create # Start a new workspace +$ open glide.yaml # and edit away! +$ glide get github.com/Masterminds/cookoo # Get a package and add to glide.yaml +$ glide install # Install packages and dependencies +# work, work, work +$ go build # Go tools work normally +$ glide up # Update to newest versions of the package +``` + +Check out the `glide.yaml` in this directory, or examples in the `docs/` +directory. + +### glide create (aliased to init) + +Initialize a new workspace. Among other things, this creates a `glide.yaml` file +while attempting to guess the packages and versions to put in it. For example, +if your project is using Godep it will use the versions specified there. Glide +is smart enough to scan your codebase and detect the imports being used whether +they are specified with another package manager or not. + +``` +$ glide create +[INFO] Generating a YAML configuration file and guessing the dependencies +[INFO] Attempting to import from other package managers (use --skip-import to skip) +[INFO] Found reference to github.com/Sirupsen/logrus +[INFO] Adding sub-package hooks/syslog to github.com/Sirupsen/logrus +[INFO] Found reference to github.com/boltdb/bolt +[INFO] Found reference to github.com/gorilla/websocket +[INFO] Found reference to github.com/mndrix/ps +[INFO] Found reference to github.com/spf13/cobra +[INFO] Found reference to github.com/spf13/pflag +[INFO] Found reference to github.com/tinylib/msgp/msgp +[INFO] Found reference to github.com/unrolled/secure +[INFO] Found reference to github.com/xeipuuv/gojsonschema +[INFO] Found reference to github.com/zenazn/goji/graceful +[INFO] Adding sub-package web to github.com/zenazn/goji +[INFO] Adding sub-package web/mutil to github.com/zenazn/goji +``` + +### glide get [package name] + +You can download one or more packages to your `vendor` directory and have it added to your +`glide.yaml` file with `glide get`. + +``` +$ glide get github.com/Masterminds/cookoo +``` + +When `glide get` is used it will introspect the listed package to resolve its +dependencies including using Godep, GPM, Gom, and GB config files. + +### glide update (aliased to up) + +Download or update all of the libraries listed in the `glide.yaml` file and put +them in the `vendor` directory. It will also recursively walk through the +dependency packages doing the same thing if no `vendor` directory exists. + +``` +$ glide up +``` + +This will recurse over the packages looking for other projects managed by Glide, +Godep, gb, gom, and GPM. When one is found those packages will be installed as needed. + +A `glide.lock` file will be created or updated with the dependencies pinned to +specific versions. For example, if in the `glide.yaml` file a version was +specified as a range (e.g., `^1.2.3`) it will be set to a specific commit id in +the `glide.lock` file. That allows for reproducible installs (see `glide install`). + +### glide install + +When you want to install the specific versions from the `glide.lock` file use +`glide install`. + +``` +$ glide install +``` + +This will read the `glide.lock` file and install the commit id specific versions +there. + +When the `glide.lock` file doesn't tie to the `glide.yaml` file, such as there +being a change, it will provide a warning. Running `glide up` will recreate the +`glide.lock` file when updating the dependency tree. + +If no `glide.lock` file is present `glide install` will perform an `update` and +generate a lock file. + +## glide novendor (aliased to nv) + +When you run commands like `go test ./...` it will iterate over all the +subdirectories including the `vendor` directory. When you are testing your +application you may want to test your application files without running all the +tests of your dependencies and their dependencies. This is where the `novendor` +command comes in. It lists all of the directories except `vendor`. + + $ go test $(glide novendor) + +This will run `go test` over all directories of your project except the +`vendor` directory. + +## glide name + +When you're scripting with Glide there are occasions where you need to know +the name of the package you're working on. `glide name` returns the name of the +package listed in the `glide.yaml` file. + +### glide rebuild + +Runs `go install` on the packages in the `glide.yaml` file. This +(along with `glide install` and `glide update`) pays special attention +to the contents of the `subpackages:` directive in the YAML file. + +``` +$ glide rebuild +[INFO] Building dependencies. +[INFO] Running go build github.com/kylelemons/go-gypsy/yaml +[INFO] Running go build github.com/Masterminds/cookoo/cli +[INFO] Running go build github.com/Masterminds/cookoo +``` + +This is useful when you are working with large 3rd party libraries. It +will create the `.a` files, which can have a positive impact on your +build times. + +**This feature is deprecated and will be removed before Glide 1.0.0** + +### glide tree + +Glide includes a few commands that inspect code and give you details +about what is imported. `glide tree` is one such command. Running it +gives data like this: + +``` +$ glide tree +github.com/Masterminds/glide + github.com/Masterminds/cookoo (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo) + github.com/Masterminds/cookoo/io (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo/io) + github.com/Masterminds/glide/cmd (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/cmd) + github.com/Masterminds/cookoo (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo) + github.com/Masterminds/cookoo/io (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo/io) + github.com/Masterminds/glide/gb (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/gb) + github.com/Masterminds/glide/util (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/util) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/Masterminds/glide/yaml (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/yaml) + github.com/Masterminds/glide/util (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/util) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + gopkg.in/yaml.v2 (/Users/mfarina/Code/go/src/gopkg.in/yaml.v2) + github.com/Masterminds/semver (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/semver) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/codegangsta/cli (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli) + github.com/codegangsta/cli (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli) + github.com/Masterminds/cookoo (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo) + github.com/Masterminds/cookoo/io (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo/io) + github.com/Masterminds/glide/gb (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/gb) + github.com/Masterminds/glide/util (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/util) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/Masterminds/glide/yaml (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/yaml) + github.com/Masterminds/glide/util (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/util) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + gopkg.in/yaml.v2 (/Users/mfarina/Code/go/src/gopkg.in/yaml.v2) + github.com/Masterminds/semver (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/semver) + github.com/Masterminds/vcs (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs) + github.com/codegangsta/cli (/Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli) +``` + +This shows a tree of imports, excluding core libraries. Because +vendoring makes it possible for the same package to live in multiple +places, `glide tree` also prints the location of the package being +imported. + +### glide list + +Glide's `list` command shows an alphabetized list of all the packages +that a project imports. + +``` +$ glide list +INSTALLED packages: + vendor/github.com/Masterminds/cookoo + vendor/github.com/Masterminds/cookoo/fmt + vendor/github.com/Masterminds/cookoo/io + vendor/github.com/Masterminds/cookoo/web + vendor/github.com/Masterminds/semver + vendor/github.com/Masterminds/vcs + vendor/github.com/codegangsta/cli + vendor/gopkg.in/yaml.v2 +``` + +### glide help + +Print the glide help. + +``` +$ glide help +``` + +### glide --version + +Print the version and exit. + +``` +$ glide --version +glide version 0.8.0 +``` + +### glide.yaml + +The `glide.yaml` file does two critical things: + +1. It names the current package +2. It declares external dependencies + +A brief `glide.yaml` file looks like this: + +```yaml +package: github.com/Masterminds/glide +import: + - package: github.com/Masterminds/semver + - package: github.com/Masterminds/cookoo + vcs: git + version: ^1.2.0 + repo: git@github.com:Masterminds/cookoo.git +``` + +The above tells `glide` that... + +1. This package is named `github.com/Masterminds/glide` +2. That this package depends on two libraries. + + +The first library exemplifies a minimal package import. It merely gives +the fully qualified import path. + +When Glide reads the definition for the second library, it will get the repo +from the source in `repo`, checkout the latest version between 1.2.0 and 2.0.0, +and put it in `github.com/Masterminds/cookoo` in the `vendor` directory. (Note +that `package` and `repo` can be completely different) + +**TIP:** The version is either VCS dependent and can be anything that can be checked +out or a semantic version constraint that can be parsed by the [`github.com/ +Masterminds/semver`](https://github.com/Masterminds/semver) package. +For example, with Git this can be a branch, tag, or hash. This varies and +depends on what's supported in the VCS. + +**TIP:** In general, you are advised to use the *base package name* for +importing a package, not a subpackage name. For example, use +`github.com/kylelemons/go-gypsy` and not +`github.com/kylelemons/go-gypsy/yaml`. + +## Supported Version Control Systems + +The Git, SVN, Mercurial (Hg), and Bzr source control systems are supported. This +happens through the [vcs package](https://github.com/masterminds/vcs). + +## Frequently Asked Questions (F.A.Q.) + +#### Q: Why does Glide have the concept of sub-packages when Go doesn't? + +In Go every directory is a package. This works well when you have one repo +containing all of your packages. When you have different packages in different +VCS locations things become a bit more complicated. A project containing a +collection of packages should be handled with the same information including +the version. By grouping packages this way we are able to manage the related +information. + +#### Q: bzr (or hg) is not working the way I expected. Why? + +These are works in progress, and may need some additional tuning. Please +take a look at the [vcs package](https://github.com/masterminds/vcs). If you +see a better way to handle it please let us know. + +#### Q: Should I check `vendor/` into version control? + +That's up to you. It's not necessary, but it may also cause you extra +work and lots of extra space in your VCS. There may also be unforeseen errors +([see an example](https://github.com/mattfarina/golang-broken-vendor)). + +#### Q: How do I import settings from GPM, Godep, gom or gb? + +There are two parts to importing. + +1. If a package you import has configuration for GPM, Godep, gom or gb Glide will + recursively install the dependencies automatically. +2. If you would like to import configuration from GPM, Godep, gom or gb to Glide see + the `glide import` command. For example, you can run `glide import godep` for + Glide to detect the projects Godep configuration and generate a `glide.yaml` + file for you. + +Each of these will merge your existing `glide.yaml` file with the +dependencies it finds for those managers, and then emit the file as +output. **It will not overwrite your glide.yaml file.** + +You can write it to file like this: + +``` +$ glide import godep -f glide.yaml +``` + +#### Q: Can Glide fetch a package based on OS or Arch? + +A: Yes. Using the `os` and `arch` fields on a `package`, you can specify +which OSes and architectures the package should be fetched for. For +example, the following package will only be fetched for 64-bit +Darwin/OSX systems: + +```yaml +- package: some/package + os: + - darwin + arch: + - amd64 +``` + +The package will not be fetched for other architectures or OSes. + +## LICENSE + +This package is made available under an MIT-style license. See +LICENSE.txt. + +## Thanks! + +We owe a huge debt of gratitude to the [GPM and +GVP](https://github.com/pote/gpm) projects, which +inspired many of the features of this package. If `glide` isn't the +right Go project manager for you, check out those. + +The Composer (PHP), npm (JavaScript), and Bundler (Ruby) projects all +inspired various aspects of this tool, as well. + +## The Name + +Aside from being catchy, "glide" is a contraction of "Go Elide". The +idea is to compress the tasks that normally take us lots of time into a +just a few seconds. diff --git a/src/github.com/cedbossneo/pidalio/api/Server.go b/api/Server.go similarity index 100% rename from src/github.com/cedbossneo/pidalio/api/Server.go rename to api/Server.go diff --git a/src/github.com/cedbossneo/pidalio/etcd/Client.go b/etcd/Client.go similarity index 100% rename from src/github.com/cedbossneo/pidalio/etcd/Client.go rename to etcd/Client.go diff --git a/src/github.com/cedbossneo/pidalio/glide.lock b/glide.lock similarity index 100% rename from src/github.com/cedbossneo/pidalio/glide.lock rename to glide.lock diff --git a/src/github.com/cedbossneo/pidalio/glide.yaml b/glide.yaml similarity index 100% rename from src/github.com/cedbossneo/pidalio/glide.yaml rename to glide.yaml diff --git a/init.sh b/init.sh deleted file mode 100755 index 2de2041..0000000 --- a/init.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash -set -e -source /etc/pidalio.env -/opt/pidalio/kube/kubelet/scripts/download-components.sh -/opt/pidalio/kube/kubelet/scripts/prepare-units.sh -if [[ "${CEPH}" == "True" ]] -then - /opt/pidalio/kube/kubelet/scripts/ceph/install-ceph-tools.sh - docker pull ceph/base -fi -docker pull cedbossneo/docker-etcd-rclone -export DOCKER_HOST=unix:///var/run/weave/weave.sock - -function handleExistingEtcd { - EXISTING_ETCD=$(/opt/bin/weave dns-lookup etcd) - echo "Testing $EXISTING_ETCD" - curl -s -m 1 http://${EXISTING_ETCD}:2379/v2/stats/self - if [ $? -eq 0 ] - then - echo "Etcd $EXISTING_ETCD alive"; - else - echo "Etcd $EXISTING_ETCD did not come up...exiting" - exit 1 - fi - docker run --rm --name=etcd-proxy -p 2379:2379 -p 2380:2380 -p 4001:4001 cedbossneo/docker-etcd-rclone /proxy.sh ${EXISTING_ETCD} -} - -function handleNonExistingEtcd { - SLEEP_TIME=$(expr $RANDOM % 50) - echo "Sleeping $SLEEP_TIME seconds" - sleep ${SLEEP_TIME} - EXISTING_ETCD=$(/opt/bin/weave dns-lookup etcd) - echo "Existing ETCD: $EXISTING_ETCD" - if [[ "$EXISTING_ETCD" == "" ]] - then - docker run -e TOKEN=${PIDALIO_TOKEN} -v /etc/pidalio.etcd.rclone.conf:/root/.rclone.conf --rm --name=etcd -p 2379:2379 -p 2380:2380 -p 4001:4001 cedbossneo/docker-etcd-rclone - else - handleExistingEtcd - fi -} - -EXISTING_ETCD=$(/opt/bin/weave dns-lookup etcd) -echo "Existing ETCD: $EXISTING_ETCD" -if [[ "$EXISTING_ETCD" == "" ]] -then - handleNonExistingEtcd -else - handleExistingEtcd -fi diff --git a/kube/kubelet/descriptors/ceph/ceph-mds-v1-dp.yaml b/kube/kubelet/descriptors/ceph/ceph-mds-v1-dp.yaml deleted file mode 100644 index 2bff493..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-mds-v1-dp.yaml +++ /dev/null @@ -1,74 +0,0 @@ ---- -kind: Deployment -apiVersion: extensions/v1beta1 -metadata: - labels: - app: ceph - daemon: mds - name: ceph-mds - namespace: ceph -spec: - replicas: 1 - template: - metadata: - name: ceph-mds - namespace: ceph - labels: - app: ceph - daemon: mds - spec: - nodeSelector: - storage: "true" - serviceAccount: default - volumes: - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: ceph-mon - image: ceph/daemon:latest - ports: - - containerPort: 6800 - env: - - name: CEPH_DAEMON - value: MDS - - name: CEPHFS_CREATE - value: "1" - - name: KV_TYPE - value: k8s - - name: CLUSTER - value: ceph - volumeMounts: - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - livenessProbe: - tcpSocket: - port: 6800 - initialDelaySeconds: 60 - timeoutSeconds: 5 - readinessProbe: - tcpSocket: - port: 6800 - timeoutSeconds: 5 - resources: - requests: - memory: "10Mi" - cpu: "250m" - limits: - memory: "50Mi" - cpu: "500m" diff --git a/kube/kubelet/descriptors/ceph/ceph-mon-check-v1-dp.yaml b/kube/kubelet/descriptors/ceph/ceph-mon-check-v1-dp.yaml deleted file mode 100644 index a349265..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-mon-check-v1-dp.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -kind: Deployment -apiVersion: extensions/v1beta1 -metadata: - labels: - app: ceph - daemon: moncheck - name: ceph-mon-check - namespace: ceph -spec: - replicas: 1 - template: - metadata: - name: ceph-mon - namespace: ceph - labels: - app: ceph - daemon: moncheck - spec: - serviceAccount: default - volumes: - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: ceph-mon - image: ceph/daemon:latest - imagePullPolicy: Always - ports: - - containerPort: 6789 - env: - - name: CEPH_DAEMON - value: MON_HEALTH - - name: KV_TYPE - value: k8s - - name: MON_IP_AUTO_DETECT - value: "1" - - name: CLUSTER - value: ceph - volumeMounts: - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - resources: - requests: - memory: "5Mi" - cpu: "250m" - limits: - memory: "50Mi" - cpu: "500m" diff --git a/kube/kubelet/descriptors/ceph/ceph-mon-v1-dp.yaml b/kube/kubelet/descriptors/ceph/ceph-mon-v1-dp.yaml deleted file mode 100644 index 38256e7..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-mon-v1-dp.yaml +++ /dev/null @@ -1,95 +0,0 @@ ---- -kind: Deployment -apiVersion: extensions/v1beta1 -metadata: - labels: - app: ceph - daemon: mon - name: ceph-mon - namespace: ceph -spec: - replicas: 3 - template: - metadata: - name: ceph-mon - namespace: ceph - labels: - app: ceph - daemon: mon - annotations: - scheduler.alpha.kubernetes.io/affinity: > - { - "podAntiAffinity": { - "RequiredDuringSchedulingIgnoredDuringExecution": [{ - "labelSelector": { - "matchExpressions": [{ - "key": "daemon", - "operator": "In", - "values":["mon"] - }] - }, - "topologyKey": "kubernetes.io/hostname" - }] - } - } - spec: - serviceAccount: default - volumes: - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: ceph-mon - image: ceph/daemon:latest -# imagePullPolicy: Always - lifecycle: - preStop: - exec: - # remove the mon on Pod stop. - command: - - "/remove-mon.sh" - ports: - - containerPort: 6789 - env: - - name: CEPH_DAEMON - value: MON - - name: KV_TYPE - value: k8s - - name: NETWORK_AUTO_DETECT - value: "1" - - name: CLUSTER - value: ceph - volumeMounts: - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - livenessProbe: - tcpSocket: - port: 6789 - initialDelaySeconds: 60 - timeoutSeconds: 5 - readinessProbe: - tcpSocket: - port: 6789 - timeoutSeconds: 5 - resources: - requests: - memory: "50Mi" - cpu: "100m" - limits: - memory: "100Mi" - cpu: "200m" diff --git a/kube/kubelet/descriptors/ceph/ceph-mon-v1-svc.yaml b/kube/kubelet/descriptors/ceph/ceph-mon-v1-svc.yaml deleted file mode 100644 index 79fc890..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-mon-v1-svc.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: ceph-mon - namespace: ceph - labels: - app: ceph - daemon: mon -spec: - ports: - - port: 6789 - protocol: TCP - targetPort: 6789 - selector: - app: ceph - daemon: mon - clusterIP: None diff --git a/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-dir.yaml b/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-dir.yaml deleted file mode 100644 index 1a65245..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-dir.yaml +++ /dev/null @@ -1,79 +0,0 @@ ---- -kind: DaemonSet -apiVersion: extensions/v1beta1 -metadata: - name: ceph-osd - namespace: ceph - labels: - app: ceph - daemon: osd -spec: - template: - metadata: - labels: - app: ceph - daemon: osd - spec: - nodeSelector: - storage: "true" - volumes: - - name: devices - hostPath: - path: /dev - - name: ceph - hostPath: - path: /opt/ceph - - name: osd-directory - hostPath: - path: /opt/ceph-osd - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: osd-pod - image: ceph/daemon:latest - imagePullPolicy: Always - volumeMounts: - - name: devices - mountPath: /dev - - name: ceph - mountPath: /var/lib/ceph - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - - name: osd-directory - mountPath: /var/lib/ceph/osd - securityContext: - privileged: true - env: - - name: CEPH_DAEMON - value: osd_directory - - name: KV_TYPE - value: k8s - - name: CLUSTER - value: ceph - - name: CEPH_GET_ADMIN_KEY - value: "1" - livenessProbe: - tcpSocket: - port: 6800 - initialDelaySeconds: 60 - timeoutSeconds: 5 - readinessProbe: - tcpSocket: - port: 6800 - timeoutSeconds: 5 diff --git a/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-disk.yaml b/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-disk.yaml deleted file mode 100644 index 3524dfa..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-osd-v1-ds-disk.yaml +++ /dev/null @@ -1,76 +0,0 @@ ---- -kind: DaemonSet -apiVersion: extensions/v1beta1 -metadata: - name: ceph-osd - namespace: ceph - labels: - app: ceph - daemon: osd -spec: - template: - metadata: - labels: - app: ceph - daemon: osd - spec: - nodeSelector: - storage: "true" - volumes: - - name: devices - hostPath: - path: /dev - - name: ceph - hostPath: - path: /opt/ceph - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: osd-pod - image: ceph/daemon:latest - imagePullPolicy: Always - volumeMounts: - - name: devices - mountPath: /dev - - name: ceph - mountPath: /var/lib/ceph - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - securityContext: - privileged: true - env: - - name: CEPH_DAEMON - value: osd_ceph_disk - - name: OSD_DEVICE - value: $CEPH_DISK_DEVICE$ - - name: KV_TYPE - value: k8s - - name: CLUSTER - value: ceph - - name: CEPH_GET_ADMIN_KEY - value: "1" - livenessProbe: - tcpSocket: - port: 6800 - initialDelaySeconds: 60 - timeoutSeconds: 5 - readinessProbe: - tcpSocket: - port: 6800 - timeoutSeconds: 5 diff --git a/kube/kubelet/descriptors/ceph/ceph-stats-v1-dp.yaml b/kube/kubelet/descriptors/ceph/ceph-stats-v1-dp.yaml deleted file mode 100644 index f1b8118..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-stats-v1-dp.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -kind: Deployment -apiVersion: extensions/v1beta1 -metadata: - labels: - app: ceph - daemon: exporter - name: ceph-exporter - namespace: ceph -spec: - replicas: 1 - template: - metadata: - name: ceph-exporter - namespace: ceph - labels: - app: ceph - daemon: exporter - spec: - nodeSelector: - storage: "true" - serviceAccount: default - volumes: - - name: ceph-conf - secret: - secretName: ceph-conf-combined - - name: ceph-bootstrap-osd-keyring - secret: - secretName: ceph-bootstrap-osd-keyring - - name: ceph-bootstrap-mds-keyring - secret: - secretName: ceph-bootstrap-mds-keyring - - name: ceph-bootstrap-rgw-keyring - secret: - secretName: ceph-bootstrap-rgw-keyring - containers: - - name: ceph-exporter - image: cedbossneo/ceph_exporter:latest - ports: - - containerPort: 9128 - volumeMounts: - - name: ceph-conf - mountPath: /etc/ceph - - name: ceph-bootstrap-osd-keyring - mountPath: /var/lib/ceph/bootstrap-osd - - name: ceph-bootstrap-mds-keyring - mountPath: /var/lib/ceph/bootstrap-mds - - name: ceph-bootstrap-rgw-keyring - mountPath: /var/lib/ceph/bootstrap-rgw - livenessProbe: - tcpSocket: - port: 9128 - initialDelaySeconds: 20 - timeoutSeconds: 5 - readinessProbe: - tcpSocket: - port: 9128 - timeoutSeconds: 5 diff --git a/kube/kubelet/descriptors/ceph/ceph-stats-v1-svc.yaml b/kube/kubelet/descriptors/ceph/ceph-stats-v1-svc.yaml deleted file mode 100644 index 095a3eb..0000000 --- a/kube/kubelet/descriptors/ceph/ceph-stats-v1-svc.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: ceph-exporter - namespace: ceph - labels: - app: ceph - daemon: exporter -spec: - ports: - - port: 9128 - protocol: TCP - targetPort: 9128 - selector: - app: ceph - daemon: exporter diff --git a/kube/kubelet/descriptors/dns/1-skydns.yaml b/kube/kubelet/descriptors/dns/1-skydns.yaml deleted file mode 100644 index c6695f0..0000000 --- a/kube/kubelet/descriptors/dns/1-skydns.yaml +++ /dev/null @@ -1,157 +0,0 @@ -apiVersion: v1 -kind: List -items: - - apiVersion: v1 - kind: Service - metadata: - name: kube-dns - namespace: kube-system - labels: - k8s-app: kube-dns - kubernetes.io/cluster-service: "true" - kubernetes.io/name: "KubeDNS" - spec: - selector: - k8s-app: kube-dns - clusterIP: 10.244.0.3 - ports: - - name: dns - port: 53 - protocol: UDP - - name: dns-tcp - port: 53 - protocol: TCP - - apiVersion: extensions/v1beta1 - kind: Deployment - metadata: - name: kube-dns - namespace: kube-system - labels: - k8s-app: kube-dns - kubernetes.io/cluster-service: "true" - spec: - strategy: - rollingUpdate: - maxSurge: 10% - maxUnavailable: 0 - selector: - matchLabels: - k8s-app: kube-dns - template: - metadata: - labels: - k8s-app: kube-dns - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]' - spec: - containers: - - name: kubedns - image: gcr.io/google_containers/kubedns-amd64:1.9 - resources: - limits: - memory: 170Mi - requests: - cpu: 100m - memory: 70Mi - livenessProbe: - httpGet: - path: /healthz-kubedns - port: 8080 - scheme: HTTP - initialDelaySeconds: 60 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 5 - readinessProbe: - httpGet: - path: /readiness - port: 8081 - scheme: HTTP - initialDelaySeconds: 3 - timeoutSeconds: 5 - args: - - --domain=$domain$. - - --dns-port=10053 - - --config-map=kube-dns - - --v=0 - env: - - name: PROMETHEUS_PORT - value: "10055" - ports: - - containerPort: 10053 - name: dns-local - protocol: UDP - - containerPort: 10053 - name: dns-tcp-local - protocol: TCP - - containerPort: 10055 - name: metrics - protocol: TCP - - name: dnsmasq - image: gcr.io/google_containers/kube-dnsmasq-amd64:1.4 - livenessProbe: - httpGet: - path: /healthz-dnsmasq - port: 8080 - scheme: HTTP - initialDelaySeconds: 60 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 5 - args: - - --cache-size=1000 - - --no-resolv - - --server=127.0.0.1#10053 - - --log-facility=- - ports: - - containerPort: 53 - name: dns - protocol: UDP - - containerPort: 53 - name: dns-tcp - protocol: TCP - resources: - requests: - cpu: 150m - memory: 10Mi - - name: dnsmasq-metrics - image: gcr.io/google_containers/dnsmasq-metrics-amd64:1.0 - livenessProbe: - httpGet: - path: /metrics - port: 10054 - scheme: HTTP - initialDelaySeconds: 60 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 5 - args: - - --v=2 - - --logtostderr - ports: - - containerPort: 10054 - name: metrics - protocol: TCP - resources: - requests: - memory: 10Mi - - name: healthz - image: gcr.io/google_containers/exechealthz-amd64:1.2 - resources: - limits: - memory: 50Mi - requests: - cpu: 10m - memory: 50Mi - args: - - --cmd=nslookup kubernetes.default.svc.$domain$ 127.0.0.1 >/dev/null - - --url=/healthz-dnsmasq - - --cmd=nslookup kubernetes.default.svc.$domain$ 127.0.0.1:10053 >/dev/null - - --url=/healthz-kubedns - - --port=8080 - - --quiet - ports: - - containerPort: 8080 - protocol: TCP - dnsPolicy: Default \ No newline at end of file diff --git a/kube/kubelet/descriptors/monitoring/1-prometheus-grafana.yaml b/kube/kubelet/descriptors/monitoring/1-prometheus-grafana.yaml deleted file mode 100644 index 1fed9e6..0000000 --- a/kube/kubelet/descriptors/monitoring/1-prometheus-grafana.yaml +++ /dev/null @@ -1,416 +0,0 @@ -# Derived from ./manifests/*.yaml ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: grafana-core - labels: - app: grafana - component: core -spec: - replicas: 1 - template: - metadata: - labels: - app: grafana - component: core - spec: - containers: - - image: grafana/grafana:3.1.1 - name: grafana-core - # env: - resources: - # keep request = limit to keep this container in guaranteed class - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 100m - memory: 100Mi - env: - # This variable is required to setup templates in Grafana. - # The following env variables are required to make Grafana accessible via - # the kubernetes api-server proxy. On production clusters, we recommend - # removing these env variables, setup auth for grafana, and expose the grafana - # service using a LoadBalancer or a public IP. - - name: GF_AUTH_BASIC_ENABLED - value: "false" - - name: GF_AUTH_ANONYMOUS_ENABLED - value: "true" - - name: GF_AUTH_ANONYMOUS_ORG_ROLE - value: Admin - # - name: GF_SERVER_ROOT_URL - # value: /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/ - volumeMounts: - - name: grafana-persistent-storage - mountPath: /var - volumes: - - name: grafana-persistent-storage - rbd: - monitors: - - ceph-mon.ceph:6789 - user: admin - image: grafana - pool: rbd - secretRef: - name: ceph-admin-key ---- -apiVersion: v1 -kind: Service -metadata: - name: grafana - labels: - app: grafana - component: core - # annotations: - # prometheus.io/scrape: 'true' -spec: - type: NodePort - ports: - - port: 3000 - nodePort: 31000 - selector: - app: grafana - component: core ---- -# based on the content created by: -# kubectl create configmap grafana-import-dashboards --from-file=manifests/grafana-import-dashboards-configmap --output yaml - -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-import-dashboards - labels: - app: grafana - component: import-dashboards -data: - grafana-net-ceph-dashboard.json: | - {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"singlestat","name":"Singlestat","version":""},{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Ceph dashboard","tags":[],"style":"dark","timezone":"browser","editable":true,"hideControls":false,"sharedCrosshair":false,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"id":1,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":true},"targets":[{"expr":"ceph_cluster_used_bytes / ceph_cluster_capacity_bytes * 100","intervalFactor":2,"refId":"A","step":4}],"thresholds":"","title":"Cluster usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"avg"}],"showTitle":true,"title":"Ceph overview"},{"collapse":false,"editable":true,"height":"150px","panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"id":2,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"ceph_monitor_quorum_count","intervalFactor":2,"refId":"A","step":4}],"thresholds":"","title":"Monitors","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"avg"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","decimals":null,"editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"id":3,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"ceph_cluster_capacity_bytes","intervalFactor":2,"legendFormat":"","refId":"A","step":4}],"thresholds":"","title":"Capacity","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"id":4,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"ceph_cluster_used_bytes","intervalFactor":2,"legendFormat":"","refId":"A","step":4}],"thresholds":"","title":"Usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"avg"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"id":6,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"ceph_osds","intervalFactor":2,"refId":"A","step":4}],"thresholds":"","title":"OSDs","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"avg"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":5,"isNew":true,"legend":{"alignAsTable":true,"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"ceph_osd_utilization","intervalFactor":2,"legendFormat":"{{ osd }}","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"OSDs Usage","tooltip":{"msResolution":true,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"percent","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":7,"isNew":true,"legend":{"alignAsTable":true,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"ceph_pool_used_bytes","intervalFactor":2,"legendFormat":"{{ pool }}","metric":"","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Pools Usage","tooltip":{"msResolution":true,"shared":false,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":"","logBase":1,"max":null,"min":null,"show":true},{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":8,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":false,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"ceph_degraded_objects","intervalFactor":2,"metric":"ceph_degraded_objects","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Degraded objects","tooltip":{"msResolution":true,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"},{"title":"New row","height":"250px","editable":true,"collapse":false,"panels":[{"title":"IOPS","error":false,"span":12,"editable":true,"type":"graph","isNew":true,"id":9,"targets":[{"refId":"A","expr":"ceph_client_io_read_ops","intervalFactor":2,"metric":"ceph_client_io_read_ops","step":2},{"refId":"B","expr":"ceph_client_io_write_ops","intervalFactor":2,"metric":"ceph_client_io_write_ops","step":2}],"datasource":"${DS_PROMETHEUS}","renderer":"flot","yaxes":[{"label":null,"show":true,"logBase":1,"min":null,"max":null,"format":"iops"},{"label":null,"show":true,"logBase":1,"min":null,"max":null,"format":"short"}],"xaxis":{"show":true},"grid":{"threshold1":null,"threshold2":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2Color":"rgba(234, 112, 112, 0.22)"},"lines":true,"fill":1,"linewidth":2,"points":false,"pointradius":5,"bars":false,"stack":false,"percentage":false,"legend":{"show":false,"values":false,"min":false,"max":false,"current":false,"total":false,"avg":false},"nullPointMode":"connected","steppedLine":false,"tooltip":{"value_type":"cumulative","shared":true,"sort":0,"msResolution":true},"timeFrom":null,"timeShift":null,"aliasColors":{},"seriesOverrides":[],"links":[]}]},{"title":"New row","height":"250px","editable":true,"collapse":false,"panels":[{"title":"IO","error":false,"span":12,"editable":true,"type":"graph","isNew":true,"id":10,"targets":[{"refId":"A","expr":"ceph_client_io_read_bytes","intervalFactor":2,"metric":"ceph_client_io_read_bytes","step":2},{"refId":"B","expr":"ceph_client_io_write_bytes","intervalFactor":2,"metric":"ceph_client_io_read_bytes","step":2}],"datasource":"${DS_PROMETHEUS}","renderer":"flot","yaxes":[{"label":null,"show":true,"logBase":1,"min":null,"max":null,"format":"Bps"},{"label":null,"show":true,"logBase":1,"min":null,"max":null,"format":"short"}],"xaxis":{"show":true},"grid":{"threshold1":null,"threshold2":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2Color":"rgba(234, 112, 112, 0.22)"},"lines":true,"fill":1,"linewidth":2,"points":false,"pointradius":5,"bars":false,"stack":false,"percentage":false,"legend":{"show":false,"values":false,"min":false,"max":false,"current":false,"total":false,"avg":false},"nullPointMode":"connected","steppedLine":false,"tooltip":{"value_type":"cumulative","shared":true,"sort":0,"msResolution":true},"timeFrom":null,"timeShift":null,"aliasColors":{},"seriesOverrides":[],"links":[]}]}],"time":{"from":"now-5m","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"templating":{"list":[]},"annotations":{"list":[]},"refresh":"5s","schemaVersion":12,"version":2,"links":[],"gnetId":null},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} - grafana-net-2-dashboard.json: | - {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"singlestat","name":"Singlestat","version":""},{"type":"panel","id":"text","name":"Text","version":""},{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.0"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Prometheus Stats","tags":[],"style":"dark","timezone":"browser","editable":true,"hideControls":true,"sharedCrosshair":false,"rows":[{"collapse":false,"editable":true,"height":178,"panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","decimals":1,"editable":true,"error":false,"format":"s","id":5,"interval":null,"links":[],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"(time() - process_start_time_seconds{job=\"prometheus\"})","intervalFactor":2,"refId":"A","step":4}],"thresholds":"","title":"Uptime","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current","mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"rangeMaps":[{"from":"null","to":"null","text":"N/A"}],"mappingType":1,"gauge":{"show":false,"minValue":0,"maxValue":100,"thresholdMarkers":true,"thresholdLabels":false}},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","id":6,"interval":null,"links":[],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":true},"targets":[{"expr":"prometheus_local_storage_memory_series","intervalFactor":2,"refId":"A","step":4}],"thresholds":"1,5","title":"Local Storage Memory Series","type":"singlestat","valueFontSize":"70%","valueMaps":[],"valueName":"current","mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"rangeMaps":[{"from":"null","to":"null","text":"N/A"}],"mappingType":1,"gauge":{"show":false,"minValue":0,"maxValue":100,"thresholdMarkers":true,"thresholdLabels":false}},{"cacheTimeout":null,"colorBackground":false,"colorValue":true,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","id":7,"interval":null,"links":[],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","span":3,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":true},"targets":[{"expr":"prometheus_local_storage_indexing_queue_length","intervalFactor":2,"refId":"A","step":4}],"thresholds":"500,4000","title":"Interal Storage Queue Length","type":"singlestat","valueFontSize":"70%","valueMaps":[{"op":"=","text":"Empty","value":"0"}],"valueName":"current","mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"rangeMaps":[{"from":"null","to":"null","text":"N/A"}],"mappingType":1,"gauge":{"show":false,"minValue":0,"maxValue":100,"thresholdMarkers":true,"thresholdLabels":false}},{"content":"\"Prometheus\nPrometheus\n\n

You're using Prometheus, an open-source systems monitoring and alerting toolkit originally built at SoundCloud. For more information, check out the Grafana and Prometheus projects.

","editable":true,"error":false,"id":9,"links":[],"mode":"html","span":3,"style":{},"title":"","transparent":true,"type":"text"}],"title":"New row"},{"collapse":false,"editable":true,"height":227,"panels":[{"aliasColors":{"prometheus":"#C15C17","{instance=\"localhost:9090\",job=\"prometheus\"}":"#C15C17"},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":3,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":2,"points":false,"renderer":"flot","seriesOverrides":[],"span":9,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(prometheus_local_storage_ingested_samples_total[5m])","interval":"","intervalFactor":2,"legendFormat":"{{job}}","metric":"","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Samples ingested (rate-5m)","tooltip":{"shared":true,"value_type":"cumulative","ordering":"alphabetical","msResolution":false},"type":"graph","yaxes":[{"show":true,"min":null,"max":null,"logBase":1,"format":"short"},{"show":true,"min":null,"max":null,"logBase":1,"format":"short"}],"xaxis":{"show":true}},{"content":"#### Samples Ingested\nThis graph displays the count of samples ingested by the Prometheus server, as measured over the last 5 minutes, per time series in the range vector. When troubleshooting an issue on IRC or Github, this is often the first stat requested by the Prometheus team. ","editable":true,"error":false,"id":8,"links":[],"mode":"markdown","span":2.995914043583536,"style":{},"title":"","transparent":true,"type":"text"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{"prometheus":"#F9BA8F","{instance=\"localhost:9090\",interval=\"5s\",job=\"prometheus\"}":"#F9BA8F"},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":2,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":5,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(prometheus_target_interval_length_seconds_count[5m])","intervalFactor":2,"legendFormat":"{{job}}","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Target Scrapes (last 5m)","tooltip":{"shared":true,"value_type":"cumulative","ordering":"alphabetical","msResolution":false},"type":"graph","yaxes":[{"show":true,"min":null,"max":null,"logBase":1,"format":"short"},{"show":true,"min":null,"max":null,"logBase":1,"format":"short"}],"xaxis":{"show":true}},{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":14,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":4,"stack":false,"steppedLine":false,"targets":[{"expr":"prometheus_target_interval_length_seconds{quantile!=\"0.01\", quantile!=\"0.05\"}","interval":"","intervalFactor":2,"legendFormat":"{{quantile}} ({{interval}})","metric":"","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Scrape Duration","tooltip":{"shared":true,"value_type":"cumulative","ordering":"alphabetical","msResolution":false},"type":"graph","yaxes":[{"show":true,"min":null,"max":null,"logBase":1,"format":"short"},{"show":true,"min":null,"max":null,"logBase":1,"format":"short"}],"xaxis":{"show":true}},{"content":"#### Scrapes\nPrometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs. Target scrapes will show how frequently targets are scraped, as measured over the last 5 minutes, per time series in the range vector. Scrape Duration will show how long the scrapes are taking, with percentiles available as series. ","editable":true,"error":false,"id":11,"links":[],"mode":"markdown","span":3,"style":{},"title":"","transparent":true,"type":"text"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":null,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":12,"legend":{"alignAsTable":false,"avg":false,"current":false,"hideEmpty":true,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":9,"stack":false,"steppedLine":false,"targets":[{"expr":"prometheus_evaluator_duration_milliseconds{quantile!=\"0.01\", quantile!=\"0.05\"}","interval":"","intervalFactor":2,"legendFormat":"{{quantile}}","refId":"A","step":2}],"timeFrom":null,"timeShift":null,"title":"Rule Eval Duration","tooltip":{"shared":true,"value_type":"cumulative","ordering":"alphabetical","msResolution":false},"type":"graph","yaxes":[{"show":true,"min":null,"max":null,"logBase":1,"format":"percentunit","label":""},{"show":true,"min":null,"max":null,"logBase":1,"format":"short"}],"xaxis":{"show":true}},{"content":"#### Rule Evaluation Duration\nThis graph panel plots the duration for all evaluations to execute. The 50th percentile, 90th percentile and 99th percentile are shown as three separate series to help identify outliers that may be skewing the data.","editable":true,"error":false,"id":15,"links":[],"mode":"markdown","span":3,"style":{},"title":"","transparent":true,"type":"text"}],"title":"New row"}],"time":{"from":"now-5m","to":"now"},"timepicker":{"now":true,"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"templating":{"list":[]},"annotations":{"list":[]},"refresh":false,"schemaVersion":12,"version":0,"links":[{"icon":"info","tags":[],"targetBlank":true,"title":"Grafana Docs","tooltip":"","type":"link","url":"http://www.grafana.org/docs"},{"icon":"info","tags":[],"targetBlank":true,"title":"Prometheus Docs","type":"link","url":"http://prometheus.io/docs/introduction/overview/"}],"gnetId":2,"description":"The official, pre-built Prometheus Stats Dashboard."},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} - grafana-net-162-dashboard.json: | - {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"singlestat","name":"Singlestat","version":""},{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.0"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Kubernetes cluster monitoring (via Prometheus)","tags":["kubernetes"],"style":"dark","timezone":"browser","editable":true,"hideControls":true,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"id":4,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"(sum(node_memory_MemTotal) - sum(node_memory_MemFree+node_memory_Buffers+node_memory_Cached) ) / sum(node_memory_MemTotal) * 100","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster memory usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"id":6,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum(sum by (container_name)( rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"\",container_name!=\"POD\"}[1m] ) )) / count(node_cpu{mode=\"system\"}) * 100","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster CPU usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"id":7,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"ceph_cluster_used_bytes / ceph_cluster_capacity_bytes * 100","interval":"10s","intervalFactor":1,"metric":"","refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster Ceph usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"}],"title":"Row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":3,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":3,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum by (container_name)( rate(container_cpu_usage_seconds_total{image!=\"\",container_name!=\"\",container_name!=\"POD\"}[1m] ) )","interval":"10s","intervalFactor":1,"legendFormat":"{{ container_name }}","metric":"container_cpu","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"Pod CPU usage","tooltip":{"msResolution":true,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"percent","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":2,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sort_desc(sum(container_memory_usage_bytes{image!=\"\",container_name!=\"\",container_name!=\"POD\"}) by (container_name, image))","interval":"10s","intervalFactor":1,"legendFormat":"{{ container_name }}","metric":"container_memory_usage:sort_desc","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"Pod memory usage","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":8,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sort_desc(sum by (pod_name) (rate (container_network_receive_bytes_total{name!=\"\", pod_name!=\"\"}[1m]) ))","interval":"10s","intervalFactor":1,"legendFormat":"{{ pod_name }}","metric":"network","refId":"A","step":10},{"expr":"sort_desc(sum by (pod_name) (rate (container_network_transmit_bytes_total{name!=\"\", pod_name!=\"\"}[1m]) ))","interval":"10s","intervalFactor":1,"legendFormat":"{{ pod_name }}","metric":"network","refId":"B","step":10}],"timeFrom":null,"timeShift":null,"title":"Pod Network i/o","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"}],"time":{"from":"now-1h","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"templating":{"list":[]},"annotations":{"list":[]},"refresh":"10s","schemaVersion":12,"version":46,"links":[],"gnetId":162,"description":"Monitor a Kubernetes cluster using Prometheus TSDB. Shows overall cluster CPU / Memory / Disk usage as well as individual pod statistics. "},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} - grafana-net-193-dashboard.json: | - {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"prometheus","description":"prometheus with cAdvisor as a target","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"singlestat","name":"Singlestat","version":""},{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.0"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Docker monitoring","description":"Docker monitoring with Prometheus and cAdvisor","tags":["docker"],"style":"dark","timezone":"browser","editable":true,"hideControls":false,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"50","panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"20","id":7,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"count(container_last_seen{image!=\"\"})","intervalFactor":2,"legendFormat":"","metric":"container_last_seen","refId":"A","step":240}],"thresholds":"","title":"Running containers","transparent":true,"type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"avg"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"mbytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"20","id":5,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum(container_memory_usage_bytes{image!=\"\"})/1024/1024","intervalFactor":2,"legendFormat":"","metric":"container_memory_usage_bytes","refId":"A","step":240}],"thresholds":"","title":"Total Memory Usage","transparent":true,"type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"20","id":6,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum(rate(container_cpu_user_seconds_total{image!=\"\"}[5m]) * 100)","intervalFactor":2,"legendFormat":"","metric":"container_memory_usage_bytes","refId":"A","step":240}],"thresholds":"","title":"Total CPU Usage","transparent":true,"type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":2,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(container_cpu_user_seconds_total{image!=\"\"}[5m]) * 100","intervalFactor":2,"legendFormat":"{{name}}","metric":"cpu","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"CPU Usage","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"transparent":false,"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"percent","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"Row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":1,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"container_memory_usage_bytes{image!=\"\"}","hide":false,"intervalFactor":2,"legendFormat":"{{name}}","metric":"container_memory_usage_bytes","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"Memory Usage","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"transparent":false,"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":"","logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":3,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"irate(container_network_receive_bytes_total{image!=\"\"}[5m])","intervalFactor":2,"legendFormat":"{{name}}","metric":"container_network_receive_bytes_total","refId":"A","step":20}],"timeFrom":null,"timeShift":null,"title":"Network Rx","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":4,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"irate(container_network_transmit_bytes_total{image!=\"\"}[5m])","intervalFactor":2,"legendFormat":"{{name}}","refId":"A","step":20}],"timeFrom":null,"timeShift":null,"title":"Network Tx","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]}],"title":"New row"}],"time":{"from":"now-3h","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"templating":{"list":[]},"annotations":{"list":[]},"refresh":"10s","schemaVersion":12,"version":26,"links":[],"gnetId":193},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} - grafana-net-315-dashboard.json: | - {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"panel","id":"singlestat","name":"Singlestat","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Kubernetes resources usage monitoring (via Prometheus)","description":"Monitors Kubernetes cluster using Prometheus. Shows overall cluster CPU / Memory / Filesystem usage as well as individual pod, containers, systemd services statistics. Uses cAdvisor metrics only.","tags":["kubernetes"],"style":"dark","timezone":"browser","editable":true,"hideControls":false,"sharedCrosshair":false,"rows":[{"title":"Network I/O pressure","height":"200px","editable":true,"collapse":false,"panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)","thresholdLine":false},"id":32,"isNew":true,"legend":{"alignAsTable":false,"avg":true,"current":true,"max":false,"min":false,"rightSide":false,"show":false,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_network_receive_bytes_total{instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m]))","interval":"10s","intervalFactor":1,"legendFormat":"Received","metric":"network","refId":"A","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m]))","interval":"10s","intervalFactor":1,"legendFormat":"Sent","metric":"network","refId":"B","step":10}],"timeFrom":null,"timeShift":null,"title":"Network I/O pressure","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":false}],"height":"200px","transparent":false}]},{"collapse":false,"editable":true,"height":"250px","panels":[{"cacheTimeout":null,"colorBackground":false,"colorValue":true,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"height":"180px","id":4,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (container_memory_working_set_bytes{id=\"/\",instance=~\"^$Node$\"}) / sum (machine_memory_bytes{instance=~\"^$Node$\"}) * 100","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster memory usage","transparent":false,"type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":true,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"height":"180px","id":6,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (rate (container_cpu_usage_seconds_total{id=\"/\",instance=~\"^$Node$\"}[1m])) / sum (machine_cpu_cores{instance=~\"^$Node$\"}) * 100","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster CPU usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":true,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"percent","gauge":{"maxValue":100,"minValue":0,"show":true,"thresholdLabels":false,"thresholdMarkers":true},"height":"180px","id":7,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":4,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (container_fs_usage_bytes{device=\"/dev/vda9\",id=\"/\",instance=~\"^$Node$\"}) / sum (container_fs_limit_bytes{device=\"/dev/vda9\",id=\"/\",instance=~\"^$Node$\"}) * 100","interval":"10s","intervalFactor":1,"legendFormat":"","metric":"","refId":"A","step":10}],"thresholds":"65, 90","title":"Cluster filesystem usage","type":"singlestat","valueFontSize":"80%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":9,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"20%","prefix":"","prefixFontSize":"20%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (container_memory_working_set_bytes{id=\"/\",instance=~\"^$Node$\"})","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Used","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":10,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (machine_memory_bytes{instance=~\"^$Node$\"})","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Total","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":11,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":" cores","postfixFontSize":"30%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (rate (container_cpu_usage_seconds_total{id=\"/\",instance=~\"^$Node$\"}[1m]))","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Used","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"none","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":12,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":" cores","postfixFontSize":"30%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (machine_cpu_cores{instance=~\"^$Node$\"})","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Total","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":13,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (container_fs_usage_bytes{device=\"/dev/vda9\",id=\"/\",instance=~\"^$Node$\"})","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Used","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"},{"cacheTimeout":null,"colorBackground":false,"colorValue":false,"colors":["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"format":"bytes","gauge":{"maxValue":100,"minValue":0,"show":false,"thresholdLabels":false,"thresholdMarkers":true},"height":"1px","id":14,"interval":null,"isNew":true,"links":[],"mappingType":1,"mappingTypes":[{"name":"value to text","value":1},{"name":"range to text","value":2}],"maxDataPoints":100,"nullPointMode":"connected","nullText":null,"postfix":"","postfixFontSize":"50%","prefix":"","prefixFontSize":"50%","rangeMaps":[{"from":"null","text":"N/A","to":"null"}],"span":2,"sparkline":{"fillColor":"rgba(31, 118, 189, 0.18)","full":false,"lineColor":"rgb(31, 120, 193)","show":false},"targets":[{"expr":"sum (container_fs_limit_bytes{device=\"/dev/vda9\",id=\"/\",instance=~\"^$Node$\"})","interval":"10s","intervalFactor":1,"refId":"A","step":10}],"thresholds":"","title":"Total","type":"singlestat","valueFontSize":"50%","valueMaps":[{"op":"=","text":"N/A","value":"null"}],"valueName":"current"}],"showTitle":false,"title":"Total usage"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":3,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"height":"","id":17,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (pod_name)","interval":"10s","intervalFactor":1,"legendFormat":"{{ pod_name }}","metric":"container_cpu","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"Pods CPU usage","tooltip":{"msResolution":true,"shared":true,"sort":2,"value_type":"cumulative"},"transparent":false,"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"none","label":"cores","logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"showTitle":false,"title":"Pods CPU usage"},{"collapse":true,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":3,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"height":"","id":24,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"hideEmpty":false,"hideZero":false,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":null,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\",container_name!=\"POD\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (container_name, pod_name)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"pod: {{ pod_name }} | {{ container_name }}","metric":"container_cpu","refId":"A","step":10},{"expr":"sum (rate (container_cpu_usage_seconds_total{image!=\"\",name!~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, name, image)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"docker: {{ instance }} | {{ image }} ({{ name }})","metric":"container_cpu","refId":"B","step":10},{"expr":"sum (rate (container_cpu_usage_seconds_total{rkt_container_name!=\"\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, rkt_container_name)","interval":"10s","intervalFactor":1,"legendFormat":"rkt: {{ instance }} | {{ rkt_container_name }}","metric":"container_cpu","refId":"C","step":10}],"timeFrom":null,"timeShift":null,"title":"Containers CPU usage","tooltip":{"msResolution":true,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"none","label":"cores","logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"Containers CPU usage"},{"collapse":true,"editable":true,"height":"500px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":3,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":20,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":false,"show":true,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_cpu_usage_seconds_total{id!=\"/\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (id)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"{{ id }}","metric":"container_cpu","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"All processes CPU usage","tooltip":{"msResolution":true,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"percent","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"repeat":null,"showTitle":false,"title":"All processes CPU usage"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":25,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (container_memory_working_set_bytes{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}) by (pod_name)","interval":"10s","intervalFactor":1,"legendFormat":"{{ pod_name }}","metric":"container_memory_usage:sort_desc","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"Pods memory usage","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"Pods memory usage"},{"collapse":true,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":27,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (container_memory_working_set_bytes{image!=\"\",name=~\"^k8s_.*\",container_name!=\"POD\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}) by (container_name, pod_name)","interval":"10s","intervalFactor":1,"legendFormat":"pod: {{ pod_name }} | {{ container_name }}","metric":"container_memory_usage:sort_desc","refId":"A","step":10},{"expr":"sum (container_memory_working_set_bytes{image!=\"\",name!~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}) by (instance, name, image)","interval":"10s","intervalFactor":1,"legendFormat":"docker: {{ instance }} | {{ image }} ({{ name }})","metric":"container_memory_usage:sort_desc","refId":"B","step":10},{"expr":"sum (container_memory_working_set_bytes{rkt_container_name!=\"\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}) by (instance, rkt_container_name)","interval":"10s","intervalFactor":1,"legendFormat":"rkt: {{ instance }} | {{ rkt_container_name }}","metric":"container_memory_usage:sort_desc","refId":"C","step":10}],"timeFrom":null,"timeShift":null,"title":"Containers memory usage","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"Containers memory usage"},{"collapse":true,"editable":true,"height":"500px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":28,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (container_memory_working_set_bytes{id!=\"/\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}) by (id)","interval":"10s","intervalFactor":1,"legendFormat":"{{ id }}","metric":"container_memory_usage:sort_desc","refId":"A","step":10}],"timeFrom":null,"timeShift":null,"title":"All processes memory usage","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"All processes memory usage"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":16,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_network_receive_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (pod_name)","interval":"10s","intervalFactor":1,"legendFormat":"-> {{ pod_name }}","metric":"network","refId":"A","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (pod_name)","interval":"10s","intervalFactor":1,"legendFormat":"<- {{ pod_name }}","metric":"network","refId":"B","step":10}],"timeFrom":null,"timeShift":null,"title":"Pods network I/O","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"Pods network I/O"},{"collapse":true,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":30,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":true,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_network_receive_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (container_name, pod_name)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"-> pod: {{ pod_name }} | {{ container_name }}","metric":"network","refId":"B","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (container_name, pod_name)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"<- pod: {{ pod_name }} | {{ container_name }}","metric":"network","refId":"D","step":10},{"expr":"sum (rate (container_network_receive_bytes_total{image!=\"\",name!~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, name, image)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"-> docker: {{ instance }} | {{ image }} ({{ name }})","metric":"network","refId":"A","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{image!=\"\",name!~\"^k8s_.*\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, name, image)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"<- docker: {{ instance }} | {{ image }} ({{ name }})","metric":"network","refId":"C","step":10},{"expr":"sum (rate (container_network_transmit_bytes_total{rkt_container_name!=\"\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, rkt_container_name)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"-> rkt: {{ instance }} | {{ rkt_container_name }}","metric":"network","refId":"E","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{rkt_container_name!=\"\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (instance, rkt_container_name)","hide":false,"interval":"10s","intervalFactor":1,"legendFormat":"<- rkt: {{ instance }} | {{ rkt_container_name }}","metric":"network","refId":"F","step":10}],"timeFrom":null,"timeShift":null,"title":"Containers network I/O","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"Containers network I/O"},{"collapse":true,"editable":true,"height":"500px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","decimals":2,"editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":29,"isNew":true,"legend":{"alignAsTable":true,"avg":true,"current":true,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":200,"sort":"current","sortDesc":true,"total":false,"values":true},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":12,"stack":false,"steppedLine":false,"targets":[{"expr":"sum (rate (container_network_receive_bytes_total{id!=\"/\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (id)","interval":"10s","intervalFactor":1,"legendFormat":"-> {{ id }}","metric":"network","refId":"A","step":10},{"expr":"- sum (rate (container_network_transmit_bytes_total{id!=\"/\",instance=~\"^$Node$\",namespace=~\"^$Namespace$\"}[1m])) by (id)","interval":"10s","intervalFactor":1,"legendFormat":"<- {{ id }}","metric":"network","refId":"B","step":10}],"timeFrom":null,"timeShift":null,"title":"All processes network I/O","tooltip":{"msResolution":false,"shared":true,"sort":2,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":false}]}],"title":"All processes network I/O"}],"time":{"from":"now-30m","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"templating":{"list":[{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"multi":false,"name":"Node","options":[],"query":"label_values(instance)","regex":"[0-9.]*[^:]","refresh":1,"type":"query"},{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"multi":false,"name":"Namespace","options":[],"query":"label_values(namespace)","refresh":1,"type":"query"}]},"annotations":{"list":[]},"refresh":"10s","schemaVersion":12,"version":18,"links":[],"gnetId":315},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} - prometheus-datasource.json: | - { - "name": "prometheus", - "type": "prometheus", - "url": "http://prometheus:9090", - "access": "proxy", - "basicAuth": false - } ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: grafana-import-dashboards - labels: - app: grafana - component: import-dashboards -spec: - template: - metadata: - name: grafana-import-dashboards - labels: - app: grafana - component: import-dashboards - spec: - containers: - - name: grafana-import-dashboards - image: docker - command: ["/bin/sh", "-c"] - workingDir: /opt/grafana-import-dashboards - args: - # FIXME use kubernetes probe instead of "until curl" - - > - until $(curl --silent --fail --show-error --output /dev/null http://grafana:3000/api/datasources); do - printf '.' ; sleep 1 ; - done ; - for file in *-datasource.json ; do - if [ -e "$file" ] ; then - echo "importing $file" && - curl --silent --fail --show-error \ - --request POST http://grafana:3000/api/datasources \ - --header "Content-Type: application/json" \ - --data-binary "@$file" ; - echo "" ; - fi - done ; - for file in *-dashboard.json ; do - if [ -e "$file" ] ; then - echo "importing $file" && - curl --silent --fail --show-error \ - --request POST http://grafana:3000/api/dashboards/import \ - --header "Content-Type: application/json" \ - --data-binary "@$file" ; - echo "" ; - fi - done - - volumeMounts: - - name: config-volume - mountPath: /opt/grafana-import-dashboards - restartPolicy: Never - volumes: - - name: config-volume - configMap: - name: grafana-import-dashboards ---- -# based on the content created by: -# kubectl create configmap prometheus-core --from-file=manifests/prometheus-core-configmap --output yaml > manifests/prometheus-core-configmap.yaml - -apiVersion: v1 -kind: ConfigMap -metadata: - name: prometheus-core - labels: - app: prometheus - component: core -data: - prometheus.yml: | - global: - scrape_interval: 10s - scrape_timeout: 10s - evaluation_interval: 10s - - scrape_configs: - - job_name: ceph - static_configs: - - targets: - - ceph-exporter.ceph:9128 - - # # https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L10 - # - job_name: 'kubernetes-apiserver' - # tls_config: - # ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - # bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - # kubernetes_sd_configs: - # - api_servers: - # - 'https://kubernetes.default.svc' - # in_cluster: true - # role: apiserver - - # https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L37 - - job_name: 'kubernetes-nodes' - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - kubernetes_sd_configs: - - api_servers: - - 'https://kubernetes.default.svc' - in_cluster: true - role: node - relabel_configs: - - source_labels: [__address__] - regex: '(.*):10250' - replacement: '${1}:10255' - target_label: __address__ - - # https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L79 - - job_name: 'kubernetes-endpoints' - kubernetes_sd_configs: - - api_servers: - - 'https://kubernetes.default.svc' - in_cluster: true - role: endpoint - relabel_configs: - - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] - action: keep - regex: true - - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] - action: replace - target_label: __scheme__ - regex: (https?) - - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port] - action: replace - target_label: __address__ - regex: (.+)(?::\d+);(\d+) - replacement: $1:$2 - - action: labelmap - regex: __meta_kubernetes_service_label_(.+) - - source_labels: [__meta_kubernetes_service_namespace] - action: replace - target_label: kubernetes_namespace - - source_labels: [__meta_kubernetes_service_name] - action: replace - target_label: kubernetes_name - - # https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L119 - - job_name: 'kubernetes-services' - metrics_path: /probe - params: - module: [http_2xx] - kubernetes_sd_configs: - - api_servers: - - 'https://kubernetes.default.svc' - in_cluster: true - role: service - relabel_configs: - - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe] - action: keep - regex: true - - source_labels: [__address__] - target_label: __param_target - - target_label: __address__ - replacement: blackbox - - source_labels: [__param_target] - target_label: instance - - action: labelmap - regex: __meta_kubernetes_service_label_(.+) - - source_labels: [__meta_kubernetes_service_namespace] - target_label: kubernetes_namespace - - source_labels: [__meta_kubernetes_service_name] - target_label: kubernetes_name - - # https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L156 - - job_name: 'kubernetes-pods' - kubernetes_sd_configs: - - api_servers: - - 'https://kubernetes.default.svc' - in_cluster: true - role: pod - relabel_configs: - - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] - action: keep - regex: true - - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] - action: replace - regex: (.+):(?:\d+);(\d+) - replacement: ${1}:${2} - target_label: __address__ - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - source_labels: [__meta_pod_namespace] - action: replace - target_label: kubernetes_namespace - - source_labels: [__meta_pod_name] - action: replace - target_label: pod_name ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: prometheus-core - labels: - app: prometheus - component: core -spec: - replicas: 1 - selector: - matchLabels: - app: prometheus - component: core - template: - metadata: - name: prometheus-main - labels: - app: prometheus - component: core - spec: - containers: - - name: prometheus - image: prom/prometheus:v1.2.1 - args: - - '-storage.local.retention=6h' - - '-storage.local.memory-chunks=500000' - - '-storage.local.path=/data' - - '-config.file=/etc/prometheus/prometheus.yml' - ports: - - name: webui - containerPort: 9090 - volumeMounts: - - name: config-volume - mountPath: /etc/prometheus - - name: data-volume - mountPath: /data - volumes: - - name: config-volume - configMap: - name: prometheus-core - - name: data-volume - rbd: - monitors: - - ceph-mon.ceph:6789 - user: admin - image: prometheus - pool: rbd - secretRef: - name: ceph-admin-key ---- -apiVersion: v1 -kind: Service -metadata: - name: prometheus - labels: - app: prometheus - component: core - annotations: - prometheus.io/scrape: 'true' -spec: - type: NodePort - ports: - - port: 9090 - nodePort: 30900 - protocol: TCP - name: webui - selector: - app: prometheus - component: core ---- -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: prometheus-node-exporter - labels: - app: prometheus - component: node-exporter -spec: - template: - metadata: - name: prometheus-node-exporter - labels: - app: prometheus - component: node-exporter - spec: - containers: - - image: prom/node-exporter:0.12.0 - name: prometheus-node-exporter - ports: - - name: prom-node-exp - #^ must be an IANA_SVC_NAME (at most 15 characters, ..) - containerPort: 9100 - hostPort: 9100 - hostNetwork: true - hostPID: true ---- -apiVersion: v1 -kind: Service -metadata: - annotations: - prometheus.io/scrape: 'true' - name: prometheus-node-exporter - labels: - app: prometheus - component: node-exporter -spec: - clusterIP: None - ports: - - name: prometheus-node-exporter - port: 9100 - protocol: TCP - selector: - app: prometheus - component: node-exporter - type: ClusterIP ---- \ No newline at end of file diff --git a/kube/kubelet/scripts/apiserver-bootstrap.sh b/kube/kubelet/scripts/apiserver-bootstrap.sh deleted file mode 100755 index 74f82af..0000000 --- a/kube/kubelet/scripts/apiserver-bootstrap.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -MY_IP=$(ip -4 addr show scope global dev ethwe | grep inet | cut -d / -f 1 | sed "s/[a-zA-Z ]//g") -/hyperkube \ - apiserver \ - --advertise-address=${MY_IP} \ - $@ diff --git a/kube/kubelet/scripts/ceph/50-rbd.rules b/kube/kubelet/scripts/ceph/50-rbd.rules deleted file mode 100644 index 7e6e360..0000000 --- a/kube/kubelet/scripts/ceph/50-rbd.rules +++ /dev/null @@ -1,2 +0,0 @@ -KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="disk", PROGRAM="/opt/bin/ceph-rbdnamer %k", SYMLINK+="rbd/%c{1}/%c{2}" -KERNEL=="rbd[0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/opt/bin/ceph-rbdnamer %k", SYMLINK+="rbd/%c{1}/%c{2}-part%n" diff --git a/kube/kubelet/scripts/ceph/ceph b/kube/kubelet/scripts/ceph/ceph deleted file mode 100755 index 7a32c3c..0000000 --- a/kube/kubelet/scripts/ceph/ceph +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/usr/bin/docker run --net=host --rm -v /opt/pidalio/kube/kubelet/scripts/ceph/resolv.conf:/etc/resolv.conf:ro -v /opt/pidalio/kube/kubelet/scripts/ceph/keys/:/etc/ceph ceph/base ceph "$@" diff --git a/kube/kubelet/scripts/ceph/ceph-disk b/kube/kubelet/scripts/ceph/ceph-disk deleted file mode 100755 index 80ad463..0000000 --- a/kube/kubelet/scripts/ceph/ceph-disk +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/usr/bin/docker run --rm --net=host --privileged=true -v /opt/pidalio/kube/kubelet/scripts/ceph/resolv.conf:/etc/resolv.conf:ro -v /opt/pidalio/kube/kubelet/scripts/ceph/keys/:/etc/ceph -v /dev:/dev ceph/base ceph-disk "$@" \ No newline at end of file diff --git a/kube/kubelet/scripts/ceph/ceph-rbdnamer b/kube/kubelet/scripts/ceph/ceph-rbdnamer deleted file mode 100755 index d02415f..0000000 --- a/kube/kubelet/scripts/ceph/ceph-rbdnamer +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -DEV=$1 -NUM=`echo $DEV | sed 's#p.*##g' | tr -d 'a-z'` -POOL=`cat /sys/devices/rbd/$NUM/pool` -IMAGE=`cat /sys/devices/rbd/$NUM/name` -SNAP=`cat /sys/devices/rbd/$NUM/current_snap` -if [ "$SNAP" = "-" ]; then - echo -n "$POOL $IMAGE" -else - echo -n "$POOL $IMAGE@$SNAP" -fi \ No newline at end of file diff --git a/kube/kubelet/scripts/ceph/install-ceph-tools.sh b/kube/kubelet/scripts/ceph/install-ceph-tools.sh deleted file mode 100755 index d1a1c7c..0000000 --- a/kube/kubelet/scripts/ceph/install-ceph-tools.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -set -e - -checksum() -{ - md5sum $1 | awk '{print $1}' -} - -for UTIL in ceph rbd ceph-rbdnamer rados ceph-disk; do - - if [ ! -e /opt/bin/$UTIL ] || [ "$(checksum /opt/bin/$UTIL)" != "$(checksum /opt/pidalio/kube/kubelet/scripts/ceph/$UTIL)" ]; then - echo "Installing $UTIL to /opt/bin" - cp -pf /opt/pidalio/kube/kubelet/scripts/ceph/$UTIL /opt/bin - fi - -done - -if [ ! -e /etc/udev/rules.d/50-rbd.rules ] || [ "$(checksum /etc/udev/rules.d/50-rbd.rules)" != "$(checksum /opt/pidalio/kube/kubelet/scripts/ceph/50-rbd.rules)" ]; then - echo "Installing 50-rbd.rules to /etc/udev/rules.d/" - cp -pf /opt/pidalio/kube/kubelet/scripts/ceph/50-rbd.rules /etc/udev/rules.d/ -fi diff --git a/kube/kubelet/scripts/ceph/install-ceph.sh b/kube/kubelet/scripts/ceph/install-ceph.sh deleted file mode 100755 index e345138..0000000 --- a/kube/kubelet/scripts/ceph/install-ceph.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -mkdir -p /etc/ceph -TMP=$(mktemp -d) -FS_ID=$(uuidgen) -cd $TMP -cp /opt/pidalio/kube/kubelet/scripts/ceph/keys/* . -for file in $(ls *) -do - sed -i s/\\\$token\\\$/${PIDALIO_TOKEN}/g ${file} - sed -i s/\\\$fsid\\\$/${FS_ID}/g ${file} -done -echo AQDP299XAAAAABAA9ut3smkroIdHsYCfqf5YWQ== > ceph-admin-key -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create namespace ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create namespace monitoring -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-conf-combined --from-file=ceph.conf --from-file=ceph.client.admin.keyring --from-file=ceph.mon.keyring --namespace=ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-bootstrap-rgw-keyring --from-file=ceph.keyring=ceph.rgw.keyring --namespace=ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-bootstrap-mds-keyring --from-file=ceph.keyring=ceph.mds.keyring --namespace=ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-bootstrap-osd-keyring --from-file=ceph.keyring=ceph.osd.keyring --namespace=ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-admin-key --type="kubernetes.io/rbd" --from-file=ceph-admin-key --namespace=ceph -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-admin-key --type="kubernetes.io/rbd" --from-file=ceph-admin-key --namespace=monitoring -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create secret generic ceph-admin-key --type="kubernetes.io/rbd" --from-file=ceph-admin-key diff --git a/kube/kubelet/scripts/ceph/keys/ceph.client.admin.keyring b/kube/kubelet/scripts/ceph/keys/ceph.client.admin.keyring deleted file mode 100644 index b2a1e4e..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.client.admin.keyring +++ /dev/null @@ -1,6 +0,0 @@ -[client.admin] - key = AQDP299XAAAAABAA9ut3smkroIdHsYCfqf5YWQ== - auid = 0 - caps mds = "allow" - caps mon = "allow *" - caps osd = "allow *" diff --git a/kube/kubelet/scripts/ceph/keys/ceph.conf b/kube/kubelet/scripts/ceph/keys/ceph.conf deleted file mode 100644 index 34ceb19..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.conf +++ /dev/null @@ -1,71 +0,0 @@ -[global] -fsid = $fsid$ -cephx = true -cephx_require_signatures = false -cephx_cluster_require_signatures = true -cephx_service_require_signatures = false - -# auth -max_open_files = 131072 -osd_pool_default_pg_num = 128 -osd_pool_default_pgp_num = 128 -osd_pool_default_size = 2 -osd_pool_default_min_size = 1 - -mon_osd_full_ratio = .95 -mon_osd_nearfull_ratio = .85 - -mon_host = ceph-mon - -[mon] -mon_osd_down_out_interval = 600 -mon_osd_min_down_reporters = 4 -mon_clock_drift_allowed = .15 -mon_clock_drift_warn_backoff = 30 -mon_osd_report_timeout = 300 - - -[osd] -journal_size = 100 -cluster_network = 10.0.0.0/8 -public_network = 10.0.0.0/8 -osd_mkfs_type = xfs -osd_mkfs_options_xfs = -f -i size=2048 -osd_mon_heartbeat_interval = 30 -osd_max_object_name_len = 256 - -#crush -osd_pool_default_crush_rule = 0 -osd_crush_update_on_start = true - -#backend -osd_objectstore = filestore - -#performance tuning -filestore_merge_threshold = 40 -filestore_split_multiple = 8 -osd_op_threads = 8 -filestore_op_threads = 8 -filestore_max_sync_interval = 5 -osd_max_scrubs = 1 - - -#recovery tuning -osd_recovery_max_active = 5 -osd_max_backfills = 2 -osd_recovery_op_priority = 2 -osd_client_op_priority = 63 -osd_recovery_max_chunk = 1048576 -osd_recovery_threads = 1 - -#ports -ms_bind_port_min = 6800 -ms_bind_port_max = 7100 - -[client] -rbd_cache_enabled = true -rbd_cache_writethrough_until_flush = true -rbd_default_features = 1 - -[mds] -mds_cache_size = 100000 diff --git a/kube/kubelet/scripts/ceph/keys/ceph.mds.keyring b/kube/kubelet/scripts/ceph/keys/ceph.mds.keyring deleted file mode 100644 index b7aa98d..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.mds.keyring +++ /dev/null @@ -1,3 +0,0 @@ -[client.bootstrap-mds] - key = AQBH3d9XAAAAABAAPuvdUvtOkX5swCHPEhvGIw== - caps mon = "allow profile bootstrap-mds" diff --git a/kube/kubelet/scripts/ceph/keys/ceph.mon.keyring b/kube/kubelet/scripts/ceph/keys/ceph.mon.keyring deleted file mode 100644 index 907d6a4..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.mon.keyring +++ /dev/null @@ -1,3 +0,0 @@ -[mon.] - key = AQBV3d9XAAAAABAAZIBqXDadWhwiRW7j8/VzOQ== - caps mon = "allow *" diff --git a/kube/kubelet/scripts/ceph/keys/ceph.osd.keyring b/kube/kubelet/scripts/ceph/keys/ceph.osd.keyring deleted file mode 100644 index d659edb..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.osd.keyring +++ /dev/null @@ -1,3 +0,0 @@ -[client.bootstrap-osd] - key = AQBf3d9XAAAAABAAxzwD+4oy5Q2uyHnAA9frvg== - caps mon = "allow profile bootstrap-osd" diff --git a/kube/kubelet/scripts/ceph/keys/ceph.rgw.keyring b/kube/kubelet/scripts/ceph/keys/ceph.rgw.keyring deleted file mode 100644 index 81e3eb0..0000000 --- a/kube/kubelet/scripts/ceph/keys/ceph.rgw.keyring +++ /dev/null @@ -1,3 +0,0 @@ -[client.bootstrap-rgw] - key = AQBq3d9XAAAAABAAoPp65HWmrgJ6lIQlumvqlA== - caps mon = "allow profile bootstrap-rgw" diff --git a/kube/kubelet/scripts/ceph/rados b/kube/kubelet/scripts/ceph/rados deleted file mode 100755 index 7aa6d69..0000000 --- a/kube/kubelet/scripts/ceph/rados +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/usr/bin/docker run --net=host --rm -v /opt/pidalio/kube/kubelet/scripts/ceph/resolv.conf:/etc/resolv.conf:ro -v /opt/pidalio/kube/kubelet/scripts/ceph/keys/:/etc/ceph ceph/base rados "$@" \ No newline at end of file diff --git a/kube/kubelet/scripts/ceph/rbd b/kube/kubelet/scripts/ceph/rbd deleted file mode 100755 index fafeefe..0000000 --- a/kube/kubelet/scripts/ceph/rbd +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/usr/bin/docker run --rm -v /sys:/sys --net=host -v /opt/pidalio/kube/kubelet/scripts/ceph/resolv.conf:/etc/resolv.conf:ro -v /opt/pidalio/kube/kubelet/scripts/ceph/keys/:/etc/ceph --privileged=true ceph/base rbd "$@" \ No newline at end of file diff --git a/kube/kubelet/scripts/ceph/resolv.conf b/kube/kubelet/scripts/ceph/resolv.conf deleted file mode 100644 index d189ad0..0000000 --- a/kube/kubelet/scripts/ceph/resolv.conf +++ /dev/null @@ -1,2 +0,0 @@ -search ceph.svc.cluster.local svc.cluster.local -nameserver 10.244.0.3 diff --git a/kube/kubelet/scripts/configure-dns.sh b/kube/kubelet/scripts/configure-dns.sh deleted file mode 100755 index 5d05c29..0000000 --- a/kube/kubelet/scripts/configure-dns.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -echo "Setting DNS" -WEAVE_DNS_ADDRESS=$(/opt/bin/weave report | jq -r .DNS.Address | cut -d ':' -f 1) -until [[ "$WEAVE_DNS_ADDRESS" != "" ]]; -do - WEAVE_DNS_ADDRESS=$(/opt/bin/weave report | jq -r .DNS.Address | cut -d ':' -f 1) - sleep 5 -done -cat < /opt/resolv.conf -nameserver ${WEAVE_DNS_ADDRESS} -nameserver 185.23.94.244 -EOF -rm -f /etc/resolv.conf -ln -s /opt/resolv.conf /etc/resolv.conf diff --git a/kube/kubelet/scripts/create-descriptors.sh b/kube/kubelet/scripts/create-descriptors.sh deleted file mode 100755 index 00b6c6a..0000000 --- a/kube/kubelet/scripts/create-descriptors.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -i=0 -until curl -m 5 http://localhost:8080/healthz || [[ $i == 5 ]] -do - echo "Waiting for master to be ready" - sleep 10 - i=$(expr $i + 1) -done -if [[ $i == 5 ]]; then exit 1; fi -# Initialize Kubernetes Addons -/opt/bin/kubectl --kubeconfig=/home/core/.kube/config create -f /etc/kubernetes/descriptors/dns -# Initialize Ceph -if [[ "${CEPH}" == "True" ]] -then - /opt/pidalio/kube/kubelet/scripts/ceph/install-ceph.sh - if [[ "${CEPH_DISK}" == "True" ]] - then - /opt/bin/kubectl --kubeconfig=/home/core/.kube/config --namespace=ceph create \ - -f /etc/kubernetes/descriptors/ceph/ceph-mds-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-check-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-v1-svc.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-osd-v1-ds-disk.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-stats-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-stats-v1-svc.yaml - else - /opt/bin/kubectl --kubeconfig=/home/core/.kube/config --namespace=ceph create \ - -f /etc/kubernetes/descriptors/ceph/ceph-mds-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-check-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-mon-v1-svc.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-osd-v1-ds-dir.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-stats-v1-dp.yaml \ - -f /etc/kubernetes/descriptors/ceph/ceph-stats-v1-svc.yaml - fi - if [[ "${MONITORING}" == "True" ]] - then - until [ "$(/opt/bin/kubectl --kubeconfig=/home/core/.kube/config get pods --namespace=ceph | tail -n +2 | egrep -v '(.*)1/1(.*)Running' | wc -l)" == "0" ] - do - echo "Waiting for ceph to be ready" - sleep 10 - done - echo "Creating monitoring disk in ceph" - until /opt/bin/rbd -m ceph-mon.ceph info prometheus - do - /opt/bin/rbd -m ceph-mon.ceph create prometheus --size=50G - sleep 10 - done - until /opt/bin/rbd -m ceph-mon.ceph info grafana - do - /opt/bin/rbd -m ceph-mon.ceph create grafana --size=1G - sleep 10 - done - /opt/bin/kubectl --kubeconfig=/home/core/.kube/config create -f /etc/kubernetes/descriptors/monitoring --namespace=monitoring - fi -fi -exit 0 diff --git a/kube/kubelet/scripts/download-components.sh b/kube/kubelet/scripts/download-components.sh deleted file mode 100755 index e9a96b7..0000000 --- a/kube/kubelet/scripts/download-components.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# Create directories and download Kubernetes Components -mkdir -p /etc/kubernetes/descriptors /etc/kubernetes/manifests /etc/kubernetes/ssl /opt/bin -for app in kubelet kube-proxy kubectl kube-controller-manager kube-scheduler -do - if [[ -x /opt/bin/$app ]]; then - echo "$app already installed" - else - curl -o /opt/bin/$app http://storage.googleapis.com/kubernetes-release/release/v1.5.1/bin/linux/amd64/$app - chmod +x /opt/bin/$app - echo "$app installed" - fi -done diff --git a/kube/kubelet/scripts/launch-controller.sh b/kube/kubelet/scripts/launch-controller.sh deleted file mode 100755 index 1968872..0000000 --- a/kube/kubelet/scripts/launch-controller.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -/opt/bin/kube-controller-manager \ - --master=https://pidalio-apiserver \ - --kubeconfig=/etc/kubernetes/kubeconfig.yaml \ - --service-account-private-key-file=/etc/kubernetes/ssl/server-key.pem \ - --pod-eviction-timeout=10s \ - --node-monitor-grace-period=20s \ - --root-ca-file=/etc/kubernetes/ssl/ca.pem diff --git a/kube/kubelet/scripts/launch-kubelet.sh b/kube/kubelet/scripts/launch-kubelet.sh deleted file mode 100755 index 9911078..0000000 --- a/kube/kubelet/scripts/launch-kubelet.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -mkdir -p /home/core/.kube -cat < /home/core/.kube/config -apiVersion: v1 -clusters: -- cluster: - server: http://pidalio-apiserver:8080 - name: local -contexts: -- context: - cluster: local - user: local - name: local -current-context: local -kind: Config -preferences: {} -users: -- name: local -EOF -chown -R core:core /home/core/.kube -/opt/bin/kubelet \ - --network-plugin=cni \ - --network-plugin-dir=/etc/cni/net.d \ - --api-servers=https://pidalio-apiserver \ - --register-node=true \ - --node-labels=type=${NODE_TYPE},storage=${NODE_STORAGE} \ - --allow-privileged=true \ - --node-ip=${NODE_IP} \ - --hostname-override=${NODE_PUBLIC_IP} \ - --cluster-dns=10.244.0.3 \ - --cluster-domain=${DOMAIN} \ - --kubeconfig=/etc/kubernetes/kubeconfig.yaml \ - --tls-cert-file=/etc/kubernetes/ssl/node.pem \ - --tls-private-key-file=/etc/kubernetes/ssl/node-key.pem diff --git a/kube/kubelet/scripts/launch-proxy.sh b/kube/kubelet/scripts/launch-proxy.sh deleted file mode 100755 index 9b38d36..0000000 --- a/kube/kubelet/scripts/launch-proxy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -/opt/bin/kube-proxy \ - --master=https://pidalio-apiserver \ - --hostname-override=${NODE_PUBLIC_IP} \ - --kubeconfig=/etc/kubernetes/kubeconfig.yaml \ - --proxy-mode=iptables diff --git a/kube/kubelet/scripts/launch-scheduler.sh b/kube/kubelet/scripts/launch-scheduler.sh deleted file mode 100755 index 8ba32bd..0000000 --- a/kube/kubelet/scripts/launch-scheduler.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -/opt/bin/kube-scheduler \ - --master=https://pidalio-apiserver \ - --kubeconfig=/etc/kubernetes/kubeconfig.yaml diff --git a/kube/kubelet/scripts/prepare-units.sh b/kube/kubelet/scripts/prepare-units.sh deleted file mode 100755 index 8811b42..0000000 --- a/kube/kubelet/scripts/prepare-units.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -source /etc/pidalio.env -for file in $(ls /opt/pidalio/kube/units/master/*.service) -do - sed -i s/\\\$token\\\$/${PIDALIO_TOKEN}/g ${file} -done diff --git a/kube/kubelet/scripts/prepare-yaml.sh b/kube/kubelet/scripts/prepare-yaml.sh deleted file mode 100755 index 6a73f5d..0000000 --- a/kube/kubelet/scripts/prepare-yaml.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -rm -Rf /etc/kubernetes/descriptors/* -cp -Rf /opt/pidalio/kube/kubelet/descriptors/* /etc/kubernetes/descriptors -for file in $(ls /etc/kubernetes/descriptors/dns/*.yaml /etc/kubernetes/descriptors/ceph/*.yaml) -do - sed -i s/\\\$domain\\\$/${DOMAIN}/g ${file} - sed -i s/\\\$node_type\\\$/${NODE_TYPE}/g ${file} - sed -i s#\\\$CEPH_DISK_DEVICE\\\$#${CEPH_DISK_DEVICE}#g ${file} -done diff --git a/kube/kubelet/scripts/retrieve-certificates.sh b/kube/kubelet/scripts/retrieve-certificates.sh deleted file mode 100755 index 500160e..0000000 --- a/kube/kubelet/scripts/retrieve-certificates.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -echo "Waiting for Pidalio..." -until [[ "$(/opt/bin/weave dns-lookup pidalio|/usr/bin/wc -l)" == "1" ]] -do - echo "Waiting for Pidalio" - sleep 10 -done -PIDALIO_URL=http://$(/opt/bin/weave dns-lookup pidalio):3000 -until curl -s ${PIDALIO_URL}/certs/ca\?token\=${PIDALIO_TOKEN} -do - echo "Trying: ${PIDALIO_URL}" - sleep 1 -done -# Root CA -curl -s ${PIDALIO_URL}/certs/ca\?token\=${PIDALIO_TOKEN} > ca.json -cat ca.json | jq -r .cert > /etc/kubernetes/ssl/ca.pem -if [[ "${MASTER}" == "true" ]] -then - curl -s ${PIDALIO_URL}/certs/server\?token\=${PIDALIO_TOKEN} > server.json - cat server.json | jq -r .privateKey > /etc/kubernetes/ssl/server-key.pem - cat server.json | jq -r .cert > /etc/kubernetes/ssl/server.pem -fi -curl -s ${PIDALIO_URL}/certs/node\?token\=${PIDALIO_TOKEN}\&fqdn=${NODE_FQDN}\&ip=${NODE_PUBLIC_IP} > node.json -cat node.json | jq -r .privateKey > /etc/kubernetes/ssl/node-key.pem -cat node.json | jq -r .cert > /etc/kubernetes/ssl/node.pem -cat < /etc/kubernetes/kubeconfig.yaml -apiVersion: v1 -kind: Config -clusters: -- name: local - cluster: - certificate-authority: /etc/kubernetes/ssl/ca.pem -users: -- name: kubelet - user: - client-certificate: /etc/kubernetes/ssl/node.pem - client-key: /etc/kubernetes/ssl/node-key.pem -contexts: -- context: - cluster: local - user: kubelet - name: kubelet-context -current-context: kubelet-context -EOF diff --git a/kube/units/master/pidalio-apiserver.service b/kube/units/master/pidalio-apiserver.service deleted file mode 100644 index d00aac7..0000000 --- a/kube/units/master/pidalio-apiserver.service +++ /dev/null @@ -1,39 +0,0 @@ -[Unit] -Description=Pidalio Master API Service -After=weave-network.target fleet.service -Requires=weave-network.target fleet.service -[Service] -Restart=always -RestartSec=10 -EnvironmentFile=/etc/pidalio.env -Environment=MASTER=true -Environment=DOCKER_HOST=unix:///var/run/weave/weave.sock -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/retrieve-certificates.sh -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/prepare-yaml.sh -ExecStartPre=/usr/bin/docker pull quay.io/coreos/hyperkube:v1.5.1_coreos.0 -ExecStart=/usr/bin/docker run \ - --volume /opt/pidalio/kube/kubelet/scripts/apiserver-bootstrap.sh:/bootstrap.sh \ - --volume /etc/kubernetes:/etc/kubernetes \ - --volume /usr/share/ca-certificates:/etc/ssl/certs \ - --publish 8080:8080 \ - --publish 443:443 \ - --rm \ - --name=pidalio-apiserver \ - quay.io/coreos/hyperkube:v1.5.1_coreos.0 \ - /bootstrap.sh \ - --bind-address=0.0.0.0 \ - --insecure-bind-address=0.0.0.0 \ - --etcd-servers=http://etcd:2379 \ - --allow-privileged=true \ - --service-cluster-ip-range=10.244.0.0/14 \ - --service-node-port-range=1-33000 \ - --secure-port=443 \ - --admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota \ - --tls-cert-file=/etc/kubernetes/ssl/server.pem \ - --tls-private-key-file=/etc/kubernetes/ssl/server-key.pem \ - --client-ca-file=/etc/kubernetes/ssl/ca.pem \ - --service-account-key-file=/etc/kubernetes/ssl/server-key.pem -ExecStartPost=/opt/pidalio/kube/kubelet/scripts/create-descriptors.sh -ExecStop=/usr/bin/docker rm -f pidalio-apiserver -[X-Fleet] -Conflicts=pidalio-apiserver.service diff --git a/kube/units/master/pidalio-controller.service b/kube/units/master/pidalio-controller.service deleted file mode 100644 index ba586f1..0000000 --- a/kube/units/master/pidalio-controller.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Pidalio Master Controller Service -After=weave-network.target fleet.service -Requires=weave-network.target fleet.service -[Service] -Restart=always -RestartSec=10 -EnvironmentFile=/etc/pidalio.env -Environment=MASTER=true -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/retrieve-certificates.sh -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/configure-dns.sh -ExecStart=/opt/pidalio/kube/kubelet/scripts/launch-controller.sh -ExecStop=/usr/bin/pkill kube-controller-manager -[X-Fleet] -Conflicts=pidalio-controller.service diff --git a/kube/units/master/pidalio-scheduler.service b/kube/units/master/pidalio-scheduler.service deleted file mode 100644 index d79abd6..0000000 --- a/kube/units/master/pidalio-scheduler.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Pidalio Master Scheduler Service -After=weave-network.target fleet.service -Requires=weave-network.target fleet.service -[Service] -Restart=always -RestartSec=10 -EnvironmentFile=/etc/pidalio.env -Environment=MASTER=true -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/retrieve-certificates.sh -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/configure-dns.sh -ExecStart=/opt/pidalio/kube/kubelet/scripts/launch-scheduler.sh -ExecStop=/usr/bin/pkill kube-scheduler -[X-Fleet] -Conflicts=pidalio-scheduler.service diff --git a/kube/units/pidalio-node.service b/kube/units/pidalio-node.service deleted file mode 100644 index ca5274d..0000000 --- a/kube/units/pidalio-node.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Pidalio Node Service -After=weave-network.target fleet.service -Requires=weave-network.target fleet.service -[Service] -Restart=always -RestartSec=10 -EnvironmentFile=/etc/pidalio.env -Environment=MASTER=false -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/retrieve-certificates.sh -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/configure-dns.sh -ExecStart=/opt/pidalio/kube/kubelet/scripts/launch-kubelet.sh -ExecStop=/usr/bin/pkill kubelet -[X-Fleet] -Global=True diff --git a/kube/units/pidalio-proxy.service b/kube/units/pidalio-proxy.service deleted file mode 100644 index 4b3d503..0000000 --- a/kube/units/pidalio-proxy.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Pidalio Proxy Service -After=weave-network.target fleet.service -Requires=weave-network.target fleet.service -[Service] -Restart=always -RestartSec=10 -EnvironmentFile=/etc/pidalio.env -Environment=MASTER=false -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/retrieve-certificates.sh -ExecStartPre=/opt/pidalio/kube/kubelet/scripts/configure-dns.sh -ExecStart=/opt/pidalio/kube/kubelet/scripts/launch-proxy.sh -ExecStop=/usr/bin/pkill kube-proxy -[X-Fleet] -Global=True diff --git a/kube/units/pidalio.service b/kube/units/pidalio.service deleted file mode 100644 index 2277dc6..0000000 --- a/kube/units/pidalio.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Pidalio Service -After=weave-network.target -After=fleet.service -Requires=weave-network.target -Requires=fleet.service -[Service] -Restart=always -RestartSec=10 -Environment=DOCKER_HOST=unix:///var/run/weave/weave.sock -EnvironmentFile=/etc/pidalio.env -ExecStartPre=/usr/bin/docker pull cedbossneo/pidalio -ExecStartPre=/usr/bin/etcdctl cluster-health -ExecStart=/usr/bin/docker run --rm --name=pidalio \ - -e TOKEN=${PIDALIO_TOKEN} \ - -e DOMAIN=${DOMAIN} \ - -e ETCD_URI=http://etcd:2379 \ - cedbossneo/pidalio -ExecStop=/usr/bin/docker rm -f pidalio diff --git a/src/github.com/cedbossneo/pidalio/main.go b/main.go similarity index 100% rename from src/github.com/cedbossneo/pidalio/main.go rename to main.go diff --git a/src/github.com/cedbossneo/pidalio/ssl/Client.go b/ssl/Client.go similarity index 100% rename from src/github.com/cedbossneo/pidalio/ssl/Client.go rename to ssl/Client.go diff --git a/templates/baremetal/cloud-config.yaml b/templates/baremetal/cloud-config.yaml deleted file mode 100644 index a0ec0c5..0000000 --- a/templates/baremetal/cloud-config.yaml +++ /dev/null @@ -1,234 +0,0 @@ -#cloud-config -write_files: - - path: /opt/weave-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - echo WEAVE_PEERS=\"$PEER$\" > /etc/weave.env - echo WEAVEPROXY_ARGS=\"--rewrite-inspect\" >> /etc/weave.env - echo WEAVE_PASSWORD=\"$TOKEN$\" >> /etc/weave.env - - path: /opt/pidalio-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - NODE_NAME=$(hostname |cut -d '.' -f 1) - NODE_FQDN=$(hostname) - cat < /etc/pidalio.etcd.rclone.conf - [remote] - type = swift - user = ${OS_USERNAME} - key = ${OS_PASSWORD} - auth = ${OS_AUTH_URL} - tenant = ${OS_TENANT_NAME} - region = ${OS_REGION_NAME} - EOF - cat < /etc/pidalio.env - NODE_NAME=$NODE_NAME - NODE_FQDN=$NODE_FQDN - NODE_IP=$(ip -4 addr show scope global dev eno1 | grep inet | awk '{print $2}' | cut -d / -f 1 | head -n 1) - NODE_PUBLIC_IP=$NODE_IP - NODE_TYPE=local - NODE_STORAGE=false - CEPH=True - CEPH_DISK=True - CEPH_DISK_DEVICE=/dev/sdb - MONITORING=True - ETCD_NODES=3 - PEER="$PEER$" - PIDALIO_TOKEN=$TOKEN$ - DOMAIN=cluster.local - PATH=/opt/bin/:/usr/bin/:/usr/sbin:$PATH - EOF - if [[ -d /opt/pidalio ]] - then - echo "Pidalio already checkout" - else - git clone https://github.com/cedbossneo/pidalio.git /opt/pidalio - fi - /opt/pidalio/init.sh - - path: /opt/pidalio-units.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - while true; do - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-apiserver.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-controller.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-scheduler.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-proxy.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-node.service - sleep 60 - done -coreos: - update: - reboot-strategy: "off" - fleet: - public-ip: "$public_ipv4" - metadata: "region=local" - etcd_servers: "http://localhost:2379" - units: - - name: 50-docker.network - mask: true - - name: 50-docker-veth.network - mask: true - - name: zz-default.network - runtime: false - content: | - # default should not match virtual Docker/weave bridge/veth network interfaces - [Match] - Name=eth* - - [Network] - DHCP=yes - - [DHCP] - UseMTU=true - UseDomains=true - - name: etcd2.service - command: start - content: | - [Unit] - Description=etcd2 - After=weave-network.target - Requires=weave-network.target - Conflicts=etcd.service - - [Service] - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave expose - ExecStart=/opt/pidalio-init.sh - ExecStop=/usr/bin/docker rm -f etcd etcd-proxy - Restart=always - RestartSec=10s - LimitNOFILE=40000 - TimeoutStartSec=5m - - [Install] - WantedBy=multi-user.target - - name: fleet.service - command: start - - name: weave-network.target - enable: true - content: | - [Unit] - Description=Weave Network Setup Complete - Documentation=man:systemd.special(7) - RefuseManualStart=no - [Install] - WantedBy=multi-user.target - - name: weave-init.service - command: start - content: | - [Unit] - Before=install-weave.service - Description=Install Weave - [Service] - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStart=/opt/weave-init.sh - - name: 10-weave.network - runtime: false - content: | - [Match] - Type=bridge - Name=weave* - [Network] - - name: install-weave.service - enable: true - content: | - [Unit] - After=docker.service weave-init.service - Requires=docker.service weave-init.service - Before=weave.service - Description=Install Weave - Requires=network-online.target - [Service] - EnvironmentFile=-/etc/weave.env - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStartPre=/bin/mkdir -p /opt/bin/ /opt/cni/bin /etc/cni/net.d - ExecStartPre=-/usr/bin/wget -O /tmp/cni.tgz https://github.com/containernetworking/cni/releases/download/v0.3.0/cni-v0.3.0.tgz - ExecStartPre=-/usr/bin/tar -xvzf /tmp/cni.tgz -C /opt/cni/bin/ - ExecStartPre=/usr/bin/curl \ - --silent \ - --location \ - git.io/weave \ - --output /opt/bin/weave - ExecStartPre=/usr/bin/chmod +x /opt/bin/weave - ExecStart=/opt/bin/weave setup - [Install] - WantedBy=weave-network.target - WantedBy=weave.service - - name: weave.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Router - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-router $WEAVE_PEERS - ExecStart=/usr/bin/docker attach weave - Restart=on-failure - ExecStop=/opt/bin/weave stop-router - [Install] - WantedBy=weave-network.target - - name: weaveproxy.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Proxy - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-proxy $WEAVEPROXY_ARGS - ExecStart=/usr/bin/docker attach weaveproxy - Restart=on-failure - ExecStop=/opt/bin/weave stop-proxy - [Install] - WantedBy=weave-network.target - - name: weaveplugin.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Plugin - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-plugin - ExecStart=/usr/bin/docker attach weaveplugin - Restart=on-failure - ExecStop=/opt/bin/weave stop-plugin - [Install] - WantedBy=weave-network.target - - name: pidalio-launch.service - command: start - content: | - [Unit] - After=fleet.service etcd2.service - Requires=fleet.service etcd2.service - [Service] - Restart=always - RestartSec=10 - TimeoutStartSec=5m - ExecStart=/opt/pidalio-units.sh \ No newline at end of file diff --git a/templates/gce/cloud-config.yaml b/templates/gce/cloud-config.yaml deleted file mode 100644 index 2566eab..0000000 --- a/templates/gce/cloud-config.yaml +++ /dev/null @@ -1,229 +0,0 @@ -#cloud-config -write_files: - - path: /opt/weave-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - echo WEAVE_PEERS=\"${peer}\" > /etc/weave.env - echo WEAVEPROXY_ARGS=\"--rewrite-inspect\" >> /etc/weave.env - echo WEAVE_PASSWORD=\"${token}\" >> /etc/weave.env - - path: /opt/pidalio-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - NODE_NAME=$(hostname |cut -d '.' -f 1) - NODE_FQDN=$(hostname) - cat < /etc/pidalio.etcd.rclone.conf - [remote] - type = google cloud storage - EOF - cat < /etc/pidalio.env - NODE_NAME=$NODE_NAME - NODE_FQDN=$NODE_FQDN - NODE_IP=$private_ipv4 - NODE_PUBLIC_IP=$public_ipv4 - NODE_TYPE=gce - NODE_STORAGE=true - CEPH=True - CEPH_DISK=True - CEPH_DISK_DEVICE=/dev/sdb - MONITORING=True - ETCD_NODES=3 - PEER="${peer}" - PIDALIO_TOKEN=${token} - DOMAIN=cluster.local - PATH=/opt/bin/:/usr/bin/:/usr/sbin:$PATH - EOF - if [[ -d /opt/pidalio ]] - then - echo "Pidalio already checkout" - else - git clone https://github.com/cedbossneo/pidalio.git /opt/pidalio - fi - /opt/pidalio/init.sh - - path: /opt/pidalio-units.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - while true; do - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-apiserver.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-controller.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-scheduler.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-proxy.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-node.service - sleep 60 - done -coreos: - update: - reboot-strategy: "off" - fleet: - public-ip: "$public_ipv4" - metadata: "region=gce" - etcd_servers: "http://localhost:2379" - units: - - name: 50-docker.network - mask: true - - name: 50-docker-veth.network - mask: true - - name: zz-default.network - runtime: false - content: | - # default should not match virtual Docker/weave bridge/veth network interfaces - [Match] - Name=eth* - - [Network] - DHCP=yes - - [DHCP] - UseMTU=true - UseDomains=true - - name: etcd2.service - command: start - content: | - [Unit] - Description=etcd2 - After=weave-network.target - Requires=weave-network.target - Conflicts=etcd.service - - [Service] - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave expose - ExecStart=/opt/pidalio-init.sh - ExecStop=/usr/bin/docker rm -f etcd etcd-proxy - Restart=always - RestartSec=10s - LimitNOFILE=40000 - TimeoutStartSec=5m - - [Install] - WantedBy=multi-user.target - - name: fleet.service - command: start - - name: weave-network.target - enable: true - content: | - [Unit] - Description=Weave Network Setup Complete - Documentation=man:systemd.special(7) - RefuseManualStart=no - [Install] - WantedBy=multi-user.target - - name: weave-init.service - command: start - content: | - [Unit] - Before=install-weave.service - Description=Install Weave - [Service] - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStart=/opt/weave-init.sh - - name: 10-weave.network - runtime: false - content: | - [Match] - Type=bridge - Name=weave* - [Network] - - name: install-weave.service - enable: true - content: | - [Unit] - After=docker.service weave-init.service - Requires=docker.service weave-init.service - Before=weave.service - Description=Install Weave - Requires=network-online.target - [Service] - EnvironmentFile=-/etc/weave.env - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStartPre=/bin/mkdir -p /opt/bin/ /opt/cni/bin /etc/cni/net.d - ExecStartPre=-/usr/bin/wget -O /tmp/cni.tgz https://github.com/containernetworking/cni/releases/download/v0.3.0/cni-v0.3.0.tgz - ExecStartPre=-/usr/bin/tar -xvzf /tmp/cni.tgz -C /opt/cni/bin/ - ExecStartPre=/usr/bin/curl \ - --silent \ - --location \ - git.io/weave \ - --output /opt/bin/weave - ExecStartPre=/usr/bin/chmod +x /opt/bin/weave - ExecStart=/opt/bin/weave setup - [Install] - WantedBy=weave-network.target - WantedBy=weave.service - - name: weave.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Router - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-router $WEAVE_PEERS - ExecStart=/usr/bin/docker attach weave - Restart=on-failure - ExecStop=/opt/bin/weave stop-router - [Install] - WantedBy=weave-network.target - - name: weaveproxy.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Proxy - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-proxy $WEAVEPROXY_ARGS - ExecStart=/usr/bin/docker attach weaveproxy - Restart=on-failure - ExecStop=/opt/bin/weave stop-proxy - [Install] - WantedBy=weave-network.target - - name: weaveplugin.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Plugin - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-plugin - ExecStart=/usr/bin/docker attach weaveplugin - Restart=on-failure - ExecStop=/opt/bin/weave stop-plugin - [Install] - WantedBy=weave-network.target - - name: pidalio-launch.service - command: start - content: | - [Unit] - After=fleet.service etcd2.service - Requires=fleet.service etcd2.service - [Service] - Restart=always - RestartSec=10 - TimeoutStartSec=5m - ExecStart=/opt/pidalio-units.sh diff --git a/templates/openstack/cloud-config.yaml b/templates/openstack/cloud-config.yaml deleted file mode 100644 index 03ded45..0000000 --- a/templates/openstack/cloud-config.yaml +++ /dev/null @@ -1,234 +0,0 @@ -#cloud-config -write_files: - - path: /opt/weave-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - echo WEAVE_PEERS=\"$PEER$\" > /etc/weave.env - echo WEAVEPROXY_ARGS=\"--rewrite-inspect\" >> /etc/weave.env - echo WEAVE_PASSWORD=\"$TOKEN$\" >> /etc/weave.env - - path: /opt/pidalio-init.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - NODE_NAME=$(hostname |cut -d '.' -f 1) - NODE_FQDN=$(hostname) - cat < /etc/pidalio.etcd.rclone.conf - [remote] - type = swift - user = $os_username$ - key = "$os_password$" - auth = $os_auth_url$ - tenant = $os_tenant_name$ - region = $os_region$ - EOF - cat < /etc/pidalio.env - NODE_NAME=$NODE_NAME - NODE_FQDN=$NODE_FQDN - NODE_IP=$private_ipv4$ - NODE_PUBLIC_IP=$public_ipv4$ - NODE_TYPE=$os_region$ - NODE_STORAGE=false - CEPH=$ceph$ - CEPH_DISK=True - CEPH_DISK_DEVICE=/dev/vdb - MONITORING=$monitoring$ - ETCD_NODES=3 - PEER="$PEER$" - PIDALIO_TOKEN=$TOKEN$ - DOMAIN=$domain$ - PATH=/opt/bin/:/usr/bin/:/usr/sbin:$PATH - EOF - if [[ -d /opt/pidalio ]] - then - echo "Pidalio already checkout" - else - git clone https://github.com/cedbossneo/pidalio.git /opt/pidalio - fi - /opt/pidalio/init.sh - - path: /opt/pidalio-units.sh - permissions: 0700 - owner: "root:root" - content: | - #!/bin/bash - while true; do - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-apiserver.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-controller.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/master/pidalio-scheduler.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-proxy.service - /usr/bin/fleetctl start /opt/pidalio/kube/units/pidalio-node.service - sleep 60 - done -coreos: - update: - reboot-strategy: "off" - fleet: - public-ip: "$public_ipv4$" - metadata: "region=$os_region$" - etcd_servers: "http://localhost:2379" - units: - - name: 50-docker.network - mask: true - - name: 50-docker-veth.network - mask: true - - name: zz-default.network - runtime: false - content: | - # default should not match virtual Docker/weave bridge/veth network interfaces - [Match] - Name=eth* - - [Network] - DHCP=yes - - [DHCP] - UseMTU=true - UseDomains=true - - name: etcd2.service - command: start - content: | - [Unit] - Description=etcd2 - After=weave-network.target - Requires=weave-network.target - Conflicts=etcd.service - - [Service] - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave expose - ExecStart=/opt/pidalio-init.sh - ExecStop=/usr/bin/docker rm -f etcd etcd-proxy - Restart=always - RestartSec=10s - LimitNOFILE=40000 - TimeoutStartSec=5m - - [Install] - WantedBy=multi-user.target - - name: fleet.service - command: start - - name: weave-network.target - enable: true - content: | - [Unit] - Description=Weave Network Setup Complete - Documentation=man:systemd.special(7) - RefuseManualStart=no - [Install] - WantedBy=multi-user.target - - name: weave-init.service - command: start - content: | - [Unit] - Before=install-weave.service - Description=Install Weave - [Service] - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStart=/opt/weave-init.sh - - name: 10-weave.network - runtime: false - content: | - [Match] - Type=bridge - Name=weave* - [Network] - - name: install-weave.service - enable: true - content: | - [Unit] - After=docker.service weave-init.service - Requires=docker.service weave-init.service - Before=weave.service - Description=Install Weave - Requires=network-online.target - [Service] - EnvironmentFile=-/etc/weave.env - Type=oneshot - RemainAfterExit=yes - TimeoutStartSec=5m - ExecStartPre=/bin/mkdir -p /opt/bin/ /opt/cni/bin /etc/cni/net.d - ExecStartPre=-/usr/bin/wget -O /tmp/cni.tgz https://github.com/containernetworking/cni/releases/download/v0.3.0/cni-v0.3.0.tgz - ExecStartPre=-/usr/bin/tar -xvzf /tmp/cni.tgz -C /opt/cni/bin/ - ExecStartPre=/usr/bin/curl \ - --silent \ - --location \ - git.io/weave \ - --output /opt/bin/weave - ExecStartPre=/usr/bin/chmod +x /opt/bin/weave - ExecStart=/opt/bin/weave setup - [Install] - WantedBy=weave-network.target - WantedBy=weave.service - - name: weave.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Router - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-router $WEAVE_PEERS - ExecStart=/usr/bin/docker attach weave - Restart=on-failure - ExecStop=/opt/bin/weave stop-router - [Install] - WantedBy=weave-network.target - - name: weaveproxy.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Proxy - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-proxy $WEAVEPROXY_ARGS - ExecStart=/usr/bin/docker attach weaveproxy - Restart=on-failure - ExecStop=/opt/bin/weave stop-proxy - [Install] - WantedBy=weave-network.target - - name: weaveplugin.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Plugin - Documentation=http://weave.works/docs - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=5m - EnvironmentFile=-/etc/weave.env - ExecStartPre=/opt/bin/weave launch-plugin - ExecStart=/usr/bin/docker attach weaveplugin - Restart=on-failure - ExecStop=/opt/bin/weave stop-plugin - [Install] - WantedBy=weave-network.target - - name: pidalio-launch.service - command: start - content: | - [Unit] - After=fleet.service etcd2.service - Requires=fleet.service etcd2.service - [Service] - Restart=always - RestartSec=10 - TimeoutStartSec=5m - ExecStart=/opt/pidalio-units.sh \ No newline at end of file diff --git a/src/github.com/cedbossneo/pidalio/utils/Crypt.go b/utils/Crypt.go similarity index 100% rename from src/github.com/cedbossneo/pidalio/utils/Crypt.go rename to utils/Crypt.go