-
Notifications
You must be signed in to change notification settings - Fork 187
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
docs: Add password-protected SSH keys information #801
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,7 +152,7 @@ data: | |
#### SSH authentication | ||
|
||
To authenticate towards a Git repository over SSH, the referenced Secret is | ||
expected to contain `.data.identity` and `known_hosts` fields. With the respective | ||
expected to contain `identity` and `known_hosts` fields. With the respective | ||
private key of the SSH key pair, and the host keys of the Git repository. | ||
|
||
```yaml | ||
|
@@ -162,11 +162,28 @@ kind: Secret | |
metadata: | ||
name: ssh-credentials | ||
type: Opaque | ||
data: | ||
identity: <BASE64> | ||
known_hosts: <BASE64> | ||
stringData: | ||
identity: | | ||
-----BEGIN OPENSSH PRIVATE KEY----- | ||
... | ||
-----END OPENSSH PRIVATE KEY----- | ||
known_hosts: | | ||
github.com ecdsa-sha2-nistp256 AAAA... | ||
``` | ||
|
||
Alternatively, the Flux CLI can be used to automatically create the | ||
secret, and also populate the known_hosts: | ||
|
||
```sh | ||
flux create secret git podinfo-auth \ | ||
--url=ssh://[email protected]/stefanprodan/podinfo \ | ||
--private-key-file=./identity | ||
``` | ||
|
||
For password-protected SSH private keys, the password must be provided | ||
via an additional `password` field in the secret. Flux CLI also supports | ||
this via the `--password` flag. | ||
|
||
### Interval | ||
|
||
`.spec.interval` is a required field that specifies the interval at which the | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Removed
.data.
to align with the approach withknown_hosts
. Alternatively, we could add the.data.
prefix on both.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.
We should be using
stringData
in examples, sinceflux create secret
generates secrets that way, so GitHub and others will alert when you push unencrypted tokens. We should tell people to useflux create secret --export
especially for Git where the CLI helps generating know hosts like SC expects.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.
I updated the example, but did not mention the
data
/stringData
conundrum, as we support both and it will come down to user preference.Also added a Flux CLI example for SSH secret creation. PTAL