Permalink
Browse files

Merge pull request #58 from pieterlange/metrics

Change metrics collection from logs to prometheus
  • Loading branch information...
pieterlange committed Apr 2, 2018
2 parents 7716b97 + 9e635e5 commit d563f002eae66f3caac90b764dd3fc16d4a40541
Showing with 27 additions and 21 deletions.
  1. +2 −1 entrypoint.sh
  2. +1 −0 kube/deploy.sh
  3. +24 −1 kube/deployment.yaml
  4. +0 −19 print-status.sh
View
@@ -22,6 +22,7 @@ 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_VERSION=${OVPN_STATUS_VERSION:-2}
if [ ! -d "${EASYRSA_PKI}" ]; then
echo "PKI directory missing. Did you mount in your Secret?"
@@ -101,7 +102,7 @@ fi
if [ -n "${OVPN_STATUS}" ]; then
addArg "--status" "${OVPN_STATUS}"
/sbin/print-status.sh ${OVPN_STATUS} &
addArg "--status-version" "${OVPN_STATUS_VERSION}"
fi
if [ $DEBUG ]; then
View
@@ -65,6 +65,7 @@ data:
podcidr: "${podcidr}"
serverurl: "${serverurl}"
domain: "${domain}"
statusfile: "/etc/openvpn/status/server.status"
---
EOCONFIGMAP
View
@@ -9,12 +9,15 @@ spec:
metadata:
labels:
openvpn: ${OVPN_CN}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9176"
spec:
restartPolicy: Always
terminationGracePeriodSeconds: 60
containers:
- name: openvpn
image: ptlange/openvpn:latest
image: quay.io/plange/openvpn:latest
securityContext:
capabilities:
add:
@@ -35,6 +38,11 @@ spec:
name: openvpn-ccd
- mountPath: /etc/openvpn/portmapping
name: openvpn-portmapping
- mountPath: /etc/openvpn/status
name: openvpn-status
ports:
- name: openvpn
containerPort: 1194
env:
- name: PODIPADDR
valueFrom:
@@ -60,6 +68,19 @@ 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:
- name: openvpn
containerPort: 9176
volumeMounts:
- mountPath: /etc/openvpn_exporter/
name: openvpn-status
volumes:
- name: openvpn-pki
secret:
@@ -75,3 +96,5 @@ spec:
- name: openvpn-portmapping
configMap:
name: openvpn-portmapping
- name: openvpn-status
emptyDir: {}
View

This file was deleted.

Oops, something went wrong.

0 comments on commit d563f00

Please sign in to comment.