Skip to content

Commit 2c1330b

Browse files
authored
Add SSH support (#307)
* Add SSH support * Update monitor-manage-runtimes.md * Update create-application.md
1 parent 7523bbe commit 2c1330b

File tree

4 files changed

+113
-63
lines changed

4 files changed

+113
-63
lines changed

_docs/deployment/create-application.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ General configuration settings define the source, destination, and sync policies
5050
%}
5151

5252
#### Source
53-
The Git repository to be tracked for changes to the application's source code.
54-
{::nomarkdown}<ul> <li><b>ArgoCD Project</b>: The project group to which the application belongs. A project is useful to enforce restrictions on permitted sources and targets for applications, and roles. If not defined, the application is automatically assigned to the <span style="font-family: var(--font-family-monospace); font-size: 87.5%; color: #ad6800; background-color: #fffbe6">default</span> project, which is created automatically by Argo CD and has no restrictions. </br>For more information, see Argo CD's documentation on <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#projects" target="\_blank">Projects</a>.</li> <li><b>Repository URL</b>: The Git repo or the Helm package repo with the application source code, to be tracked for changes. If the Argo CD project is not the <span style="font-family: var(--font-family-monospace); font-size: 87.5%; color: #ad6800; background-color: #fffbe6">default</span> project, make sure that the repo has the correct access roles for your application.<ul><li><b>Revision and Path</b>: Applies to Git repositories. </li><li><b>Chart</b>: Applies to Helm repositories. The name of the Helm package with all the resource definitions for the application, and the version. </li></ul>For more information, see <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/tracking_strategies/" target="\_blank">Tracking and Deployment Strategies</a>.</li></ul> {:/}
53+
The Git repository to be tracked for changes to the application's source code.
54+
55+
{::nomarkdown}<ul> <li><b>ArgoCD Project</b>: The project group to which the application belongs. A project is useful to enforce restrictions on permitted sources and targets for applications, and roles. If not defined, the application is automatically assigned to the <span style="font-family: var(--font-family-monospace); font-size: 87.5%; color: #ad6800; background-color: #fffbe6">default</span> project, which is created automatically by Argo CD and has no restrictions. </br>For more information, see Argo CD's documentation on <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#projects" target="\_blank">Projects</a>.</li> <li><b>Repository URL</b>: The Git repo or the Helm package repo with the application source code, to be tracked for changes. If SSH is configured for the runtime, you can connect to the repo with either HTTPS or SSH. On selecting the repository, Codefresh automatically updates the URL format. See <a href="https://codefresh.io/csdp-docs/docs/runtime/monitor-manage-runtimes/#configure-ssh-for-runtimes">Configure SSH for runtimes</a>.<br>If the Argo CD project is not the <span style="font-family: var(--font-family-monospace); font-size: 87.5%; color: #ad6800; background-color: #fffbe6">default</span> project, make sure that the repo has the correct access roles for your application.<ul><li><b>Revision and Path</b>: Applies to Git repositories. </li><li><b>Chart</b>: Applies to Helm repositories. The name of the Helm package with all the resource definitions for the application, and the version. </li></ul>For more information, see <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/tracking_strategies/" target="\_blank">Tracking and Deployment Strategies</a>.</li></ul> {:/}
5556

5657
{::nomarkdown}
5758
<br>

_docs/runtime/monitor-manage-runtimes.md

Lines changed: 110 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Select the view mode to view runtime components and information, and manage prov
2727

2828

