-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
cloudflare: support reading API token from file #3552
Conversation
|
Welcome @cxuu! |
@seanmalloy @szuecs |
provider/cloudflare/cloudflare.go
Outdated
if strings.HasPrefix(token, "file:") { | ||
tokenBytes, err := ioutil.ReadFile(strings.TrimPrefix(token, "file:")) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to read CF_API_TOKEN from file: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%v -> %w
/ok-to-test |
@cxuu please fix the small nit, after that we can merge it. |
@szuecs I fixed the linter issue. The PR should be ready to merge. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cxuu, szuecs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Currently, the Cloudflare provider in external-dns can only read the Cloudflare API token from an environment variable named
$CF_API_TOKEN
. Users could populate$CF_API_TOKEN
with a Kubernetes Secret. But a more flexible way is to read the Cloudflare API token from file. For example, if the user stores the secret (Cloudflare API token) in HashiCorp Vault, and uses vault agent sidecar to provide the secret to external-dns container through a shared volume backed by memory, allowing the Cloudflare provider in external-dns to read this secret file would be superb.Checklist