Skip to content

Commit

Permalink
Cloudflared metrics (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
STRRL committed Jun 30, 2023
1 parent bfef6b1 commit fc53617
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hack/dev/ingress-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: cloudflare-tunnel
annotations:
ingressclass.kubernetes.io/is-default-class: "true"
spec:
controller: strrl.dev/cloudflare-tunnel-ingress-controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# a headless service
appVersion: v1
kind: Service
metadata:
name: controlled-cloudflared-connector-headless
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "44483"
spec:
ports:
- name: metrics
port: 44483
protocol: TCP
clusterIP: None
selector:
"app": "controlled-cloudflared-connector"
"strrl.dev/cloudflare-tunnel-ingress-controller": "controlled-cloudflared-connector"
3 changes: 3 additions & 0 deletions pkg/controller/controlled-cloudflared-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controller

import (
"context"

cloudflarecontroller "github.com/STRRL/cloudflare-tunnel-ingress-controller/pkg/cloudflare-controller"
"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -81,6 +82,8 @@ func cloudflaredConnectDeploymentTemplating(token string, namespace string) *app
"cloudflared",
"--no-autoupdate",
"tunnel",
"--metrics",
"0.0.0.0:44483",
"run",
"--token",
token,
Expand Down
1 change: 1 addition & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ manifests:
- hack/dev/ns.yaml
- hack/dev/cloudflare-api.yaml
- hack/dev/deployment.yaml
- hack/dev/ingress-class.yaml

0 comments on commit fc53617

Please sign in to comment.