sidebar | permalink | summary |
---|---|---|
sidebar |
solutions-add-application-from-github.html |
Learn how to deploy an Application from a GitHub repository. |
Learn how to deploy an Application on your NetApp Kubernetes Services (NKS) cluster from a GitHub repository.
If you don’t have an app to test, feel free to use our demo app.
Requirements
-
An NKS account. If you don’t have one already, you can sign up for a free 30-day trial with no credit card required at https://nks.netapp.io.
-
A Project set up and configured on your NKS account.
-
An NKS cluster with Build Version:
Classic
. -
An application in a GitHub repository.
-
An SSH key pair for use as the deploy key. IMPORTANT: Create this key pair without a passphrase.
For instructions on how to create an SSH key pair, follow the instructions in this article.
If you have problems getting your Application up and running, you may need to customize your Procfile. Learn more about using a Procfile.
The first step is to add the Application to your NKS account.
Click Projects then select the Project you want to use.
Click + Add Solution. Click Application as the Solution type.
Select the Workspace, Cluster, and Project you want to use, then click Next.
In this step you will set two items:
-
NKS: The Remote URL
-
GitHub: The Private Deploy Key
Remote URL
To get this URL, visit your project’s GitHub repository page and click the green Clone or download button.
Note
|
You must use "Clone with SSH." If the pop-up says "Clone with HTTPS", click the "Use SSH" link in the upper right-hand corner of the pop-up to switch to SSH. |
Click to copy the SSH URL. Paste this in to NKS as the Remote URL.
Private Deploy Key
For this step you will need an SSH key pair. IMPORTANT: Create this key pair without a passphrase.
For more information on how to create an SSH key pair, see this article.
Use caution when copying the SSH key. For instructions on how to copy the SSH key, see this article.
-
Mac: Use
pbcopy
. -
Linux: Use
xclip
. -
Windows: Use Notepad. If you have Git BASH, use the
clip
command.
Paste the private key into the Private Deploy Key field on NKS. You will add the public key to GitHub in the next section.
Click Next to continue.
Set the application’s name, update strategy, and scaling. Click Next to continue.
Next, you will add configurations to your GitHub repository. To do this, you will give GitHub:
-
The Deploy Key. This is the public key you created.
-
The Payload URL (webhook) from NKS.
-
The Webhook Secret from NKS.
Go to the GitHub page for your repository and click Settings.
Click Deploy keys then click Add deploy key.
-
Be sure to add the public (not private) SSH key.
-
You do not need to enable write access.
From the GitHub Settings page, click Webhooks then click Add webhook.
Return to the NKS application page, where you will find the Payload URL and Webhook Secret.
Paste these in to the Payload URL and Webhook Secret fields on GitHub.
-
For Content Type select
application/json
. -
Enable SSL verification.
-
Set the events you want to trigger the webhook.
Click Add webhook to add the webhook.
When you add your webhook, GitHub gives you three choices for which events trigger the webhook:
-
Just the
push
event -
Send me everything
-
Let me select individual events
If your webhook is triggered by a push
event, you will need to do a git push
to trigger the webhook.
At this point everything is configured, although it make take a few minutes for the deployment to complete. You can monitor the process on the Solution’s Metrics tab.
When the deployment is ready, you can view your application by visiting the ingress URL which NKS automatically created for your application.