From 9e635e5055cca4b3774ada586c24d153e97821ca Mon Sep 17 00:00:00 2001 From: Pieter Lange Date: Mon, 2 Apr 2018 22:22:17 +0200 Subject: [PATCH] Do not enable prometheus by default & and add prometheus annotations --- entrypoint.sh | 1 - kube/deploy.sh | 1 + kube/deployment.yaml | 8 ++++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9876fdd..2c2aead 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,7 +22,6 @@ OVPN_PROTO="${OVPN_PROTO:-tcp}" OVPN_NATDEVICE="${OVPN_NATDEVICE:-eth0}" OVPN_K8S_DOMAIN="${OVPN_K8S_DOMAIN:-svc.cluster.local}" OVPN_VERB=${OVPN_VERB:-3} -OVPN_STATUS="${OVPN_STATUS:-${OPENVPN}/status/server.status}" OVPN_STATUS_VERSION=${OVPN_STATUS_VERSION:-2} if [ ! -d "${EASYRSA_PKI}" ]; then diff --git a/kube/deploy.sh b/kube/deploy.sh index cd70478..95c2b66 100755 --- a/kube/deploy.sh +++ b/kube/deploy.sh @@ -65,6 +65,7 @@ data: podcidr: "${podcidr}" serverurl: "${serverurl}" domain: "${domain}" + statusfile: "/etc/openvpn/status/server.status" --- EOCONFIGMAP diff --git a/kube/deployment.yaml b/kube/deployment.yaml index df76cc6..b68f8fb 100644 --- a/kube/deployment.yaml +++ b/kube/deployment.yaml @@ -9,6 +9,9 @@ spec: metadata: labels: openvpn: ${OVPN_CN} + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9176" spec: restartPolicy: Always terminationGracePeriodSeconds: 60 @@ -65,6 +68,11 @@ spec: configMapKeyRef: name: openvpn-settings key: domain + - name: OVPN_STATUS + valueFrom: + configMapKeyRef: + name: openvpn-settings + key: statusfile - name: metrics image: quay.io/plange/openvpn_exporter:latest ports: