add scrape config for tuya bridge and prohibit access to the metrics path via ingress [ci skip]
This commit is contained in:
parent
562040bd45
commit
3161da29a4
2 changed files with 21 additions and 1 deletions
|
|
@ -440,3 +440,14 @@ extraScrapeConfigs: |
|
||||||
action: replace
|
action: replace
|
||||||
regex: '(.*)'
|
regex: '(.*)'
|
||||||
replacement: 'registry_$${1}'
|
replacement: 'registry_$${1}'
|
||||||
|
- job_name: 'automatic-transfer-switch'
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
- "tuya-bridge.tuya-bridge.svc.cluster.local:80" # devvm
|
||||||
|
metrics_path: '/metrics'
|
||||||
|
metric_relabel_configs:
|
||||||
|
- source_labels: [ __name__ ]
|
||||||
|
target_label: '__name__'
|
||||||
|
action: replace
|
||||||
|
regex: '(.*)'
|
||||||
|
replacement: 'automatic_transfer_switch_$${1}'
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ resource "kubernetes_deployment" "tuya-bridge" {
|
||||||
}
|
}
|
||||||
spec {
|
spec {
|
||||||
container {
|
container {
|
||||||
image = "viktorbarzin/tuya_bridge"
|
image = "viktorbarzin/tuya_bridge:latest"
|
||||||
name = "tuya-bridge"
|
name = "tuya-bridge"
|
||||||
port {
|
port {
|
||||||
container_port = 8080
|
container_port = 8080
|
||||||
|
|
@ -90,4 +90,13 @@ module "ingress" {
|
||||||
namespace = "tuya-bridge"
|
namespace = "tuya-bridge"
|
||||||
name = "tuya-bridge"
|
name = "tuya-bridge"
|
||||||
tls_secret_name = var.tls_secret_name
|
tls_secret_name = var.tls_secret_name
|
||||||
|
|
||||||
|
extra_annotations = {
|
||||||
|
"nginx.ingress.kubernetes.io/server-snippet" : <<-EOF
|
||||||
|
location /metrics {
|
||||||
|
deny all;
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue