Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloudflare.secretRef for custom secrets #57

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,33 @@ spec:
- name: CLOUDFLARE_API_TOKEN
valueFrom:
secretKeyRef:
{{- if hasKey .Values.cloudflare "secretRef" }}
name: {{ .Values.cloudflare.secretRef.name }}
key: {{ .Values.cloudflare.secretRef.apiTokenKey }}
{{- else }}
name: cloudflare-api
key: api-token
{{- end }}
- name: CLOUDFLARE_ACCOUNT_ID
valueFrom:
secretKeyRef:
{{- if hasKey .Values.cloudflare "secretRef" }}
name: {{ .Values.cloudflare.secretRef.name }}
key: {{ .Values.cloudflare.secretRef.accountIDKey }}
{{- else }}
name: cloudflare-api
key: cloudflare-account-id
{{- end }}
- name: CLOUDFLARE_TUNNEL_NAME
valueFrom:
secretKeyRef:
{{- if hasKey .Values.cloudflare "secretRef" }}
name: {{ .Values.cloudflare.secretRef.name }}
key: {{ .Values.cloudflare.secretRef.tunnelNameKey }}
{{- else }}
name: cloudflare-api
key: cloudflare-tunnel-name
{{- end }}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not (hasKey .Values.cloudflare "secretRef") }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,3 +7,4 @@ stringData:
api-token: "{{ .Values.cloudflare.apiToken }}"
cloudflare-account-id: "{{ .Values.cloudflare.accountId }}"
cloudflare-tunnel-name: "{{ .Values.cloudflare.tunnelName }}"
{{- end }}
14 changes: 10 additions & 4 deletions helm/cloudflare-tunnel-ingress-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.


cloudflare:
apiToken: ""
accountId: ""
tunnelName: ""
accountId: ""
tunnelName: ""
apiToken: ""

# Uncomment if you would like to use an existing secret instead of the creating a new one.
# secretRef:
# name: cloudflare-external-secret
# accountIDKey: account_id
# tunnelNameKey: tunnel_name
# apiTokenKey: api_token

ingressClass:
name: cloudflare-tunnel
Expand Down
Loading