From bf6c552fe389210c4cc82a0226ebb2df486bc059 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Tue, 27 Sep 2022 14:50:55 +0200 Subject: [PATCH] Azure draft --- .../{google-cloud.md => azure.md} | 55 ++++++++----------- mkdocs.yml | 2 +- 2 files changed, 23 insertions(+), 34 deletions(-) rename docs/hosting/server-setups/{google-cloud.md => azure.md} (53%) diff --git a/docs/hosting/server-setups/google-cloud.md b/docs/hosting/server-setups/azure.md similarity index 53% rename from docs/hosting/server-setups/google-cloud.md rename to docs/hosting/server-setups/azure.md index 04be4b351..25a29bb3b 100644 --- a/docs/hosting/server-setups/google-cloud.md +++ b/docs/hosting/server-setups/azure.md @@ -1,70 +1,59 @@ -# Hosting n8n on Google Cloud +# Hosting n8n on Azure -This hosting guide shows you how to self-host n8n on Google Cloud (GCP). It uses n8n with Postgres as a database backend using Kubernetes to manage the necessary resources and reverse proxy. +This hosting guide shows you how to self-host n8n on Azure. It uses n8n with Postgres as a database backend using Kubernetes to manage the necessary resources and reverse proxy. ## Prerequisites -- [The gcloud command line tool](https://cloud.google.com/sdk/gcloud/){:target="_blank" .external-link} +- [The Azure command line tool](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli){:target="_blank" .external-link} ## Hosting options -Google Cloud offers several ways suitable for hosting n8n, including Cloud Run (optimized for running containers), Compute Engine (VMs), and Kubernetes Engine (containers running with Kubernetes). +Azure offers several ways suitable for hosting n8n, including Azure Container Instances (optimized for running containers), Linux Virtual Machines, and Azure Kubernetes Service (containers running with Kubernetes). -This guide uses the Google Kubernetes Engine (GKE) as the hosting option. Using Kubernetes requires some additional complexity and configuration, but is the best method for scaling n8n as demand changes. +This guide uses the Azure Kubernetes Service (AKS) as the hosting option. Using Kubernetes requires some additional complexity and configuration, but is the best method for scaling n8n as demand changes. -Most of the steps in this guide use the Google Cloud UI, but you can also use the [gcloud command line tool](https://cloud.google.com/sdk/gcloud/){:target="_blank" .external-link} instead to undertake all the steps. +The steps in this guide use a mix of the Azure UI and command line tool, but you can use either to accomplish most tasks. -## Create project +## Open the Azure Kubernetes Service -GCP encourages you to create projects to logically organize resources and configuration. Create a new project for your n8n deployment by clicking the project dropdown menu and then the _NEW PROJECT_ button. Then select the newly created project and as you follow other steps in this guide, make sure you have the correct project selected. - -## Enable the Kubernetes Engine API - -GKE isn't enabled by default, search for "Kubernetes" in the top search bar and select "Kubernetes Engine" from the results. - -Enable the Kubernetes Engine API by clicking the **Enable** button. +From [the Azure portal](https://portal.azure.com/) select **Kubernetes services**. ## Create a cluster -From the GKE service page, click the **Clusters** menu item and then the **CREATE** button. Make sure you select the "Standard" cluster option, n8n doesn't work with an "Autopilot" cluster. You can leave the cluster configuration on defaults unless there's anything specifically you need to change, such as location. +From the Kubernetes services page, click the **Create** button and the **Create a Kubernetes cluster** menu item. + +You can select any of the configuration options that suit your need and then click the **Create** button when done. ## Set Kubectl context -The remainder of the steps in this guide require you to set the GCP instance as the Kubectl context. You can find the connection details for a cluster instance by opening its details page and then the **CONNECT** button. The resulting code snippet shows a connection string for the gcloud CLI tool. Paste and run that code snippet into a terminal to change your local Kubernetes settings to use the new gcloud cluster. +The remainder of the steps in this guide require you to set the Azure instance as the Kubectl context. You can find the connection details for a cluster instance by opening its details page and then the **Connect** button. The resulting code snippets shows the steps to paste and run into a terminal to change your local Kubernetes settings to use the new cluster. ## Clone configuration repository -Kubernetes and n8n require a series of configuration files. You can clone these from [this repository](https://github.com/n8n-io/n8n-kubernetes-hosting/tree/gcp){:target=_blank .external-link} locally. The following steps will tell you which file configures what and what you need to change. +Kubernetes and n8n require a series of configuration files. You can clone these from [this repository](https://github.com/n8n-io/n8n-kubernetes-hosting/tree/azure){:target=_blank .external-link} locally. The following steps will tell you which file configures what and what you need to change. Clone the repository with the following command: ```shell -git clone https://github.com/n8n-io/n8n-kubernetes-hosting/tree/gcp +git clone https://github.com/n8n-io/n8n-kubernetes-hosting/tree/azure ``` And change directory to the root of the repository you cloned: ```shell -cd gcp +cd azure ``` ## Configure Postgres For larger scale n8n deployments, Postgres provides a more robust database backend than SQLite. -### Create a volume for persistent storage +### Configure volume for persistent storage -To maintain data between pod restarts, the Postgres deployment needs a persistent volume. Running Postgres on GCP requires a specific Kubernetes Storage Class, [you can read this guide for specifics](https://cloud.google.com/architecture/deploying-highly-available-postgresql-with-gke){:target="_blank" .external-link}, but the `storage.yaml` manifest creates it for you. You may want to change the regions to create the storage in under the `allowedTopologies` > `matchedLabelExpressions` > `values` key. By default, they're set to "us-central". +To maintain data between pod restarts, the Postgres deployment needs a persistent volume. The default storage class is suitable for this purpose and is defined in the `postgres-claim0-persistentvolumeclaim.yaml` manifest. -```yaml -… -allowedTopologies: - - matchLabelExpressions: - - key: failure-domain.beta.kubernetes.io/zone - values: - - us-central1-b - - us-central1-c -``` +!!! note "Specialized Storage Classes" + If you have specialised or higher requirements for Storage Classes, [read more on the options Azure offers in the documentation](https://learn.microsoft.com/en-us/azure/aks/concepts-storage#storage-classes){:target="_blank" .external-link}. ### Environment variables @@ -130,11 +119,11 @@ kubectl apply -f . ## Setup DNS -n8n typically operates on a subdomain. Create a DNS record with your provider for the subdomain and point it to the IP address of the n8n service. Find the IP address of the n8n service from the **Services & Ingress** menu item of the cluster you want to use under the **Endpoints** column. +n8n typically operates on a subdomain. Create a DNS record with your provider for the subdomain and point it to the IP address of the n8n service. Find the IP address of the n8n service from the **Services & ingresses** menu item of the cluster you want to use under the **External IP** column. You need to add the n8n port, "5678" to the URL. -!!! note "GKE and IP addresses" +!!! note "Static IP addresses with AKS" - [Read this GKE tutorial](https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip#configuring_your_domain_name_records){:target="_blank" .external-link} for more details on how reserved IP addresses work with GKE and Kubernetes resources. + [Read this tutorial](https://learn.microsoft.com/en-us/azure/aks/static-ip){:target="_blank" .external-link} for more details on how to use a static IP address with AKS. ## Delete resources diff --git a/mkdocs.yml b/mkdocs.yml index 681e4a84f..35982fbd3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -185,7 +185,7 @@ nav: - Docker Compose: hosting/server-setups/docker-compose.md - Caddy: hosting/server-setups/caddy.md - Digital Ocean: hosting/server-setups/digital-ocean.md - - Google Cloud: hosting/server-setups/google-cloud.md + - Azure: hosting/server-setups/azure.md - Databases: - Overview: hosting/databases/index.md - Supported databases and settings: hosting/databases/supported-databases-settings.md