Skip to content

Commit

Permalink
Merge pull request #355 from Qovery/update_cloudflare_tutorial
Browse files Browse the repository at this point in the history
Update Cloudflare tutorial
  • Loading branch information
jul-dan authored Dec 13, 2023
2 parents 0d4894e + 1b41841 commit 45a2b90
Show file tree
Hide file tree
Showing 16 changed files with 144 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .meta/team.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ keybase = "https://keybase.io/benjaminch"
name = "Benjamin Chastanier"
bio = """\
Benjamin is a senior Backend Developer at <a href=\"https://www.qovery.com\">Qovery</a>.\
"""

[[team]]
id = "jul-dan"
avatar = "https://github.com/jul-dan.png"
github = "https://github.com/jul-dan"
keybase = "https://keybase.io/jul-dan"
name = "Julien Dan"
bio = """\
Julien is a Technical Product Manager at <a href=\"https://www.qovery.com\">Qovery</a>.\
"""
2 changes: 1 addition & 1 deletion website/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_on: "2023-06-07"
last_modified_on: "2023-12-11"
title: Getting started
description: "About Qovery, the platform that accelerates and scales application development cycle with zero infrastructure management investment."
sidebar_label: hidden
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_on: "2023-12-06"
last_modified_on: "2023-12-11"
title: "Scaleway (SCW)"
description: "Learn how to configure and plug your Scaleway (SCW) account"
---
Expand Down Expand Up @@ -184,7 +184,7 @@ Get your `project id` on your project dashboard

</Steps>

Well done!! You now have your Scaleway `access key id`, `secret access key` and `project id`; It is time to connect Qovery to your Scaleway account.
Well done!! You now have your Scaleway `access key id`, `secret access key`, `organization_id` and `project id`; It is time to connect Qovery to your Scaleway account.

### Install a new cluster on Qovery

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_on: "2023-12-06"
last_modified_on: "2023-12-11"
title: "Running and Deployment Statuses"
description: "Learn how to monitor your services"
---
Expand Down Expand Up @@ -97,7 +97,7 @@ When you access an environment on your [Qovery Console][urls.qovery_console], yo

<Alert type="info">

Just because an error arose during deployment does not mean your application is not running. Monitoring both your deployment and service statuses allows you to know exactly which applications are currently running on your platform.
Just because an error arised during deployment does not mean your application is not running. Monitoring both your deployment and service statuses allows you to know exactly which applications are currently running on your platform.

</Alert>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
last_modified_on: "2021-12-17"
last_modified_on: "2023-12-12"
$schema: "/.meta/.schemas/guides.json"
title: Setting up Cloudflare and Custom Domain on Qovery
description: Using Cloudflare for applications deployed on Qovery
author_github: https://github.com/pjeziorowski
author_github: https://github.com/jul-dan
tags: ["type: tutorial", "technology: qovery"]
hide_pagination: true
---
Expand Down Expand Up @@ -67,6 +67,64 @@ The last step to configure the domain Cloudflare side properly, is to use the `F

This is the requirement to make Custom Domain work properly using Cloudflare as the domain provider on Qovery.

### Restrict application access

If you want to limit the application access via Cloudflare only, you have two ways to perform it:

#### IP whitelisting

In Qovery it is possible to whitelist a range of IPs that can reach your application:
* In the advanced settings section of your application:
<p align="center">
<img src="/img/cloudflare/8.png" alt="Cloudflare" />
</p>
* Get the [Cloudflare ips](https://www.cloudflare.com/ips-v4/)
* Edit the `network.ingress.whitelist_source_range` setting and add the Cloudflare IPs separated with a comma:
<p align="center">
<img src="/img/cloudflare/9.png" alt="Cloudflare" />
</p>
* Save and redeploy your application

#### Cloudflared

Cloudflared establishes outbound connections (tunnels) between your resources and Cloudflare’s global network.

You have different ways to install Cloudflared on your cluster, you can find the installation instructions within this [documentation](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/)
Since Cloudflared establishes a tunnel for you and the domain and TLS management is done by Cloudflare, you don't need to expose publicly the application during the setup (See [port setup][docs.using-qovery.configuration.application#ports]

You can decide to install Cloudflared by yourself or via Qovery. Within the section below, you will find documentation on how to install Cloudflared as a container in one of the Qovery environments.
By creating and deploying the following service, using the Cloudflared image:

<p align="center">
<img src="/img/cloudflare/10.png" alt="Cloudflare" />
</p>

<Alert type="info">

Create a `TUNNEL_TOKEN` secret environment variable (Scope: Environment) to pass the Cloudflare token.
<p align="center">
<img src="/img/cloudflare/13.png" alt="Cloudflare" />
</p>
</Alert>

Once your tunnel is created and connected, you have to set the public hostname and the related service settings.

<p align="center">
<img src="/img/cloudflare/11.png" alt="Cloudflare" />
</p>

To get the service name of your application deployed by Qovery, you can get it in your application variables:

<p align="center">
<img src="/img/cloudflare/12.png" alt="Cloudflare" />
</p>

<Alert type="info">

This setup works for static environments but not for dynamic ones since the service name is dynamic. We should probably suggest to use the [cloudflared helm chart](https://github.com/cloudflare/helm-charts) once we release helm deployment

</Alert>

## Conclusion

After following the steps from above, our application should be accessible using the custom domain we selected:
Expand All @@ -78,4 +136,4 @@ After following the steps from above, our application should be accessible using
In the guide we went through all the necessary steps to configure Cloudflare and Qovery to make use of your custom domain.



[docs.using-qovery.configuration.application#ports]: /docs/using-qovery/configuration/application/#ports
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$schema: "/.meta/.schemas/guides.json"
title: Setting up Cloudflare and Custom Domain on Qovery
description: Using Cloudflare for applications deployed on Qovery
author_github: https://github.com/pjeziorowski
author_github: https://github.com/jul-dan
tags: ["type: tutorial", "technology: qovery"]
hide_pagination: true
---
Expand Down Expand Up @@ -58,6 +58,64 @@ The last step to configure the domain Cloudflare side properly, is to use the `F

