Skip to main content

Domain

Flinkwerk's flexible configuration allows you to define custom domains for preview URLs, as well as your project application and each application dependency of a project.

Define a custom domain for preview URLs

Instead of the default flinkwerk.dev domain of a project's preview URLs, you can define a custom domain. Configure a custom domain for the auto-generated URLs in the domain field of your project configuration, as shown below:

.flinkwerk/config.yml
domain: my-org.dev

Make sure you create the DNS entry for your custom domain as described below.

Expose the project at a custom domain

You can configure a domain or sub-domain alias for the application you develop within your project. This is useful if you are developing a dynamic website for a client and the production instance is supposed to be accessible at the client's corporate domain, e.g. client-domain.com.

Typically, you will want to map the production Git branch of your project to a custom domain, as shown below.

.flinkwerk/config.yaml
environments:
production:
cluster: production
routes:
- domain: "client-domain.com"
branch: production

Expose a project dependency at a custom domain

Each instance of a deployed application dependency of your project could also run under a dedicated domain or sub-domain.

As can be seen in the example below, custom domains for application dependencies can be defined via the routes field per specific branch:

environments:
development:
cluster: review
only:
- feature/*
- hotfix/*
except:
- env/production
routes:
- domain: 'my-org.dev'
branch: feature/golden
dependencies:
redis: 'r-2'

With this project configuration:

  • All Git branch names prefixed with feature/ and hotfix/ would be deployed to a cluster named development at the preview URL automatically set up by Flinkwerk.
  • The application named redis, defined as a dependency in dependencies.[name], would be deployed to the custom subdomain r-2.feature-golden.my-org.dev.

Set the DNS record

Detect the IP address of your cluster by issuing this command in your terminal:

flinkwerk clusters info my-cluster

Set the following record on your DNS provider:

Type  Name  Value
A @ xx.xx.xx.xx

Please replace xx.xx.xx.xx with the IP address you detected previously.

Finally, run this command in your project root for the changes to take effect:

flinkwerk deploy