From c248df4f338eebdfdeb132f044f9293dede64645 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Tue, 11 Jun 2024 17:13:16 -0500 Subject: [PATCH] Update gitrepo-add.md Added in an example yaml config when using a private git repo. This would eliminate confusion as in https://github.com/rancher/fleet/issues/2495 --- docs/gitrepo-add.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/gitrepo-add.md b/docs/gitrepo-add.md index c5929f657..73192e2a9 100644 --- a/docs/gitrepo-add.md +++ b/docs/gitrepo-add.md @@ -40,6 +40,25 @@ Put your private key into secret, use the namespace the GitRepo is in: kubectl create secret generic ssh-key -n fleet-default --from-file=ssh-privatekey=/file/to/private/key --type=kubernetes.io/ssh-auth ``` +Now the `clientSecretName` must be specified in the repo definition: + +```text +apiVersion: fleet.cattle.io/v1alpha1 +kind: GitRepo +metadata: + name: sample-ssh + # This namespace is special and auto-wired to deploy to the local cluster + namespace: fleet-local +spec: + # Everything from this repo will be run in this cluster. You trust me right? + repo: "git@github.com:rancher/fleet-examples" + # or + # repo: "ssh://git@github.com/rancher/fleet-examples" + clientSecretName: ssh-key + paths: + - simple +``` + :::caution Private key with passphrase is not supported.