This is the requirement to make Custom Domain work properly using Cloudflare as the domain provider on Qovery.

### Restrict application access

If you want to limit the application access via Cloudflare only, you have two ways to perform it:

#### IP whitelisting

In Qovery it is possible to whitelist a range of IPs that can reach your application:
* In the advanced settings section of your application:
<p align="center">
<img src="/img/cloudflare/8.png" alt="Cloudflare" />
</p>
* Get the [Cloudflare ips](https://www.cloudflare.com/ips-v4/)
* Edit the `network.ingress.whitelist_source_range` setting and add the Cloudflare IPs separated with a comma:
<p align="center">
<img src="/img/cloudflare/9.png" alt="Cloudflare" />
</p>
* Save and redeploy your application

#### Cloudflared

Cloudflared establishes outbound connections (tunnels) between your resources and Cloudflare’s global network.

You have different ways to install Cloudflared on your cluster, you can find the installation instructions within this [documentation](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/)
Since Cloudflared establishes a tunnel for you and the domain and TLS management is done by Cloudflare, you don't need to expose publicly the application during the setup (See [port setup][docs.using-qovery.configuration.application#ports]

You can decide to install Cloudflared by yourself or via Qovery. Within the section below, you will find documentation on how to install Cloudflared as a container in one of the Qovery environments.
By creating and deploying the following service, using the Cloudflared image:

<p align="center">
<img src="/img/cloudflare/10.png" alt="Cloudflare" />
</p>

<Alert type="info">

Create a `TUNNEL_TOKEN` secret environment variable (Scope: Environment) to pass the Cloudflare token.
<p align="center">
<img src="/img/cloudflare/13.png" alt="Cloudflare" />
</p>
</Alert>

Once your tunnel is created and connected, you have to set the public hostname and the related service settings.

<p align="center">
<img src="/img/cloudflare/11.png" alt="Cloudflare" />
</p>

To get the service name of your application deployed by Qovery, you can get it in your application variables:

<p align="center">
<img src="/img/cloudflare/12.png" alt="Cloudflare" />
</p>

<Alert type="info">

This setup works for static environments but not for dynamic ones since the service name is dynamic. We should probably suggest to use the [cloudflared helm chart](https://github.com/cloudflare/helm-charts) once we release helm deployment

</Alert>

## Conclusion

After following the steps from above, our application should be accessible using the custom domain we selected:
Expand Down
10 changes: 9 additions & 1 deletion website/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ module.exports = {
"title": "Migrate your application from Heroku to AWS"
},
{
"author_github": "https://github.com/pjeziorowski",
"author_github": "https://github.com/jul-dan",
"description": null,
"id": "/tutorial/setting-up-cloudflare-and-custom-domain-on-qovery",
"last_modified_on": null,
Expand Down Expand Up @@ -944,6 +944,14 @@ module.exports = {
"id": "benjaminch",
"keybase": "https://keybase.io/benjaminch",
"name": "Benjamin Chastanier"
},
{
"avatar": "https://github.com/jul-dan.png",
"bio": "Julien is a Technical Product Manager at <a href=\"https://www.qovery.com\">Qovery</a>.",
"github": "https://github.com/jul-dan",
"id": "jul-dan",
"keybase": "https://keybase.io/jul-dan",
"name": "Julien Dan"
}
],
"technologies": [
Expand Down
Binary file added website/static/img/cloudflare/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/cloudflare/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/cloudflare/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/cloudflare/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/static/img/cloudflare/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/static/img/cloudflare/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/static/img/cloudflare/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/cloudflare/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/cloudflare/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45a2b90

Please sign in to comment.