Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

Support Git over HTTPS with creds from env vars #2470

Merged
merged 5 commits into from
Sep 26, 2019
Merged
Changes from 1 commit
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
15 changes: 11 additions & 4 deletions docs/guides/use-git-https.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,13 @@ as a plain value in your workload.
> to pass the values to the Flux container, e.g. `$(GIT_AUTHKEY)`.
> [Read more about this Kubernetes feature](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config).

1. create a Kubernetes secret with two environment variables and their
1. Create a personal access token to be used as the `GIT_AUTHKEY`:

- [GitHub](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
- [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token)
- [BitBucket](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html)

1. Create a Kubernetes secret with two environment variables and their
respective values (replace `<username>` and `<token/password>`):

```sh
@@ -33,7 +39,7 @@ as a plain value in your workload.
...
```

1. mount the Kubernetes secret as environment variables using `envFrom`
1. Mount the Kubernetes secret as environment variables using `envFrom`
and use them in your `--git-url` argument:

```yaml
@@ -49,6 +55,7 @@ as a plain value in your workload.
- secretRef:
name: flux-git-auth
args:
- --git-url=https://$(GIT_AUTHUSER):$(GIT_AUTHKEY)@<USER>/flux-get-started.git
# Replace `github.com/...` with your git repository
- --git-url=https://$(GIT_AUTHUSER):$(GIT_AUTHKEY)@github.com/fluxcd/flux-get-started.git
...
```
```