WIP Initial kosmos_prometheus wrapper cookbook
This commit is contained in:
@@ -9,17 +9,20 @@
|
|||||||
"automatic": {
|
"automatic": {
|
||||||
"fqdn": "prometheus-1",
|
"fqdn": "prometheus-1",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"os_version": "6.8.0-106-generic",
|
"os_version": "6.8.0-134-generic",
|
||||||
"hostname": "prometheus-1",
|
"hostname": "prometheus-1",
|
||||||
"ipaddress": "192.168.122.166",
|
"ipaddress": "192.168.122.166",
|
||||||
"roles": [
|
"roles": [
|
||||||
"base",
|
"base",
|
||||||
"kvm_guest"
|
"kvm_guest",
|
||||||
|
"prometheus_server"
|
||||||
],
|
],
|
||||||
"recipes": [
|
"recipes": [
|
||||||
"kosmos-base",
|
"kosmos-base",
|
||||||
"kosmos-base::default",
|
"kosmos-base::default",
|
||||||
"kosmos_kvm::guest",
|
"kosmos_kvm::guest",
|
||||||
|
"kosmos_prometheus::server",
|
||||||
|
"kosmos_prometheus::alertmanager",
|
||||||
"apt::default",
|
"apt::default",
|
||||||
"timezone_iii::default",
|
"timezone_iii::default",
|
||||||
"timezone_iii::debian",
|
"timezone_iii::debian",
|
||||||
@@ -32,7 +35,8 @@
|
|||||||
"postfix::_common",
|
"postfix::_common",
|
||||||
"postfix::_attributes",
|
"postfix::_attributes",
|
||||||
"postfix::sasl_auth",
|
"postfix::sasl_auth",
|
||||||
"hostname::default"
|
"hostname::default",
|
||||||
|
"firewall::default"
|
||||||
],
|
],
|
||||||
"platform": "ubuntu",
|
"platform": "ubuntu",
|
||||||
"platform_version": "24.04",
|
"platform_version": "24.04",
|
||||||
@@ -51,6 +55,7 @@
|
|||||||
},
|
},
|
||||||
"run_list": [
|
"run_list": [
|
||||||
"role[base]",
|
"role[base]",
|
||||||
"role[kvm_guest]"
|
"role[kvm_guest]",
|
||||||
|
"role[prometheus_server]"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
name "prometheus_server"
|
||||||
|
|
||||||
|
default_run_list = [
|
||||||
|
"kosmos_prometheus::server",
|
||||||
|
"kosmos_prometheus::alertmanager"
|
||||||
|
]
|
||||||
|
|
||||||
|
env_run_lists(
|
||||||
|
"_default" => default_run_list,
|
||||||
|
"development" => default_run_list,
|
||||||
|
"production" => default_run_list
|
||||||
|
)
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
.vagrant
|
||||||
|
*~
|
||||||
|
*#
|
||||||
|
.#*
|
||||||
|
\#*#
|
||||||
|
.*.sw[a-z]
|
||||||
|
*.un~
|
||||||
|
|
||||||
|
# Bundler
|
||||||
|
Gemfile.lock
|
||||||
|
gems.locked
|
||||||
|
bin/*
|
||||||
|
.bundle/*
|
||||||
|
|
||||||
|
# test kitchen
|
||||||
|
.kitchen/
|
||||||
|
kitchen.local.yml
|
||||||
|
|
||||||
|
# Chef Infra
|
||||||
|
Berksfile.lock
|
||||||
|
.zero-knife.rb
|
||||||
|
Policyfile.lock.json
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# kosmos_prometheus CHANGELOG
|
||||||
|
|
||||||
|
This file is used to list changes made in each version of the kosmos_prometheus cookbook.
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
Initial release.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
Copyright (c) 2019 Kosmos Developers
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# kosmos_prometheus
|
||||||
|
|
||||||
|
TODO: Enter the cookbook description here.
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
node.default["prometheus"]["version"] = "3.13.0"
|
||||||
|
node.default["prometheus"]["checksum"] = "744d93324cc024d82089921737bd797474d7f1e5dbbfd1c6b387bad258538cb9"
|
||||||
|
|
||||||
|
node.default["prometheus"]["alertmanager"]["version"] = "0.33.0"
|
||||||
|
node.default["prometheus"]["alertmanager"]["checksum"] = "8ce11c42e8a6dfbbf93a59c0b193cb1329210b36d0c7ef3df7b745608675a1d1"
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Put files/directories that should be ignored in this file when uploading
|
||||||
|
# to a Chef Infra Server or Supermarket.
|
||||||
|
# Lines that start with '# ' are comments.
|
||||||
|
|
||||||
|
# OS generated files #
|
||||||
|
######################
|
||||||
|
.DS_Store
|
||||||
|
ehthumbs.db
|
||||||
|
Icon?
|
||||||
|
nohup.out
|
||||||
|
Thumbs.db
|
||||||
|
.envrc
|
||||||
|
|
||||||
|
# EDITORS #
|
||||||
|
###########
|
||||||
|
.#*
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
*_flymake
|
||||||
|
*_flymake.*
|
||||||
|
*.bak
|
||||||
|
*.sw[a-z]
|
||||||
|
*.tmproj
|
||||||
|
*~
|
||||||
|
\#*
|
||||||
|
REVISION
|
||||||
|
TAGS*
|
||||||
|
tmtags
|
||||||
|
.vscode
|
||||||
|
.editorconfig
|
||||||
|
|
||||||
|
## COMPILED ##
|
||||||
|
##############
|
||||||
|
*.class
|
||||||
|
*.com
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.o
|
||||||
|
*.pyc
|
||||||
|
*.so
|
||||||
|
*/rdoc/
|
||||||
|
a.out
|
||||||
|
mkmf.log
|
||||||
|
|
||||||
|
# Testing #
|
||||||
|
###########
|
||||||
|
.circleci/*
|
||||||
|
.codeclimate.yml
|
||||||
|
.delivery/*
|
||||||
|
.foodcritic
|
||||||
|
.kitchen*
|
||||||
|
.mdlrc
|
||||||
|
.overcommit.yml
|
||||||
|
.rspec
|
||||||
|
.rubocop.yml
|
||||||
|
.travis.yml
|
||||||
|
.watchr
|
||||||
|
.yamllint
|
||||||
|
azure-pipelines.yml
|
||||||
|
Dangerfile
|
||||||
|
examples/*
|
||||||
|
features/*
|
||||||
|
Guardfile
|
||||||
|
kitchen.yml*
|
||||||
|
mlc_config.json
|
||||||
|
Procfile
|
||||||
|
Rakefile
|
||||||
|
spec/*
|
||||||
|
test/*
|
||||||
|
|
||||||
|
# SCM #
|
||||||
|
#######
|
||||||
|
.git
|
||||||
|
.gitattributes
|
||||||
|
.gitconfig
|
||||||
|
.github/*
|
||||||
|
.gitignore
|
||||||
|
.gitkeep
|
||||||
|
.gitmodules
|
||||||
|
.svn
|
||||||
|
*/.bzr/*
|
||||||
|
*/.git
|
||||||
|
*/.hg/*
|
||||||
|
*/.svn/*
|
||||||
|
|
||||||
|
# Berkshelf #
|
||||||
|
#############
|
||||||
|
Berksfile
|
||||||
|
Berksfile.lock
|
||||||
|
cookbooks/*
|
||||||
|
tmp
|
||||||
|
|
||||||
|
# Bundler #
|
||||||
|
###########
|
||||||
|
vendor/*
|
||||||
|
Gemfile
|
||||||
|
Gemfile.lock
|
||||||
|
|
||||||
|
# Policyfile #
|
||||||
|
##############
|
||||||
|
Policyfile.rb
|
||||||
|
Policyfile.lock.json
|
||||||
|
|
||||||
|
# Documentation #
|
||||||
|
#############
|
||||||
|
CODE_OF_CONDUCT*
|
||||||
|
CONTRIBUTING*
|
||||||
|
documentation/*
|
||||||
|
TESTING*
|
||||||
|
UPGRADING*
|
||||||
|
|
||||||
|
# Vagrant #
|
||||||
|
###########
|
||||||
|
.vagrant
|
||||||
|
Vagrantfile
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
name 'kosmos_prometheus'
|
||||||
|
maintainer 'Kosmos Developers'
|
||||||
|
maintainer_email 'mail@kosmos.org'
|
||||||
|
license 'MIT'
|
||||||
|
description 'Installs/Configures prometheus'
|
||||||
|
version '0.1.0'
|
||||||
|
chef_version '>= 16.0'
|
||||||
|
|
||||||
|
depends "prometheus"
|
||||||
|
|
||||||
|
# The `issues_url` points to the location where issues for this cookbook are
|
||||||
|
# tracked. A `View Issues` link will be displayed on this cookbook's page when
|
||||||
|
# uploaded to a Supermarket.
|
||||||
|
#
|
||||||
|
# issues_url 'https://github.com/<insert_org_here>/kosmos_prometheus/issues'
|
||||||
|
|
||||||
|
# The `source_url` points to the development repository for this cookbook. A
|
||||||
|
# `View Source` link will be displayed on this cookbook's page when uploaded to
|
||||||
|
# a Supermarket.
|
||||||
|
#
|
||||||
|
# source_url 'https://github.com/<insert_org_here>/kosmos_prometheus'
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Cookbook:: kosmos_prometheus
|
||||||
|
# Recipe:: alertmanager
|
||||||
|
#
|
||||||
|
|
||||||
|
include_recipe "firewall"
|
||||||
|
|
||||||
|
prometheus_alertmanager_install "alertmanager" do
|
||||||
|
version node["prometheus"]["alertmanager"]["version"]
|
||||||
|
checksum node["prometheus"]["alertmanager"]["checksum"]
|
||||||
|
end
|
||||||
|
|
||||||
|
prometheus_alertmanager_config "alertmanager"
|
||||||
|
prometheus_alertmanager_service "alertmanager"
|
||||||
|
|
||||||
|
firewall_rule "prometheus alertmanager" do
|
||||||
|
port 9093
|
||||||
|
source "10.1.1.0/24"
|
||||||
|
protocol :tcp
|
||||||
|
command :allow
|
||||||
|
end
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#
|
||||||
|
# Cookbook:: kosmos_prometheus
|
||||||
|
# Recipe:: server
|
||||||
|
#
|
||||||
|
|
||||||
|
include_recipe "firewall"
|
||||||
|
|
||||||
|
prometheus_install "prometheus" do
|
||||||
|
version node["prometheus"]["version"]
|
||||||
|
checksum node["prometheus"]["checksum"]
|
||||||
|
end
|
||||||
|
|
||||||
|
prometheus_config "prometheus" do
|
||||||
|
# scrape_interval "60s"
|
||||||
|
# evaluation_interval "60s"
|
||||||
|
end
|
||||||
|
|
||||||
|
prometheus_job "prometheus" do
|
||||||
|
target "localhost:9090"
|
||||||
|
end
|
||||||
|
|
||||||
|
prometheus_service "prometheus" do
|
||||||
|
cli_options({
|
||||||
|
"config.file" => "/opt/prometheus/prometheus.yml",
|
||||||
|
"log.level" => "info",
|
||||||
|
"query.max-concurrency" => 20,
|
||||||
|
"query.lookback-delta" => "5m",
|
||||||
|
"query.timeout" => "2m",
|
||||||
|
"storage.tsdb.path" => "/var/lib/prometheus",
|
||||||
|
"storage.tsdb.retention.time" => "15d",
|
||||||
|
"web.listen-address" => ":9090",
|
||||||
|
"web.telemetry-path" => ""
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
firewall_rule "prometheus web" do
|
||||||
|
port 9090
|
||||||
|
source "10.1.1.0/24"
|
||||||
|
protocol :tcp
|
||||||
|
command :allow
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user