(편집 : 나는 일에 완전히이를 얻기 위해 약간의 시간이 걸렸다)이 작은 사이드카 컨테이너와 함께 작동 을. 구성은 다음과 같을 수 있습니다 :
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: prometheus
spec:
replicas: 1
template:
....
spec:
containers:
... (your actual container config goes here) ...
- name: refresh
imagePullPolicy: Always
args:
- /etc/prometheus/config.yml
- http://localhost:9090/-/reload
image: tolleiv/k8s-prometheus-reload
volumeMounts:
- name: config-volume
mountPath: /etc/prometheus
volumes:
- name: config-volume
configMap:
name: prometheus
실제 검사가 관찰 된 파일과 URL 매개 변수로 전달되는이 스크립트로 수행됩니다
모든 것이
this container on Dockerhub
에서 찾을 수 있습니다
#!/bin/sh
while true; do
inotifywait "$(readlink -f $1)"
echo "[$(date +%s)] Trigger refresh"
curl -sSL -X POST "$2" > /dev/null
done
ConfigMap
이 변경되면 Kubernetes가 수행하는 심볼릭 링크 저글링 때문에 을 -m
으로 유지하는 것이 작동하지 않습니다.
나는 내 대답을 업데이트했습니다. 실제로 모든 사람들이 사용할 수있는 완전히 작동하는 솔루션을 가지고 있다는 사실을 발견했습니다. 그게 너에게 효과가 있다면 듣기 좋을거야 – pagid