IBM Cloud Global

Cloud Global

Our mission is to provide clients with an online user community of industry peers and IBM experts, to exchange tips and tricks, best practices, and product knowledge. We hope the information you find here helps you maximize the value of your IBM Cloud solutions.

 View Only

Deploy Application into IBM Code engine from GitHub repository SSH enabled.

By Brahadeesh Murali posted Tue December 03, 2024 10:56 PM

  

Overview

This Tutorial is an walkthrough to deploy an simple application from GitHub repository with SSH into IBM Code Engine. 

Prerequisites

  • IBM Cloud Account: Sign up for a free account if you don't have one.
  • IBM Code Engine Project: Create an IBM Cloud Code Engine Project from your IBM Cloud dashboard.

Step 1: Create an SSH certificate

  1. Open terminal and run the below commend to create SSH Certificate.
    >>
    ssh-keygen -t rsa -b 4096 -C brahadeesh.murali@ibm.com
  2. Enter File name along with path where certificate need to be generated.
  3. Enter passphrase and press enter
  4. Once you enter passphrase you can see the Public and private certificates created in the specified location.

Step 2: Add the Public certificate to GH repository.

  1. Open GitHub and login into the account
  2. Click on the profile
  3. Click on Settings
  4. Click on SSH and GPG keys
  5. Click on Add new key button you will get the below form

  6. Please give the title and Copy the content form the SSH key public certificate contents, paste in key and click add ssh key button.
  7. You can see newly created key added in the list.

Step 3: Deploy the app in code Engine.

  1. Open IBM cloud and surf to the code engine Click on create or open the server less project created where you need to deploy the application.
  2. Click on Applications and create
  3. Enter the name and select Build container image from source code.
  4. Please add the SSH secret by selecting create SSH secret in dropdown.
  5. Please enter  name and add the private certificate by clicking the insert value form file option and select the private certificate.
  6. Open the Git Hub Application repository which need to be hosted and copy the repository URL from SSH tab

  7. Please select the Cloud Native Build pack and add the resource according to your requirement.
  8. Once you have entered details please note that the application will be hosted on 8080 port as default once you click create, if you want to update port number please update under image start option and press create option.
  9. Once you have clicked create you can notice application is deploying
  10. Once the Application is successfully deployed you can see it in ready state
  11. You can use the Test application option to validate the Health check of new application deployed.

Conclusion
In this tutorial, you learned how to:

              1)        Create SSH key

              2)        Add SSH key in GitHub repository

              3)        Deploy Application in Code Engine from GitHub application SSH enabled.

This is a basic steps to deploy an simple application into Code Engine which is SSH enabled form the IBM cloud UI. 


1 comment
19 views

Permalink

Comments

Fri December 06, 2024 12:53 AM

Well documented