[hotfix] Move prometheus to manual 2 (!105)

Co-authored-by: denis.patrakeev <denis.patrakeev@avroid.tech>
Reviewed-on: https://git.avroid.tech/K8s/k8s-configs/pulls/105
This commit is contained in:
Denis Patrakeev
2025-03-04 22:07:05 +03:00
parent 072c3e09ed
commit d7e40795ad
3 changed files with 34 additions and 20 deletions

View File

@@ -32,10 +32,10 @@ kubectl -n cloud-prod apply -f prometheus-network-policy.yaml
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update helm repo update
helm install -n prometheus prometheus-community/prometheus -f values-override.yaml \ helm install -n cloud-prod prometheus prometheus-community/prometheus -f values-override.yaml \
--set serverFiles.prometheus.yml.scrape_configs[1].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \ --set serverFiles.prometheus\\.yml.scrape_configs[1].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \
--set serverFiles.prometheus.yml.scrape_configs[2].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \ --set serverFiles.prometheus\\.yml.scrape_configs[2].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \
--set serverFiles.prometheus.yml.scrape_configs[3].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE --set serverFiles.prometheus\\.yml.scrape_configs[3].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE
``` ```
## Upgrade/Changes ## Upgrade/Changes
@@ -55,8 +55,8 @@ source .creds
Затем применяем: Затем применяем:
```bash ```bash
helm upgrade -n prometheus prometheus-community/prometheus -f values-override.yaml \ helm upgrade -n cloud-prod prometheus prometheus-community/prometheus -f values-override.yaml \
--set serverFiles.prometheus.yml.scrape_configs[1].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \ --set serverFiles.prometheus\\.yml.scrape_configs[1].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \
--set serverFiles.prometheus.yml.scrape_configs[2].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \ --set serverFiles.prometheus\\.yml.scrape_configs[2].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE \
--set serverFiles.prometheus.yml.scrape_configs[3].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE --set serverFiles.prometheus\\.yml.scrape_configs[3].consul_sd_configs[0].authorization.credentials=$PROMETHEUS_CONSUL_TOKEN_VALUE
``` ```

View File

@@ -5,7 +5,7 @@ metadata:
name: cloud-prometheus-in name: cloud-prometheus-in
namespace: cloud-prod namespace: cloud-prod
labels: labels:
app.kubernetes.io/managed-by: argocd app.kubernetes.io/managed-by: manually
spec: spec:
podSelector: podSelector:
matchLabels: matchLabels:
@@ -24,7 +24,7 @@ metadata:
name: cloud-prometheus-out name: cloud-prometheus-out
namespace: cloud-prod namespace: cloud-prod
labels: labels:
app.kubernetes.io/managed-by: argocd app.kubernetes.io/managed-by: manually
spec: spec:
podSelector: podSelector:
matchLabels: matchLabels:
@@ -38,6 +38,8 @@ spec:
protocol: TCP protocol: TCP
- port: 80 - port: 80
protocol: TCP protocol: TCP
- port: 8008
protocol: TCP
- to: - to:
- podSelector: - podSelector:
matchLabels: matchLabels:
@@ -45,4 +47,4 @@ spec:
- to: - to:
- podSelector: - podSelector:
matchLabels: matchLabels:
app.kubernetes.io/name: prometheus-postgres-exporter app: prometheus-postgres-exporter

View File

@@ -44,15 +44,6 @@ server:
## Maybe same with Ingress host name ## Maybe same with Ingress host name
baseURL: "cloud-k8s-prometheus.avroid.tech" baseURL: "cloud-k8s-prometheus.avroid.tech"
## Additional Prometheus server Secret mounts
# Defines additional mounts with secrets. Secrets must be manually created in the namespace.
extraSecretMounts:
- name: consul-secret
mountPath: /etc/secrets
subPath: ""
secretName: prometheus-secret
readOnly: true
ingress: ingress:
## If true, Prometheus server Ingress will be created ## If true, Prometheus server Ingress will be created
## ##
@@ -99,6 +90,27 @@ server:
## ##
replicaCount: 1 replicaCount: 1
## Prometheus server readiness and liveness probe initial delay and timeout
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
##
tcpSocketProbeEnabled: true
probeScheme: HTTP
readinessProbeInitialDelay: 30
readinessProbePeriodSeconds: 5
readinessProbeTimeout: 4
readinessProbeFailureThreshold: 3
readinessProbeSuccessThreshold: 1
livenessProbeInitialDelay: 30
livenessProbePeriodSeconds: 15
livenessProbeTimeout: 10
livenessProbeFailureThreshold: 3
livenessProbeSuccessThreshold: 1
startupProbe:
enabled: true
periodSeconds: 5
failureThreshold: 30
timeoutSeconds: 10
## Prometheus server resource requests and limits ## Prometheus server resource requests and limits
## Ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
## ##