Con el SSO ya funcionando (379af6d), a la web sólo se entra por Authentik.
Ayer se dejó abierto a propósito porque el SSO acababa de estar 15 días roto en
silencio y no quería quedarme sin puerta; hoy, verificado que funciona, se
cierra.
Lo que NO cierra, y es lo que importa: la auth básica de la API sigue abierta.
De ella cuelgan los dos sidecars —que es exactamente lo que se rompió mudo el
21 y dejó de recargar dashboards y datasources— y la puerta de emergencia con
la contraseña del secret grafana-admin.
Sí desaparece la otra: el POST /login pasa a devolver 400. Comprobado antes y
después, porque era la salida que uno supondría disponible y ya no lo está.
El procedimiento de rescate queda escrito junto al valor: la API con
grafana-admin, y disable_login_form: false + helm upgrade para recuperar el
formulario en un minuto.
Verificado: SSO entra como akadmin; la auth básica entra como admin;
disableLoginForm=true y authProxyEnabled=true en /api/frontend/settings; desde
fuera sigue el 302 a Authentik; y los DOS sidecars probados con ConfigMaps
reales, con 200 OK y el dashboard de prueba llegando de verdad a Grafana (y
desapareciendo al retirar el ConfigMap). 0 errores en el arranque.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
286 lines
8.5 KiB
YAML
286 lines
8.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
meta.helm.sh/release-name: kube-prometheus-stack
|
|
meta.helm.sh/release-namespace: monitoring
|
|
labels:
|
|
app.kubernetes.io/instance: kube-prometheus-stack
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: grafana
|
|
app.kubernetes.io/version: 12.4.2
|
|
helm.sh/chart: grafana-11.5.0
|
|
name: kube-prometheus-stack-grafana
|
|
namespace: monitoring
|
|
spec:
|
|
progressDeadlineSeconds: 600
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: kube-prometheus-stack
|
|
app.kubernetes.io/name: grafana
|
|
strategy:
|
|
rollingUpdate:
|
|
maxSurge: 25%
|
|
maxUnavailable: 25%
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/config: a7d11f09c8d1845579310ceaad050350fe99b00a81b24756ce6a8e27827adf7a
|
|
checksum/sc-dashboard-provider-config: e70bf6a851099d385178a76de9757bb0bef8299da6d8443602590e44f05fdf24
|
|
kubectl.kubernetes.io/default-container: grafana
|
|
labels:
|
|
app.kubernetes.io/instance: kube-prometheus-stack
|
|
app.kubernetes.io/name: grafana
|
|
app.kubernetes.io/version: 12.4.2
|
|
helm.sh/chart: grafana-11.5.0
|
|
spec:
|
|
automountServiceAccountToken: true
|
|
containers:
|
|
- env:
|
|
- name: METHOD
|
|
value: WATCH
|
|
- name: LABEL
|
|
value: grafana_dashboard
|
|
- name: LABEL_VALUE
|
|
value: '1'
|
|
- name: FOLDER
|
|
value: /tmp/dashboards
|
|
- name: RESOURCE
|
|
value: both
|
|
- name: NAMESPACE
|
|
value: ALL
|
|
- name: REQ_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-user
|
|
name: grafana-admin
|
|
- name: REQ_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-password
|
|
name: grafana-admin
|
|
- name: REQ_URL
|
|
value: http://localhost:3000/api/admin/provisioning/dashboards/reload
|
|
- name: REQ_METHOD
|
|
value: POST
|
|
image: quay.io/kiwigrid/k8s-sidecar:2.6.0
|
|
imagePullPolicy: IfNotPresent
|
|
name: grafana-sc-dashboard
|
|
resources: {}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
volumeMounts:
|
|
- mountPath: /tmp/dashboards
|
|
name: sc-dashboard-volume
|
|
- env:
|
|
- name: METHOD
|
|
value: WATCH
|
|
- name: LABEL
|
|
value: grafana_datasource
|
|
- name: LABEL_VALUE
|
|
value: '1'
|
|
- name: FOLDER
|
|
value: /etc/grafana/provisioning/datasources
|
|
- name: RESOURCE
|
|
value: both
|
|
- name: REQ_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-user
|
|
name: grafana-admin
|
|
- name: REQ_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-password
|
|
name: grafana-admin
|
|
- name: REQ_URL
|
|
value: http://localhost:3000/api/admin/provisioning/datasources/reload
|
|
- name: REQ_METHOD
|
|
value: POST
|
|
image: quay.io/kiwigrid/k8s-sidecar:2.6.0
|
|
imagePullPolicy: IfNotPresent
|
|
name: grafana-sc-datasources
|
|
resources: {}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
volumeMounts:
|
|
- mountPath: /etc/grafana/provisioning/datasources
|
|
name: sc-datasources-volume
|
|
- env:
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
apiVersion: v1
|
|
fieldPath: status.podIP
|
|
- name: GF_SECURITY_ADMIN_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-user
|
|
name: grafana-admin
|
|
- name: GF_SECURITY_ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: admin-password
|
|
name: grafana-admin
|
|
- name: GF_PATHS_DATA
|
|
value: /var/lib/grafana/
|
|
- name: GF_PATHS_LOGS
|
|
value: /var/log/grafana
|
|
- name: GF_PATHS_PLUGINS
|
|
value: /var/lib/grafana/plugins
|
|
- name: GF_PATHS_PROVISIONING
|
|
value: /etc/grafana/provisioning
|
|
- name: GF_UNIFIED_STORAGE_INDEX_PATH
|
|
value: /var/lib/grafana-search/bleve
|
|
- name: TELEGRAM_BOT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: TELEGRAM_BOT_TOKEN
|
|
name: grafana-telegram-infisical
|
|
- name: TELEGRAM_CHAT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: TELEGRAM_CHAT_ID
|
|
name: grafana-telegram-infisical
|
|
image: docker.io/grafana/grafana:12.4.2
|
|
imagePullPolicy: IfNotPresent
|
|
livenessProbe:
|
|
failureThreshold: 10
|
|
httpGet:
|
|
path: /api/health
|
|
port: grafana
|
|
scheme: HTTP
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 30
|
|
name: grafana
|
|
ports:
|
|
- containerPort: 3000
|
|
name: grafana
|
|
protocol: TCP
|
|
- containerPort: 9094
|
|
name: gossip-tcp
|
|
protocol: TCP
|
|
- containerPort: 9094
|
|
name: gossip-udp
|
|
protocol: UDP
|
|
- containerPort: 6060
|
|
name: profiling
|
|
protocol: TCP
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /api/health
|
|
port: grafana
|
|
scheme: HTTP
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 1
|
|
resources: {}
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
privileged: false
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
volumeMounts:
|
|
- mountPath: /etc/grafana/grafana.ini
|
|
name: config
|
|
subPath: grafana.ini
|
|
- mountPath: /etc/grafana/provisioning/alerting
|
|
name: grafana-alerting
|
|
- mountPath: /var/lib/grafana
|
|
name: storage
|
|
- mountPath: /var/lib/grafana-search
|
|
name: search
|
|
- mountPath: /tmp/dashboards
|
|
name: sc-dashboard-volume
|
|
- mountPath: /etc/grafana/provisioning/dashboards/sc-dashboardproviders.yaml
|
|
name: sc-dashboard-provider
|
|
subPath: provider.yaml
|
|
- mountPath: /etc/grafana/provisioning/datasources
|
|
name: sc-datasources-volume
|
|
dnsPolicy: ClusterFirst
|
|
enableServiceLinks: true
|
|
initContainers:
|
|
- command:
|
|
- chown
|
|
- -R
|
|
- 472:472
|
|
- /var/lib/grafana
|
|
image: docker.io/library/busybox:1.37.0
|
|
imagePullPolicy: IfNotPresent
|
|
name: init-chown-data
|
|
resources: {}
|
|
securityContext:
|
|
capabilities:
|
|
add:
|
|
- CHOWN
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: false
|
|
runAsNonRoot: false
|
|
runAsUser: 0
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
terminationMessagePath: /dev/termination-log
|
|
terminationMessagePolicy: File
|
|
volumeMounts:
|
|
- mountPath: /var/lib/grafana
|
|
name: storage
|
|
restartPolicy: Always
|
|
schedulerName: default-scheduler
|
|
securityContext:
|
|
fsGroup: 472
|
|
runAsGroup: 472
|
|
runAsNonRoot: true
|
|
runAsUser: 472
|
|
serviceAccount: kube-prometheus-stack-grafana
|
|
serviceAccountName: kube-prometheus-stack-grafana
|
|
shareProcessNamespace: false
|
|
terminationGracePeriodSeconds: 30
|
|
volumes:
|
|
- configMap:
|
|
defaultMode: 420
|
|
name: kube-prometheus-stack-grafana
|
|
name: config
|
|
- configMap:
|
|
defaultMode: 420
|
|
name: grafana-alerting
|
|
name: grafana-alerting
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
claimName: kube-prometheus-stack-grafana
|
|
- emptyDir: {}
|
|
name: search
|
|
- emptyDir: {}
|
|
name: sc-dashboard-volume
|
|
- configMap:
|
|
defaultMode: 420
|
|
name: kube-prometheus-stack-grafana-config-dashboards
|
|
name: sc-dashboard-provider
|
|
- emptyDir: {}
|
|
name: sc-datasources-volume
|