fix
This commit is contained in:
@@ -198,7 +198,6 @@ data "kustomization_overlay" "data" {
|
||||
}
|
||||
|
||||
data "kustomization_overlay" "data_no_ns" {
|
||||
common_labels = local.common-labels
|
||||
resources = [for file in fileset(path.module, "*.yaml"): file if (length(regexall("ClusterRole",file))>0 || length(regexall("Service_prometheus",file))>0)]
|
||||
|
||||
patches {
|
||||
|
||||
@@ -6,10 +6,40 @@ metadata:
|
||||
name: prometheus
|
||||
description: null
|
||||
options:
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
app-group:
|
||||
default: monitor
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
- monitor
|
||||
type: string
|
||||
replicas:
|
||||
default: 1
|
||||
examples:
|
||||
- 1
|
||||
type: integer
|
||||
listenLocal:
|
||||
default: false
|
||||
examples:
|
||||
- false
|
||||
type: boolean
|
||||
enableAdminAPI:
|
||||
default: false
|
||||
examples:
|
||||
- false
|
||||
type: boolean
|
||||
retention:
|
||||
default: 10d
|
||||
examples:
|
||||
- 10d
|
||||
type: string
|
||||
logLevel:
|
||||
default: info
|
||||
examples:
|
||||
- info
|
||||
type: string
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
images:
|
||||
default:
|
||||
@@ -50,60 +80,30 @@ options:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
domain:
|
||||
default: your-company
|
||||
examples:
|
||||
- your-company
|
||||
type: string
|
||||
logLevel:
|
||||
default: info
|
||||
examples:
|
||||
- info
|
||||
type: string
|
||||
retention:
|
||||
default: 10d
|
||||
examples:
|
||||
- 10d
|
||||
type: string
|
||||
listenLocal:
|
||||
default: false
|
||||
examples:
|
||||
- false
|
||||
type: boolean
|
||||
enableAdminAPI:
|
||||
default: false
|
||||
examples:
|
||||
- false
|
||||
type: boolean
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- traefik
|
||||
type: string
|
||||
replicas:
|
||||
default: 1
|
||||
examples:
|
||||
- 1
|
||||
type: integer
|
||||
shards:
|
||||
default: 1
|
||||
examples:
|
||||
- 1
|
||||
type: integer
|
||||
domain-name:
|
||||
default: your_company.com
|
||||
examples:
|
||||
- your_company.com
|
||||
type: string
|
||||
issuer:
|
||||
default: letsencrypt-prod
|
||||
examples:
|
||||
- letsencrypt-prod
|
||||
type: string
|
||||
sub-domain:
|
||||
default: prometheus
|
||||
examples:
|
||||
- prometheus
|
||||
type: string
|
||||
app-group:
|
||||
default: monitor
|
||||
ingress-class:
|
||||
default: traefik
|
||||
examples:
|
||||
- monitor
|
||||
- traefik
|
||||
type: string
|
||||
dependencies:
|
||||
- dist: null
|
||||
|
||||
@@ -9,7 +9,7 @@ resource "kubectl_manifest" "prometheus" {
|
||||
spec:
|
||||
image: "${var.images.prometheus.registry}/${var.images.prometheus.repository}:${var.images.prometheus.tag}"
|
||||
version: ${var.images.prometheus.tag}
|
||||
externalUrl: http://prometheus-community-kube-prometheus.${var.namespace}:9090
|
||||
externalUrl: http://prometheus-operated.${var.namespace}:9090
|
||||
replicas: ${var.replicas}
|
||||
shards: ${var.shards}
|
||||
logLevel: ${var.logLevel}
|
||||
|
||||
33
monitor/prometheus/svc.tf
Normal file
33
monitor/prometheus/svc.tf
Normal file
@@ -0,0 +1,33 @@
|
||||
locals {
|
||||
svc-label = merge(local.common-labels, {
|
||||
"app" = "kube-prometheus-stack-prometheus"
|
||||
"release" = "prometheus"
|
||||
"self-monitor" = "true"
|
||||
|
||||
})
|
||||
}
|
||||
resource "kubectl_manifest" "svc" {
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "${var.component}-${var.instance}"
|
||||
namespace: "${var.namespace}"
|
||||
labels: ${jsonencode(local.svc-label)}
|
||||
spec:
|
||||
ports:
|
||||
- name: http-web
|
||||
port: 9090
|
||||
targetPort: 9090
|
||||
- name: reloader-web
|
||||
appProtocol: http
|
||||
port: 8080
|
||||
targetPort: reloader-web
|
||||
publishNotReadyAddresses: false
|
||||
selector:
|
||||
app.kubernetes.io/name: prometheus
|
||||
operator.prometheus.io/name: ${kubectl_manifest.prometheus.name}
|
||||
sessionAffinity: None
|
||||
type: "ClusterIP"
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user