This integration is about using Azure Database for PostgreSQL server to provide a High Available database for Polyaxon.

You can use this integration can used with all Polyaxon deployment types

Pre-requisites

A valid Azure Subscription (click here for a free trial).

One-click deploy ARM Template

All resources mentioned in this guide can be deployed using the one-click button below.

Deploy to Azure Button

(The button opens Azure Portal, you might want to do a Ctrl+Click, to get it on a new tab)

azure-one-click-deployment

Once all entries are filled, you can click the Purchase button.

You can now use this PostgreSQL server with you Polyaxon deployment:

postgresql:
  enabled: false
  postgresUser: <server_admin_login_name>
  postgresPassword: <password>
  postgresDatabase: <database>
  externalPostgresHost: <server_name>

You need to replace the user, password, database, and host based on the information you filled in the form, you can always find this information on the entity overview of Azure dashboard.

CLI instructions

In case you want to use Azure CLI to create the database resource.

CLI Login

az login

Create a new Resource Group

If you don't have a resource group yet, you need to create one:

az group create --name <resource> --location eastus

Provision a PostgreSQL database

You need a resource group to create PostgreSQL server instance:

az postgres server create --resource-group <resource> \
   --name "<server_name>" \
   --location eastus \
   --admin-user "<user>" \
   --admin-password "<admin_password>" \
   --sku-name GP_Gen5_2 \
   --version 10

Allow access to Azure Services

Create a firewall rule allowing acess from Azure internal services:

az postgres server firewall-rule create --resource-group <resource_group> \
   --server-name "<server_name>" \
   --name "allow-azure-internal" \
   --start-ip-address 0.0.0.0 \
   --end-ip-address 0.0.0.0

Update polyaxon deployment

postgresql:
  enabled: false
  postgresUser: <servr_admin_login_name>
  postgresPassword: <password>
  postgresDatabase: <database>
  externalPostgresHost: <server_name>