fix
This commit is contained in:
@@ -198,7 +198,6 @@ data "kustomization_overlay" "data" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "kustomization_overlay" "data_no_ns" {
|
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)]
|
resources = [for file in fileset(path.module, "*.yaml"): file if (length(regexall("ClusterRole",file))>0 || length(regexall("Service_prometheus",file))>0)]
|
||||||
|
|
||||||
patches {
|
patches {
|
||||||
|
|||||||
@@ -6,10 +6,40 @@ metadata:
|
|||||||
name: prometheus
|
name: prometheus
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
issuer:
|
app-group:
|
||||||
default: letsencrypt-prod
|
default: monitor
|
||||||
examples:
|
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
|
type: string
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
@@ -50,60 +80,30 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
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:
|
shards:
|
||||||
default: 1
|
default: 1
|
||||||
examples:
|
examples:
|
||||||
- 1
|
- 1
|
||||||
type: integer
|
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:
|
sub-domain:
|
||||||
default: prometheus
|
default: prometheus
|
||||||
examples:
|
examples:
|
||||||
- prometheus
|
- prometheus
|
||||||
type: string
|
type: string
|
||||||
app-group:
|
ingress-class:
|
||||||
default: monitor
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- monitor
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ resource "kubectl_manifest" "prometheus" {
|
|||||||
spec:
|
spec:
|
||||||
image: "${var.images.prometheus.registry}/${var.images.prometheus.repository}:${var.images.prometheus.tag}"
|
image: "${var.images.prometheus.registry}/${var.images.prometheus.repository}:${var.images.prometheus.tag}"
|
||||||
version: ${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}
|
replicas: ${var.replicas}
|
||||||
shards: ${var.shards}
|
shards: ${var.shards}
|
||||||
logLevel: ${var.logLevel}
|
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