Create a new Application

We'll show you how to spin up and configure a new application in 5 minutes.

Overview - What you will do

In this tutorial, you will learn how to create your first app with a development environment, add workloads, configure them, and deploy them to a Kubernetes cluster.

To get started with Humanitec, head over to our website to request a free trial. We will send you instructions on how to start your free trial right away.

The Application

We are providing two readily available images for a sample app in every new Humanitec organization: a sample-app as frontend (written in React) and a sample-service as backend (written in Python). You can find the code of the two images here for the frontend and here for the backend. Typically, images within your Internal Developer Platform would come from your own CI pipelines.

We also pre-configured the connected infrastructure for you: a GKE cluster, a CloudSQL database, and DNS managed through Route 53. Typically, your DevOps team would connect and configure these elements.

1. Create an Application

  • Navigate to the App Overview Screen. In the field labeled Create new app, enter a name for your first app, and click Create.

  • The App Details Screen screen will load. By default, you will have an environment called Development.

2. Add Workloads

  • In your App Details Screen, on Create new workload, click Select container image. Choose the Humanitec sample images: sample-app and sample-service.

  • Change the name if you want and click the checkmark to create the workload.

  • You will immediately see your Workload Details Screen. A workload will have one container created based on your selected image. You can add more container images if needed.

App before first deployment

3. Change Container Configuration

  • Navigate into the workload sample-service by clicking on the tile.

  • On the lower right you can see the section Container Configurations.

  • Change for instance the CPU allocation.

The default values for the configuration profiles are set by the DevOps team. You can learn how this works in the section App Configuration Management.

4. Add External Resources

Our sample-service requires a PostgreSQL database to run which we will add next. To do that:

  • Switch to the Draft of your application.

  • Click Edit workload (i.e., in the banner) on the sample-service tile.

  • Select + Add external resource in the External resources section.

  • Select postgres.

The external resources you can connect to a workload in your application are connected and managed by your DevOps team. Please see Infrastructure Orchestration for more details.

5. Add Environment Variables

Our sample service will need to connect to the database we added in the previous step. We do this by adding an environment variable. To do that you need to:

  • Switch to the Draft of your application.

  • Click Edit workload (i.e., in the banner) on the sample-service tile.

  • In Variables add a new environment variable with the key CONNECTION_STRING and the value postgresql://${externals.postgres.username}:${externals.postgres.password}@${}:${externals.postgres.port}/${}. This environment variable will be resolved at deployment time and enable the connection between the sample-service and the database.

You can learn all about how to manage environment variables in the section Environment Variables.

6. Expose with public DNS

If you intend for your workloads to be accessed from outside the cluster (e.g., with a web UI or an API), then you must expose those workloads with a public IP address. To do so:

  • In the Public URL section, check the box labeled Expose with public URL.

Expose public URL
  • Enter the port where the workload exposes its content in the Service port field.

  • Click Close to return to the app overview screen

See the more detailed sections in Configure an App for individual adjustments of the base configuration (e.g., to add databases, change the resource allocation).

7. Deploy the Application

  • In your environment view click the Deploy to Development button to the right of the workloads list.

  • A modal will appear with a list of the changes that will be deployed. Click the Deploy button to trigger the process.

When your app finishes deploying, the Development environment will be tagged as “Running” in the upper left corner. A public URL will show on each workload that you exposed:

Link to public URL

That’s it! Click the URL to access your workload.