Skip to content

Commit 3cbb9ca

Browse files
author
Paulo Gomes
authored
Merge pull request #801 from pjbgf/ssh-password
docs: Add password-protected SSH keys information
2 parents 0256704 + 87fba45 commit 3cbb9ca

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

docs/spec/v1beta2/gitrepositories.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ data:
152152
#### SSH authentication
153153

154154
To authenticate towards a Git repository over SSH, the referenced Secret is
155-
expected to contain `.data.identity` and `known_hosts` fields. With the respective
155+
expected to contain `identity` and `known_hosts` fields. With the respective
156156
private key of the SSH key pair, and the host keys of the Git repository.
157157

158158
```yaml
@@ -162,11 +162,28 @@ kind: Secret
162162
metadata:
163163
name: ssh-credentials
164164
type: Opaque
165-
data:
166-
identity: <BASE64>
167-
known_hosts: <BASE64>
165+
stringData:
166+
identity: |
167+
-----BEGIN OPENSSH PRIVATE KEY-----
168+
...
169+
-----END OPENSSH PRIVATE KEY-----
170+
known_hosts: |
171+
github.com ecdsa-sha2-nistp256 AAAA...
172+
```
173+
174+
Alternatively, the Flux CLI can be used to automatically create the
175+
secret, and also populate the known_hosts:
176+
177+
```sh
178+
flux create secret git podinfo-auth \
179+
--url=ssh://[email protected]/stefanprodan/podinfo \
180+
--private-key-file=./identity
168181
```
169182

183+
For password-protected SSH private keys, the password must be provided
184+
via an additional `password` field in the secret. Flux CLI also supports
185+
this via the `--password` flag.
186+
170187
### Interval
171188

172189
`.spec.interval` is a required field that specifies the interval at which the

0 commit comments

Comments
 (0)