2929
Manage provisioned runtimes:
30+
* [Update Git tokens for runtimes](#update-git-tokens-for-runtimes)
31+
* [Configure SSH for runtimes](#configure-ssh-for-runtimes)
3032
* [Add managed clusters to hybrid or hosted runtimes]({{site.baseurl}}/docs/runtime/managed-cluster/)
3133
* [Add and manage Git Sources associated with hybrid or hosted runtimes]({{site.baseurl}}/docs/runtime/git-sources/)
3234
* [Reset shared configuration repository](#reset-shared-configuration-repository)
@@ -100,6 +102,114 @@ Here is a description of the information in the Topology view.
100102
|**Health/Sync status** |The health and sync status of the runtime or cluster. {::nomarkdown}<ul><li><img src="../../../images/icons/error.png" display="inline-block"> indicates health or sync errors in the runtime, or a managed cluster if one was added to the runtime.</br> The runtime or cluster node is bordered in red and the name is colored red.</li> <li><img src="../../../images/icons/cf-sync-status.png" display=inline-block/> indicates that the runtime is being synced to the cluster on which it is provisioned.</li></ul> {:/} |
101103
|**Search and View options** | {::nomarkdown}<ul><li>Find a runtime or its clusters by typing part of the runtime/cluster name, and then navigate to the entries found. </li> <li>Topology view options: Resize to window, zoom in, zoom out, full screen view.</li></ul> {:/}|
102104

105+
### Update Git tokens for runtimes
106+
107+
Provisioned runtimes require valid Git tokens at all times to authenticate Git actions by you as a user.
108+
>These tokens are specific to the user, and the same token can be used for multiple runtimes.
109+
110+
There are two different situations when you need to update Git tokens:
111+
* Update invalid, revoked, or expired tokens: Codefresh automatically flags runtimes with such tokens. It is mandatory to update the Git tokens to continue working with the platform.
112+
* Update valid tokens: Optional. You may want to update Git tokens, even valid ones, by deleting the existing token and replacing it with a new token.
113+
114+
The methods for updating any Git token are the same regardless of the reason for the update:
115+
* OAuth2 authorization, if your admin has registered an OAuth Application for Codefresh
116+
* Git access token authentication, by generating a personal access token in your Git provider account with the correct scopes
117+
118+
**Before you begin**
119+
* To authenticate through a Git access token, make sure your token is valid and has [the required scopes]({{site.baseurl}}/docs/reference/git-tokens)
120+
121+
**How to**
122+
1. Do one of the following:
123+
* If you see a notification in the Codefresh UI about invalid runtime tokens, click **[Update Token]**.
124+
The Runtimes page shows runtimes with invalid tokens prefixed by the key icon. Mouse over shows invalid token.
125+
* To update an existing token, go to [Runtimes](https://g.codefresh.io/2.0/account-settings/runtimes){:target="\_blank"}.
126+
1. From the List view, select the runtime for which to update the Git token.
127+
1. From the context menu with the additional actions at the top-right, select **Update Git Runtime Credentials**.
128+
129+
{% include
130+
image.html
131+
lightbox="true"
132+
file="/images/runtime/update-git-runtime-token.png"
133+
url="/images/runtime/update-git-runtime-token.png"
134+
alt="Update Git runtime credentials"
135+
caption="Update Git runtime credentials"
136+
max-width="60%"
137+
%}
138+
139+
{:start="4"}
140+
1. Do one of the following:
141+
* If your admin has set up OAuth access, click **Authorize Access to Git Provider**. Go to _step 5_.
142+
* Alternatively, authenticate with an access token from your Git provider. Go to _step 6_.
143+
144+
{:start="5"}
145+
1. For OAuth2 authorization:
146+
> If the application is not registered, you get an error. Contact your admin for help.
147+
* Enter your credentials, and select **Sign In**.
148+
* If required, as for example if two-factor authentication is configured, complete the verification.
149+
150+
{% include
151+
image.html
152+
lightbox="true"
153+
file="/images/administration/user-settings/oauth-user-authentication.png"
154+
url="/images/administration/user-settings/oauth-user-authentication.png"
155+
alt="Authorizing access with OAuth2"
156+
caption="Authorizing access with OAuth2"
157+
max-width="30%"
158+
%}
159+
160+
{:start="6"}
161+
1. For Git token authentication, expand **Advanced authorization options**, and then paste the generated token in the **Git runtime token** field.
162+
163+
1. Click **Update Credentials**.
164+
165+
166+
### Configure SSH for runtimes
167+
By default, Git repositories use the HTTPS protocol. You can also use SSH to connect Git repositories by entering the SSH private key.
168+
169+
>When SSH is configured for a runtime, when creating/editing Git-Source applications, you can select HTTPS OR SSH as the protocol to connect to the Git repository. See [Repository URL in Application Source definitions]({{site.baseurl}}/docs/deployment/create-application/#source).
170+
171+
**SSH keys**
172+
For more information on generating SSH private keys, see the official documentation:
173+
* [GitHub](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent){:target="\_blank"}
174+
* [GitLab](https://docs.gitlab.com/ee/ssh/#generating-a-new-ssh-key-pair){:target="\_blank"}
175+
* [Bitbucket](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html){:target="\_blank"}
176+
* [Azure](https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops&tabs=current-page){:target="\_blank"}
177+
178+
**Before you begin**
179+
Copy the SSH private key for your Git provider
180+
181+
182+
**How to**
183+
1. In the Codefresh UI, make sure you are in [Runtimes](https://g.codefresh.io/2.0/account-settings/runtimes){:target="\_blank"}.
184+
1. From the **List View**, select the runtime for which to configure SSH.
185+
1. From the context menu with the additional actions at the top-right, select **Update Git Runtime Credentials**.
186+
187+
{% include
188+
image.html
189+
lightbox="true"
190+
file="/images/runtime/update-git-runtime-token.png"
191+
url="/images/runtime/update-git-runtime-token.png"
192+
alt="Update Git runtime credentials"
193+
caption="Update Git runtime credentials"
194+
max-width="60%"
195+
%}
196+
197+
{:start="4"}
198+
1. Expand **Connect Repo using SSH**, and then paste the raw SSH private key into the field.
199+
200+
{% include
201+
image.html
202+
lightbox="true"
203+
file="/images/runtime/configure-ssh-for-runtimes.png"
204+
url="/images/runtime/configure-ssh-for-runtimes.png"
205+
alt="Update Git runtime credentials"
206+
caption="Update Git runtime credentials"
207+
max-width="40%"
208+
%}
209+
210+
{:start="5"}
211+
1. Click **Update Credentials**.
212+
103213
### Reset shared configuration repository
104214
Codefresh creates the [shared configuration repository]({{site.baseurl}}/docs/reference/shared-configuration) when you install the first hybrid or hosted GitOps runtime for your account, and uses it for all runtimes you add to the same account.
105215

@@ -308,67 +418,6 @@ Pass the mandatory flags in the uninstall command:
308418

309419

310420

311-
### Update Git tokens for runtimes
312-
313-
Provisioned runtimes require valid Git tokens at all times to authenticate Git actions by you as a user.
314-
>These tokens are specific to the user, and the same token can be used for multiple runtimes.
315-
316-
There are two different situations when you need to update Git tokens:
317-
* Update invalid, revoked, or expired tokens: Codefresh automatically flags runtimes with such tokens. It is mandatory to update the Git tokens to continue working with the platform.
318-
* Update valid tokens: Optional. You may want to update Git tokens, even valid ones, by deleting the existing token and replacing it with a new token.
319-
320-
The methods for updating any Git token are the same regardless of the reason for the update:
321-
* OAuth2 authorization, if your admin has registered an OAuth Application for Codefresh
322-
* Git access token authentication, by generating a personal access token in your Git provider account with the correct scopes
323-
324-
**Before you begin**
325-
* To authenticate through a Git access token, make sure your token is valid and has [the required scopes]({{site.baseurl}}/docs/reference/git-tokens)
326-
327-
**How to**
328-
1. Do one of the following:
329-
* If you see a notification in the Codefresh UI about invalid runtime tokens, click **[Update Token]**.
330-
The Runtimes page shows runtimes with invalid tokens prefixed by the key icon. Mouse over shows invalid token.
331-
* To update an existing token, go to [Runtimes](https://g.codefresh.io/2.0/account-settings/runtimes){:target="\_blank"}.
332-
1. Select the runtime for which to update the Git token.
333-
1. From the context menu with the additional actions at the top-right, select **Update Git Runtime token**.
334-
335-
{% include
336-
image.html
337-
lightbox="true"
338-
file="/images/runtime/update-git-runtime-token.png"
339-
url="/images/runtime/update-git-runtime-token.png"
340-
alt="Update Git runtime token option"
341-
caption="Update Git runtime token option"
342-
max-width="40%"
343-
%}
344-
345-
{:start="4"}
346-
1. Do one of the following:
347-
* If your admin has set up OAuth access, click **Authorize Access to Git Provider**. Go to _step 5_.
348-
* Alternatively, authenticate with an access token from your Git provider. Go to _step 6_.
349-
350-
{:start="5"}
351-
1. For OAuth2 authorization:
352-
> If the application is not registered, you get an error. Contact your admin for help.
353-
* Enter your credentials, and select **Sign In**.
354-
* If required, as for example if two-factor authentication is configured, complete the verification.
355-
356-
{% include
357-
image.html
358-
lightbox="true"
359-
file="/images/administration/user-settings/oauth-user-authentication.png"
360-
url="/images/administration/user-settings/oauth-user-authentication.png"
361-
alt="Authorizing access with OAuth2"
362-
caption="Authorizing access with OAuth2"
363-
max-width="30%"
364-
%}
365-
366-
{:start="6"}
367-
1. For Git token authentication, expand **Advanced authorization options**, and then paste the generated token in the **Git runtime token** field.
368-
369-
1. Click **Update Token**.
370-
371-
372421

373422

374423
### Related articles
177 KB
Loading
5.64 KB
Loading

0 commit comments

Comments
 (0)