Create and manage instances
Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen
Prerequisites
Section titled “Prerequisites”- You have a STACKIT customer account: Create a customer account
- You have a STACKIT user account: Create a user account
- You have a STACKIT project: Create a project
Instance properties
Section titled “Instance properties”Independent of the method you choose to create and manage an instance, there are common properties of a PostgreSQL Flex instance.
Instance type
Section titled “Instance type”With the instance type, you can determine horizontal scaling and high availability. Horizontal scaling increases availability and read performance. The single instance type doesn’t have horizontal scaling. A replica set offers horizontal scaling and thus achieves high availability.
| Use case | Instance type |
|---|---|
| Development | Single (1 node) |
| Production (Normal) | Replica set (3 nodes) |
Flavor
Section titled “Flavor”Select the flavor that fits your workload. It’s safe to start with a smaller flavor and change to a bigger one afterwards. Depending on the instance type you have chosen, some flavors are not available. You can choose flavors from Tiny to X-Large, whereas every size has its CPU- or memory-optimized version. For a detailed reference of available flavors, read Flavors and performance classes of PostgreSQL Flex.
Performance class / storage class
Section titled “Performance class / storage class”With the performance class, you determine the properties of the underlying storage. This setting is completely independent of the flavor. The latter only affects CPU and RAM. For a detailed reference of available performance classes, read Flavors and performance classes of PostgreSQL Flex.
Disk size
Section titled “Disk size”With the disk size, you determine the initial size of the underlying storage. The default setting is 5GB. You can safely apply this size and enlarge the disk afterwards.
PostgreSQL version
Section titled “PostgreSQL version”With the PostgreSQL version select, you set which PostgreSQL version comes to play. STACKIT updates the PostgreSQL major version according to the releases of PostgreSQL, with a reasonable delay for implementing it. Read the Release notes for deprecation notices and announcements of new versions regularly. For safety reasons, STACKIT will deprecate PostgreSQL versions once they reach their EOL status. Furthermore, STACKIT applies minor updates for security reasons.
Daily backup schedule (UTC)
Section titled “Daily backup schedule (UTC)”The system creates a daily snapshot of the database automatically. With this setting, you can control when this snapshot will be created. You can change it anytime.
With the ACL entries, you control which source IPs are allowed to connect to your instance. Note,
that this is an additional security layer and does not replace the need for proper authentication
and security best practices. There are two predefined entries: 193.148.160.0/19 and
45.129.40.0/21. They ensure that you can access your instance from STACKIT cloud services. If you
want to access your instance from the public net, you need to add the client’s IPv4 address or
subnet. The entries follow the CIDR notation. If you want to allow a single IP address (e.g. single
host), then set 32as the subnet parameter. E.g. to allow a host with the source IPv4 address of
93.229.84.137, add 93.229.84.137/32 as ACL entry. At the moment, you can’t add IPv6 addresses.
Create an instance
Section titled “Create an instance”To create an instance, you first need to log into the STACKIT Portal.
Choose the flavor and storage class
Section titled “Choose the flavor and storage class”First, determine which flavor and storage class you need. The available storage classes depend on the chosen flavor. To get a list of available flavors, execute stackit PostgreSQLflex options --flavors. Then you can get a list of available storage classes with stackit PostgreSQLflex options --storages --flavor-id <flavor-id>. To get the available storage classes for the flavor 4.32, execute:
stackit PostgreSQLflex options --storages --flavor-id 4.32Choose the properties for your new instance
Section titled “Choose the properties for your new instance”| Flag | Options | Default | Optional |
|---|---|---|---|
| name | my-PostgreSQL-flex-instance | ||
| type | Single, replica, sharded | Replica | x |
| flavor-id | See Flavors and performance classes of PostgreSQL Flex | ||
| storage-class | See Flavors and performance classes of PostgreSQL Flex | premium-perf2-PostgreSQL | x |
| storage-size | Integer | 10 | x |
| version | 7.0, 8.0 | 8.0 | x |
| acl | IPv4 and net in CIDR notation |
You can also have a look at Flavors and performance classes of PostgreSQL Flex to learn more about the available flavors and performance classes.
Execute the creation command
Section titled “Execute the creation command”To create your instance, execute the following command:
stackit PostgreSQLflex instance create --name <name> --type <type> --flavor-id <flavor> --storage-class <storage-class> --storage-size <storage size> --version <version --acl <acl>After executing the command, confirm with y.
When the instance is created succesfully, the CLI will return the instance ID:
Created instance for project "My-PostgreSQL-Project". Instance ID: 8db6a0f2-2b93-43f3-be54-464ee5a9fbedExamples
Section titled “Examples”Create an instance with minimum flags:
stackit PostgreSQLflex instance create --name my-PostgreSQL-instance --acl 193.148.160.0/19 --flavor-id 4.32Create an instance with multiple entries in the ACL table:
stackit PostgreSQLflex instance create --name my-PostgreSQL-instance --acl 193.148.160.0/19,45.129.40.0/21,93.229.84.137/32 --flavor-id 4.32-
In the sidebar, click on PostgreSQL Flex.
-
In the bar on the top, click on Create PostgreSQL Flex.
See Instance properties for a better understanding of all options.
-
After you configured everything to your needs, create your instance.
For cost control, you can see a price estimation on the right hand site. To finally create the instance, click on Order fee-based. The system will add your newly created instance to the list of your PostgreSQL Flex instances. After a few seconds, your instance will change from Progressing… to Active. Congratulations, your PostgreSQL flex instance is up and running!
View an instance
Section titled “View an instance”To view an instance, execute with the following parameters:
| Argument | Description |
|---|---|
| INSTANCE_ID | Instance ID of the instance you want to query |
stackit PostgreSQLflex instance describe <INSTANCE_ID>Example output:
ID │ 8db6a0f2-2b93-43f3-be54-464ee5a9fbed───────────────────────┼────────────────────────────────────── NAME │ my-PostgreSQL-instance───────────────────────┼────────────────────────────────────── STATUS │ READY───────────────────────┼────────────────────────────────────── STORAGE SIZE (GB) │ 10───────────────────────┼────────────────────────────────────── VERSION │ 8.0───────────────────────┼────────────────────────────────────── ACL │ 93.229.84.137/32,93.229.85.0/24───────────────────────┼────────────────────────────────────── FLAVOR DESCRIPTION │ Medium, Memory optimized───────────────────────┼────────────────────────────────────── TYPE │ Replica───────────────────────┼────────────────────────────────────── REPLICAS │ 3───────────────────────┼────────────────────────────────────── CPU │ 4───────────────────────┼────────────────────────────────────── RAM (GB) │ 32───────────────────────┼────────────────────────────────────── BACKUP SCHEDULE (UTC) │ 0 0/6 * * *- In the sidebar, click on PostgreSQL Flex.
- Click on the instance you’d like to view.
Edit an instance
Section titled “Edit an instance”You can edit the following properties of an instance: acl, backup-schedule, cpu, flavor-id, name, ram, storage-class, storage-size, type and version. To get a reference to these flags, have a look at Create an instance.
To get a deeper understanding on the backup schedule, read Backup, restore, and clone PostgreSQL Flex
| Argument | Description |
|---|---|
| INSTANCE_ID | Instance ID of the instance you want to query |
| Flags | Datatype | Unit |
|---|---|---|
| acl | Array of strings | |
| backup-schedule | String | |
| CPU | Integer | virtual core |
| flavor-id | String | - |
| name | String | - |
| ram | Integer | Gigabyte |
| storage-class | String | - |
| storage-size | Integer | Gigabyte |
| type | String | - |
| version | String | - |
To edit the instance, execute the following command:
stackit PostgreSQLflex instance update <INSTANCE_ID> --<Flag Name> <Flag Value>Example
Section titled “Example”stackit PostgreSQLflex instance update 8db6a0f2-2b93-43f3-be54-464ee5a9fbed --flavor-id 2.16To edit the Performance class, the Disk size, the PostgreSQL version and ACLs:
- In the sidebar, click on PostgreSQL Flex.
- Click on the instance you’d like to edit.
- Next to General information, click on Edit.
- Make the changes according to your needs and click on Save.
- Wait for the database to become Active again.
To change the flavor:
- In the sidebar, click on PostgreSQL Flex.
- Click on the instance you’d like to edit.
- In the sidebar, click on Flavor.
- In the desired flavor pane, click on Change.
- Confirm the price and click on Order fee-based.
- Wait for the database to become Active again.
To change the backup schedule:
- In the sidebar, click on PostgreSQL Flex.
- Click on the instance you’d like to edit.
- In the sidebar, click on Backups.
- In the top right pane, click on Schedule.
- Make the desired changes and click on Save.
Delete an instance
Section titled “Delete an instance”You can delete an instance when it operates in its READY-state. After executing this command, the operation cannot be undone. To delete an instance, execute:
| Argument | Description |
|---|---|
| INSTANCE_ID | Instance ID of the instance you want to query |
stackit PostgreSQLflex instance delete <INSTANCE_ID>You get the following output:
Deleted instance "my-PostgreSQL-instance"You can delete an instance when it operates in its Active state. You cannot undo a deletion.
- In the sidebar, click on PostgreSQL Flex.
- In the pane of the instance you want to delete, click on the three-dots icon.
- Click on Delete.
- Enter the name of the instance and confirm with Delete.