This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx2 | |
labels: | |
app: nginx2 | |
app.kubernetes.io/component: blackbox | |
spec: | |
containers: | |
- name: nginx2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: nginx1 | |
labels: | |
app: nginx1 | |
app.kubernetes.io/component: blackbox | |
spec: | |
containers: | |
- name: nginx1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: monitoring.coreos.com/v1 | |
kind: ServiceMonitor | |
metadata: | |
name: blackbox-exporter | |
spec: | |
endpoints: | |
- interval: 1m | |
path: /probe | |
scrapeTimeout: 10s | |
params: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prometheus: | |
prometheusSpec: | |
serviceMonitorNamespaceSelector: {} # get service monitors on all namespaces | |
serviceMonitorSelectorNilUsesHelmValues: false | |
ruleSelectorNilUsesHelmValues: false | |
ruleNamespaceSelector: {} | |
serviceMonitorSelector: {} # get all existing service monitors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add helm repository | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
# install prometheus with helm chart | |
helm install prom prometheus-community/kube-prometheus-stack --values values-prometheus.yaml | |
# running pods | |
# chart installs additional, dependent charts | |
# - prometheus-community/kube-state-metrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add helm repository | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
# install blackbox exporter with values file | |
helm install black prometheus-community/prometheus-blackbox-exporter --values values-blackbox.yaml | |
# running pods | |
❯❯ kubectl get pods | |
NAME READY STATUS RESTARTS AGE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config: | |
modules: | |
tcp_prober: | |
prober: tcp | |
tcp: | |
ip_protocol_fallback: false | |
preferred_ip_protocol: ip4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build consul docker | |
❯❯ docker build -t erangaeb/consul:0.1 . | |
# build vault docker with consul storage backend config | |
❯❯ docker build -t erangaeb/vault-consul:0.1 . | |
# deploy consul | |
❯❯ docker-compose up -d consul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
vault-consul: | |
image: erangaeb/vault-consul:0.1 | |
ports: | |
- 8200:8200 | |
environment: | |
- VAULT_ADDR=http://127.0.0.1:8200 | |
- VAULT_API_ADDR=http://127.0.0.1:8200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"backend": { | |
"consul": { | |
"address": "consul:8500", | |
"path": "vault/" | |
} | |
}, | |
"listener": { | |
"tcp":{ | |
"address": "0.0.0.0:8200", |