Deploy your Application

This tutorial guides you through the process of building your first Internal Developer Platform (IDP).

Log in

To begin, navigate to the Humanitec login page and choose your preferred Single-Sign-On option. Humanitec currently supports Single-Sign-On with:

  • Google
  • GitHub

Upon your first login, the Application home page welcomes you. This page showcases all the Applications you can access within your organization.

Let’s dive in and create your first Application.

Create your Application

  1. From the Applications overview, select Create new application.
  2. Enter a name for your Application (demo-app) and select Create new application to continue.

Following this, you’ll land on your Application’s overview page. Here, you can find Application level settings, like Shared Values & Secrets or access management, and a list of environments. The development Environment is created by default and must be deployed before you can create any additional environments.

To add Workloads or Shared Resources to your Application, click on the name of the development Environment and continue to the next parts.

Create a new workload

  1. Click on the Make changes button in the top right corner. This will create a new draft deployment where you can make changes.
  2. To add your first workload, select + Create new workload.
  3. Provide a name for your workload (sample-service), then select Create workload.
    1. You have the option to choose from predefined workload profiles such as: default-cronjob, default-job.

On the Workload details page, you have the ability to:

  • Add a container image
  • Add resource dependencies
  • Add DNS resources
  • Specify a service account
  • Add ports, and more

Next, add a container image to your Workload.

Add container image to workload

  1. Select the workload that you have just created by clicking on its name.
  2. Click on + Add container.
  3. From the available container images, filter and select the sample-service image.
  4. Click on Create to add the container to your Workload.

At this point, you need to define a resource dependency for this workload. Keep in mind that Secrets are generated automatically.

Add resource dependencies

  1. Locate the Resource dependencies section and select Add resource depenency.
  2. Select Postrgres.
  3. Provide a Resource ID (postgres).

Add environment variables to workloads

  1. Select + Add Variables to introduce a new variable. The Sample-Service image requires an environment variable called CONNECTION_STRING. Add it with the following details:
    • Key: CONNECTION_STRING
    • Value: postgresql://${externals.postgres.username}:${externals.postgres.password}@${externals.postgres.host}:${externals.postgres.port}/${externals.postgres.name}
  2. Click on Add at the end of the editable field to save.

Configure environment variables

  1. Choose < Back, to go to the Application details page.
  2. Select Create new workload.
    1. Provide a name for the workload, for example, sample-app.
    2. Choose Create workload to proceed to the Workload Details Screen.
  3. Select + Create new container and pick the sample-app image from the dropdown menu.
  4. Select Create to add the container image to the workload. In the Variables section, add a new environment variable with:
    • Key: PUBLIC_SERVER_URL
    • Value: http://${modules.sample-service.service.name}:8080

Add ingress solution

To direct traffic to the Sample-App and Sample-Service workloads, set up an Ingress solution. Please follow the steps below to configure the necessary settings:

  1. Select a DNS Resource from the Resource dependencies dropdown and provide a name for the DNS service.
  2. In the Ingress card’s dropdown, pick the DNS Resource you just created.
  3. Choose Default for the Path type and input 8080 in the Port field.

Deploy the Application

Ready to deploy your Application? Follow these steps:

  1. Click Review & Deploy.
  2. Type a comment in the Comment field, then click Deploy again.

Once the deployment is successful, the Development environment will indicate Successful, and the Active deployment will display as Running.

To access the frontend of your newly created app in a browser, do the following:

  1. Select the Active deployment by clicking on the comment you provided.
  2. Click on the workload name to open the Workload Details Screen.
  3. In the Ingress section, copy the generated DNS URL.
  4. Paste the copied URL into a new browser tab to load the Application.

Congratulations! You have successfully deployed your first Application in Humanitec. The Application runs on the demo infrastructure provided by Humanitec, as indicated by the *.newapp.io subdomain.

Top