Skip to content

Commit

Permalink
Update: Refactoring Cloudflare Tunnel chart (#547)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
  • Loading branch information
nlamirault committed Sep 28, 2023
1 parent a821b69 commit 118c4d9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
6 changes: 4 additions & 2 deletions charts/cloudflare-tunnel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
name: cloudflare-tunnel
description: Creation of a cloudflared deployment - a reverse tunnel for an environment
type: application
version: 0.1.0
version: 0.2.0
appVersion: "2023.5.1"
icon: https://www.vectorlogo.zone/logos/cloudflare/cloudflare-icon.svg
home: https://github.com/nlamirault/portefaix-hub
Expand Down Expand Up @@ -33,4 +33,6 @@ annotations:
url: https://keybase.io/nlamirault/pgp_keys.asc
artifacthub.io/changes: |
- kind: added
description: Bootstrap chart from Cloudflare chart
description: Expose metrics port
- kind: fixed
description: ServiceMonitor selector labels indentation
3 changes: 2 additions & 1 deletion charts/cloudflare-tunnel/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cloudflare-tunnel

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2023.5.1](https://img.shields.io/badge/AppVersion-2023.5.1-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2023.5.1](https://img.shields.io/badge/AppVersion-2023.5.1-informational?style=flat-square)

Creation of a cloudflared deployment - a reverse tunnel for an environment

Expand Down Expand Up @@ -35,6 +35,7 @@ Creation of a cloudflared deployment - a reverse tunnel for an environment
| image.repository | string | `"cloudflare/cloudflared"` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| metrics.port | int | `2000` | The port on which to expose the metrics and ready endpoints |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/cloudflare-tunnel/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
warp-routing:
enabled: {{ .Values.cloudflare.enableWarp }}
# Serves the metrics server under /metrics and the readiness server under /ready
metrics: 0.0.0.0:2000
metrics: 0.0.0.0:{{ .Values.metrics.port }}
# Specifies the protocol used to establish a connection between cloudflared and the Cloudflare global network
protocol: {{ default "auto" .Values.cloudflare.protocol }}
# Autoupdates applied in a k8s pod will be lost when the pod is removed or restarted, so
Expand Down
5 changes: 4 additions & 1 deletion charts/cloudflare-tunnel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ spec:
# Cloudflared has a /ready endpoint which returns 200 if and only if
# it has an active connection to the edge.
path: /ready
port: 2000
port: {{ .Values.metrics.port }}
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
ports:
- containerPort: {{ .Values.metrics.port }}
name: http-metrics
volumeMounts:
- name: config
mountPath: /etc/cloudflared/config
Expand Down
4 changes: 2 additions & 2 deletions charts/cloudflare-tunnel/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
spec:
type: ClusterIP
ports:
- port: 2000
targetPort: 2000
- port: {{ .Values.metrics.port }}
targetPort: {{ .Values.metrics.port }}
protocol: TCP
name: metrics
selector:
Expand Down
4 changes: 4 additions & 0 deletions charts/cloudflare-tunnel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ cloudflare:
# - hostname: hello.example.com
# service: hello_world

metrics:
# -- The port on which to expose the metrics and ready endpoints
port: 2000

image:
repository: cloudflare/cloudflared
pullPolicy: IfNotPresent
Expand Down

0 comments on commit 118c4d9

Please sign in to comment.