Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prometheus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible-shared
prometheus
Commits
e3e090fd
Commit
e3e090fd
authored
2 years ago
by
Thomas Schneider
Browse files
Options
Downloads
Patches
Plain Diff
node_exporter: Configure k8s Prometheus scraping
parent
421e4947
Branches
Branches containing commit
No related tags found
1 merge request
!3
node_exporter: Configure k8s Prometheus scraping
Pipeline
#4792
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
node_exporter/tasks/main.yml
+22
-1
22 additions, 1 deletion
node_exporter/tasks/main.yml
with
22 additions
and
1 deletion
node_exporter/tasks/main.yml
+
22
−
1
View file @
e3e090fd
...
...
@@ -54,7 +54,7 @@
-
prometheus-exporter
-
config
-
name
:
Configure Prometheus server to scrape us
-
name
:
Configure Prometheus server to scrape us
(file)
ansible.builtin.template
:
src
:
scrape.yml.j2
dest
:
"
/etc/prometheus/scrape/node_{{
ansible_fqdn
}}.yml"
...
...
@@ -66,6 +66,27 @@
-
prometheus
-
prometheus-exporter
-
config
when
:
prometheus_host is defined
-
name
:
Configure Prometheus server to scrape us (k8s)
kubernetes.core.k8s
:
definition
:
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
"
{{
prometheus_k8s_scrape.name
}}"
namespace
:
"
{{
prometheus_k8s_scrape.namespace
}}"
data
:
"
{{
_data|items2dict
}}"
vars
:
_data
:
-
key
:
"
node_{{
ansible_fqdn
}}.yml"
value
:
"
{{
lookup('template',
'scrape.yml.j2')
}}"
delegate_to
:
localhost
tags
:
-
prometheus
-
prometheus-exporter
-
config
when
:
prometheus_k8s_scrape is defined
-
name
:
Configure needrestart integration
ansible.builtin.import_tasks
:
needrestart.yml
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment