Deploy your app

The following tutorial walks you through building your first Internal Developer Platform (IDP).

Login

To login, visit app.humanitec.io and select your Single-Sign-On option. Humanitec’s SSO options currently support:

  • Google
  • GitHub

When you first log in, you’ll be greeted by the Application home page. This lists all the applications you have access to inside your organization.

Create your first Application.

Create your Application

  1. From the Application page, enter the name of your Application, for example demo-app.
  2. Select Create to continue.

You will be redirected to the Environment page of your Application. You can add Workloads or Shared Resources to your Application.

Let’s add our first Workload to our application.

Create a New Workload

  1. Select + Create new workload.
  2. Enter the name of your workload, and select Create workload, for example demo-workload.
    1. Workloads default to the default-module.
    2. You can select predefined workloads, such as: default-cronjob, default-job and managed services like Reddis, RabbitMQ, MariaDB, ElasticSearch, and MongoDB.

In your Workload details page, you can:

  • add a container image
  • add resource dependencies
  • add DNS resources
  • specify a service account
  • add ports and more.

Let’s add a container image to our Workload.

Add Container Image to Workload

  1. Select + Create new container.
  2. From the list of containers, filter and select sample-service image.
  3. Choose Create to add the container image to your Workload.

Now define a resource dependency for this workload. Secrets will be automatically generated.

Add resource dependencies

  1. From the Resource dependencies section, select Postgres.
  2. Enter a Resource ID, for example my-db.

Add Environment Variables to Workloads

  1. Click the + Add Variables button to create a new variable.
    • The Sample-Service image requires an environment variable called CONNECTION_STRING, which should be added with the following information:
      • Key: CONNECTION_STRING
      • Value: postgresql://${externals.my-db.username}:${externals.my-db.password}@${externals.my-db.host}:${externals.my-db.port}/${externals.my-db.name}
  2. Click the Add button next to the end of the editable field to save.

Configure Environment Variables

  1. Select the < Back to app details button in the top right to return to the App Details page.
  2. Select Create new workload and enter a name, for example sample-app.
  3. Select Create workload and enter the Workload Details Screen.
  4. From this screen, select + Create new container and select the sample-app image from the dropdown menu.
  5. Select the Create add the container image to the workload.
    • In the Variables section, add a new environment variable with the following information:
      • Key: PUBLIC_SERVER_URL
      • Value: http://${modules.sample-service.service.name}:8080

Note: This environment variable’s placeholder is similar to a Kubernetes service name and will be resolved at launch.

Add Ingress Solution

In order to route traffic to the Sample-App and Sample-Service workloads, we’ll need to set up an Ingress solution. Follow these steps to configure the necessary settings:

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

Deploy the Application

To deploy the application, follow these steps:

  1. Click Deploy.
  2. In the Comment field, enter a comment and then click Deploy.

Once the deployment is complete, the Development environment will be marked as Successful, and the Active deployment will be shown as Running.

To access the frontend of the newly created app in a browser, follow these steps:

  1. Select the Active deployment in the left-hand column.
  2. Click on the sample-app card 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 and the app will load.

Results

Congratulations! You have successfully deployed your first app in Humanitec. The app is running on the demo infrastructure provided by Humanitec (as indicated by the *.newapp.io subdomain).

Top