Infrastructure¶
For organization administrators
This page is for the people who register and run your organization's clouds, usually organization administrators. Project members only pick a service config when they create a Kubernetes cluster or PostgreSQL instance; they don't need anything else here.
An infrastructure is one of your organization's cloud platforms, registered with edgeContinuum so the platform can deploy resources and managed services on it. Once it is registered, you curate a catalog of the compute sizes and images teams may use, and you create service configs that decide which managed services (Kubernetes clusters, PostgreSQL databases) teams can deploy there. You keep full control of the underlying cloud while the platform manages what runs on it.
If your platform operator provides the infrastructure, the Infrastructure pages are read-only for you: you can browse regions, zones and infrastructures, and you pick a service config when you deploy a managed service.
How it fits together¶
graph TD
R[Region] --> Z[Zone]
Z --> A[Infrastructure]
A --> B[Catalog<br/>flavors and images]
A --> C[Service config]
C --> D["Kubernetes clusters setup<br/>(external network)"]
C --> E["PostgreSQL databases setup<br/>(how they run + tiers)"]
| Concept | What it is |
|---|---|
| Region and Zone | Groupings you create to describe where your infrastructure sits, for example a region per geography and a zone per data center. |
| Infrastructure | A registered cloud (OpenStack today) where resources and managed services run. |
| Catalog | The flavors (compute sizes) and images from your cloud that resources on this infrastructure may use. |
| Service config | A named grouping on an infrastructure, such as production or team-alpha. Teams pick one when they deploy a managed service. |
| Setup | What a service config offers: Kubernetes clusters, PostgreSQL databases, or both (at most one of each). You configure each setup once, then offer it to users or stop offering it. |
Get started¶
- Create a region and a zone. See Regions and zones.
- Register your infrastructure in the zone with the OpenStack Setup Guide.
- Curate the catalog: import the flavors and images teams may use and enable them. See Catalog.
- Create a service config on the infrastructure. See Service configs.
- Set up Kubernetes clusters on it by choosing an external network. Users can create clusters straight away.
- Set up PostgreSQL databases (optional): choose how they run, add a tier, then offer them to users.
Teams then create Kubernetes clusters and PostgreSQL instances by choosing a project, location and infrastructure, then a service config that offers that service.
Regions and zones¶
Open INFRASTRUCTURE > Overview. Regions and zones are shown as a tree under Locations. Work top down: create a region (New region), then a zone in it (New zone), then select the zone and click Create Infrastructure. A zone's page lists its infrastructures with their status and health.
Regions and zones can be renamed. Deleting works bottom up, and you confirm by typing the name: delete a zone's infrastructures before the zone, and a region's zones before the region.
Manage an infrastructure¶
Select an infrastructure to open its page. The Overview tab holds its settings, catalog, service configs and Action History (where you can cancel a running action). The Resources tab lists everything created on it, grouped by type.
From Available Operations you can:
- Edit its name and description.
- Edit Network & Load Balancing: the load balancer method and provider, and the DNS name servers given to new networks.
- Edit Storage: the offered volume types and the default one. See Storage (volume types).
- Update Credentials: rotate the credentials the platform uses. See Rotate credentials.
These changes work while the infrastructure is Active or Degraded.
Storage (volume types)¶
An infrastructure chooses which of the cloud's block storage (Cinder) volume types it offers, and which one is the default. You choose them when you register the infrastructure and change them later with Edit Storage. If the cloud offers no block storage, there is nothing to choose.
- Each selected volume type becomes a storage class only on Kubernetes clusters with Storage (CSI) enabled, and the default volume type becomes their default class. With none selected, those clusters have no default class; see Storage (CSI). The cluster behind a Fully managed PostgreSQL setup gets a default class either way.
- Running clusters pick up a change on their next control plane change or Sync. Node pool operations don't apply it. Run Sync on a cluster to apply the change right away.
- Adding a volume type is always safe. Removing one deletes its storage class from each cluster when the change reaches it: volumes already bound keep working, but new volumes, volume expansion and replica rebuilds on that class fail.
- A change that would remove a storage class used by a Fully managed PostgreSQL tier or backup store is refused. Remove the tier first, or keep the volume type.
Delete an infrastructure¶
An infrastructure can be deleted only when nothing runs on it. The delete dialog lists what is in the way and stays disabled until the list is empty. Work in this order:
- Delete the PostgreSQL instances on it.
- Delete any Fully managed PostgreSQL setup: the Kubernetes cluster behind it blocks the delete, and deleting the setup removes that cluster. If you want the operator uninstalled from your own cluster, delete an On your cluster setup too.
- Delete the Kubernetes clusters and every other resource on its Resources tab, and any VM backups (snapshots) taken on it. Detach imported resources you want to keep in your cloud (see Imported Resources).
- Delete the infrastructure, typing its name to confirm.
Other service configs and their setups don't block the delete; they are removed with the infrastructure. Deleting an infrastructure removes the platform's integration and stored credentials. Nothing else is deleted in your cloud.
Catalog¶
The catalog is the set of flavors and images from your cloud that resources on this infrastructure may use. Curating it is how you govern what teams can pick. It appears on the Overview tab as the Flavor Catalog and Image Catalog.
- Import a flavor or image from your cloud with Import flavor or Import image, optionally with your own name and description. Imports work while the infrastructure is active or degraded.
- Enable or disable an entry. Only enabled entries can be picked for new resources.
- Edit an entry's name and description. Its specs and cloud reference are fixed: a different cloud flavor or image is a different entry.
- View dependencies to see what uses an entry.
- Delete an entry once nothing uses it.
VM backups taken in your projects also appear in the Image Catalog.
Disable vs delete
Disabling an entry stops it from being picked for new resources; resources already using it keep working. Deleting removes it for good and is refused while anything uses it. To retire a size or image that is still in use, disable it.
Service configs¶
A service config is a named grouping on an infrastructure that decides what teams can deploy there. It holds no settings of its own; what it offers comes from its setups. Use separate service configs to separate concerns, for example production and development, each with its own network and PostgreSQL tiers.
Create one with New service config on the infrastructure's page (a name unique on the infrastructure, and an optional description). Service configs count toward your organization's quotas. Each one shows a Kubernetes clusters row and a PostgreSQL databases row, with Set up to start a setup or Open/Manage to go to it.
Setup statuses¶
| Status | Meaning |
|---|---|
| Not set up | Users can't create these here. |
| Being set up | The platform is preparing the setup, or upgrading its PostgreSQL operator. It moves on by itself. |
| Needs a tier | PostgreSQL is set up but has no tier. Add one. |
| Not offered yet | Set up, but not offered: users can't create these yet. Offer it to users. |
| Ready (Kubernetes) / Offered (PostgreSQL) | Offered to users: they can create these here. |
| Install or upgrade failed | Installing or upgrading the PostgreSQL operator failed. Users can't create databases. Run Upgrade if it is offered, or delete the setup and set it up again. |
| Failed | Setting up or deleting failed, for example because the cluster for Fully managed couldn't be created. Open the setup's Action history to see why, then delete it. |
| Being deleted | The setup is being deleted. |
Kubernetes clusters¶
Set up Kubernetes clusters asks for one thing: the External network every cluster on this service config attaches to, including the cluster behind a Fully managed PostgreSQL setup. It is offered to users as soon as it is created.
The network can't be changed later; to use another one, delete the setup and set it up again. If the cloud has no external network, your cloud administrator must create one first.
PostgreSQL databases¶
PostgreSQL databases run on the CloudNativePG operator. Set up PostgreSQL databases asks how they run. This can't be changed later: to change it, delete the setup and set it up again.
| How they run | What it means | What it needs |
|---|---|---|
| Fully managed | The platform creates a Kubernetes cluster for your databases and runs everything on it. | A Kubernetes clusters setup offered on the same service config; a load balancer on the infrastructure; block storage in the cloud; and an enabled catalog flavor with at least 2 vCPU and 4 GB RAM (the platform's default minimum). Without such a flavor the setup fails. |
| On your cluster | The platform installs the operator on a Kubernetes cluster you run, and keeps it updated. | A kubeconfig with cluster-admin rights, for a cluster that has no CloudNativePG installed, including resource definitions (CRDs) left by an earlier setup. |
| Your cluster and operator | The operator is already on your cluster. The platform creates databases with it but doesn't install or update it. | A kubeconfig that can create namespaces, secrets and PostgreSQL clusters (plus a few objects for metrics), read pods, volumes and services, and list storage classes. The setup dialog lists the exact permissions. Major version upgrades, with or without backups, also need create on pods/exec, list on jobs and get on pods/log in instance namespaces, which the dialog doesn't list. Backups also need a backup store you provide. |
Cluster access (kubeconfig)¶
For the two options on your own cluster, the platform must be able to reach the cluster's API, and the kubeconfig must carry its credentials inline: a token or a client certificate. Kubeconfigs that rely on an exec plugin, an auth provider or files on disk don't work.
- On your cluster checks the kubeconfig when you set it up and refuses one that doesn't work. Your cluster and operator doesn't: a bad kubeconfig shows up later, when you add a tier or users create databases.
- The kubeconfig is stored, never shown again, and can't be replaced. To use a new one, delete the databases and the setup, and set it up again. Use credentials that won't expire.
- Deleting an On your cluster setup needs the cluster to be reachable with the stored kubeconfig; otherwise the delete is refused.
Add tiers and offer them to users¶
A new PostgreSQL setup starts not offered. Its page shows a checklist: wait for it to be set up (with Fully managed this includes creating the cluster, which takes a few minutes), add at least one tier, then Offer to users.
A tier is a size users pick when they create a PostgreSQL instance: a Name, CPU (at least 100m) and Memory (at least 256Mi), and a Storage class read from the cluster the databases run on. CPU and memory apply to each replica: an instance has one replica, or three with high availability. Users choose the disk size per instance.
- Classes with the
Retainreclaim policy can't be used, because a deleted instance would leave its volume behind. - If a class can't grow volumes (shown as Fixed size), instances on that tier can't increase their storage.
- Instances can only move between tiers that use the same storage class.
- With Fully managed, the class must come from the infrastructure's volume types (or, with none selected, be the cluster's default class).
Tiers can't be edited: add a new one and remove the old. Removing a tier is refused while instances use it, and when it is the only tier of an offered setup. View dependencies shows what uses a tier.
The cluster behind Fully managed¶
A Fully managed setup's page links to the Kubernetes cluster it runs on, built with the smallest enabled catalog flavor that meets the minimum. You can operate that cluster from its page (for example scale or upgrade it), but you delete it by deleting the setup. It doesn't appear in the Kubernetes list or count toward quotas.
Upgrade the PostgreSQL operator¶
With Fully managed and On your cluster, the PostgreSQL operator card shows the deployed and desired versions. When an upgrade is available, click Upgrade; the setup shows Being set up while it runs. With Your cluster and operator you keep the operator up to date yourself.
Backup store¶
PostgreSQL instances back up to a backup store on the cluster where they run: SeaweedFS, an S3-compatible object store. Each instance with backups gets its own bucket, S3 user and key in it, and a limit of three times its storage by default, which your platform operator can change for one instance. Users manage their backups and restores from their instances; see PostgreSQL Backups and Restore.
- With Fully managed and On your cluster, the platform installs the store when it sets up PostgreSQL, together with what backups need: the Barman Cloud plugin for CloudNativePG, the SeaweedFS operator and, when the cluster has none, cert-manager. An existing cert-manager is reused and left as it is. The setup is refused if the cluster already has a
Seaweedlabellededgecontinuum.com/backup-store: "true", or cert-manager's resource definitions without cert-manager running. - With Your cluster and operator, you provide all of this yourself; see Backup store on Your cluster and operator.
On a cluster that can't take backups, new instances are created with backups off, and users see why backups are unavailable.
Size and storage class. With Fully managed and On your cluster, you choose them when you set up PostgreSQL:
- Size: 50 GiB unless you choose another (your platform operator can change this default). The store also uses two 1 GiB disks for its metadata.
- Storage class: optional. Without one, the store uses the cluster's default class; with On your cluster, a cluster without a default class needs one chosen. With Fully managed, the class must come from the infrastructure's volume types. If no class resolves when the platform installs the store, setting up PostgreSQL fails instead of finishing without a store.
- The class can't be changed later. A class that can't grow volumes is allowed, but the store's size is then fixed.
Plan the size. The store splits its space into volumes of 512 MB (by default). Every instance with backups takes at least one, and more as its backups grow, up to its limit. Size the store for the number of instances with backups plus the backups themselves. When the store runs out of space, archiving fails on its instances (their backup health shows failing) until you grow it. The instances' limits reserve nothing: together they can exceed the store's size, and a larger limit your platform operator sets for an instance doesn't grow the store. Longer retentions keep more backups, so they need more space.
Grow the store. Its size can only grow, and only when its storage class can grow volumes. The setup shows Being set up while the store grows; the new size shows once the grow has succeeded. A grow is refused while an operator upgrade is pending: upgrade first. Growing needs service_platform_backup_store_update (see Service configs permissions).
Setups created before backups get their store on the cluster's default storage class: an operator upgrade installs it at the default size, and a first grow at the size you request, at least the default. If the cluster has no default class, an upgrade installs no store and backups stay unavailable, and a first grow is refused, even when an earlier upgrade already installed the store. Give the cluster a default class, then grow the store, or run the operator upgrade again (the console offers it while the setup records no backup store):
- On your cluster: mark one of its storage classes as the default.
- Fully managed: set the infrastructure's default volume type, then Sync the cluster. A class marked as default by hand doesn't survive the cluster's next change.
The store's location is fixed once set. Its cluster and storage class don't change for the setup's lifetime, and each instance keeps its backups in the store it started with. There is no way to move backups to another store.
Upgrading the backup plugin restarts instances. A new version of the Barman Cloud plugin restarts every PostgreSQL instance with backups on, to pick it up. Each primary restarts in place, so each instance is briefly unavailable, even with high availability. With Fully managed and On your cluster, this happens when an operator upgrade brings a new plugin version; with Your cluster and operator, when you upgrade the plugin.
Treat the cluster as a trusted zone. Inside the cluster, the store's internal ports are reachable without authentication, and the store holds every instance's S3 key; only its S3 gateway checks credentials. Run only workloads you trust on the cluster where your PostgreSQL instances and their backup store run.
Backup store on Your cluster and operator¶
With Your cluster and operator, backups work once your cluster has:
- cert-manager, which the Barman Cloud plugin needs.
- The Barman Cloud plugin for CloudNativePG, in the operator's namespace so the operator finds it. Its Service must carry the label
cnpg.io/pluginName: barman-cloud.cloudnative-pg.io, which the plugin's own manifests set. - The SeaweedFS operator, and exactly one
Seaweedresource labellededgecontinuum.com/backup-store: "true", Ready, with:- the standalone S3 gateway (
spec.s3). Instances reach it athttp://<seaweed name>-s3.<namespace>.svc:8333, or the port inspec.s3.port; - persistent disks for the master and the filer, so the store keeps its S3 users across restarts.
- the standalone S3 gateway (
- At least one S3 user (an
S3Identity) on the store before any instance uses it. SeaweedFS accepts anonymous requests while it has no S3 user at all; a user without permissions is enough to close it. - A
ResourceReferenceGrantthat lets theBucket,S3IdentityandS3Credentialsresources in instance namespaces use the store. The platform labels every instance namespace withedgecontinuum.com/resource-id.
The platform then creates each instance's bucket, S3 user and key in the store. If no labelled Seaweed exists, more than one does, or it isn't ready or has no S3 gateway, backups are unavailable and instances show why. Size the store as described in Plan the size, on a storage class that can grow volumes.
The platform's own setups run CloudNativePG 1.30.1, the Barman Cloud plugin v0.16.0, the SeaweedFS operator 1.0.44 and SeaweedFS 4.53. Run CloudNativePG 1.30 or later: on earlier versions, a restore of an instance that has failed over can come back incomplete. Run SeaweedFS 4.48 or later: from 4.31 its S3 gateway enforces the instances' backup storage limits by itself, and before 4.48 the cleanup of unfinished uploads in the example below can corrupt a completed backup.
A backup store like the one the platform installs
The names and the namespace are up to you. copy_1 = 1 and the 512 MB volume size keep each new bucket to a single small volume, and the AdminScript removes uploads that interrupted backups left behind.
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: store
namespace: backup-store
labels:
edgecontinuum.com/backup-store: "true"
spec:
image: chrislusf/seaweedfs:4.53
volumeServerDiskCount: 1
master:
replicas: 1
volumeSizeLimitMB: 512
volumePreallocate: false
defaultReplication: "000"
config: |
[master.volume_growth]
copy_1 = 1
persistence:
enabled: true
resources:
requests:
storage: 1Gi
volume:
replicas: 1
maxVolumeCounts: 0
requests:
storage: 50Gi
filer:
replicas: 1
config: |
[leveldb2]
enabled = true
dir = "/data/filerldb2"
persistence:
enabled: true
resources:
requests:
storage: 1Gi
s3:
replicas: 1
---
apiVersion: seaweed.seaweedfs.com/v1
kind: S3Identity
metadata:
name: auth-gate
namespace: backup-store
spec:
seaweedRef:
name: store
---
apiVersion: seaweed.seaweedfs.com/v1
kind: ResourceReferenceGrant
metadata:
name: instance-namespaces
namespace: backup-store
spec:
from:
- group: seaweed.seaweedfs.com
kind: Bucket
namespaceSelector:
matchExpressions:
- key: edgecontinuum.com/resource-id
operator: Exists
- group: seaweed.seaweedfs.com
kind: S3Identity
namespaceSelector:
matchExpressions:
- key: edgecontinuum.com/resource-id
operator: Exists
- group: seaweed.seaweedfs.com
kind: S3Credentials
namespaceSelector:
matchExpressions:
- key: edgecontinuum.com/resource-id
operator: Exists
to:
- group: seaweed.seaweedfs.com
kind: Seaweed
name: store
---
apiVersion: seaweed.seaweedfs.com/v1
kind: AdminScript
metadata:
name: multipart-cleanup
namespace: backup-store
spec:
clusterRef:
name: store
schedule: "17 * * * *"
concurrencyPolicy: Forbid
script: |
s3.clean.uploads -timeAgo=24h
Kubeconfig rights for backups. On top of what the setup dialog lists, the stored kubeconfig needs these rights. Instance namespaces are created as needed, so grant them cluster-wide (a ClusterRole):
| API group | Resources | Verbs |
|---|---|---|
postgresql.cnpg.io |
backups |
get, list, create, delete |
postgresql.cnpg.io |
scheduledbackups |
get, create, update, patch, delete |
barmancloud.cnpg.io |
objectstores |
get, list, create, update, patch, delete |
seaweed.seaweedfs.com |
buckets, s3identities, s3credentials |
get, list, create, patch |
seaweed.seaweedfs.com |
seaweeds |
list |
batch |
jobs |
get, list, create, delete |
| core | pods |
get, list |
| core | pods/log |
get |
| core | pods/exec |
create (major upgrades and restores) |
| core | services |
list |
| core | configmaps |
get |
| core | namespaces |
patch |
Major version upgrades need create on pods/exec, list on jobs and get on pods/log with or without backups; see PostgreSQL databases.
Offer, stop offering or delete a setup¶
Offer to users and Stop offering control new use only:
- Stopping Kubernetes clusters stops new clusters, and new Fully managed PostgreSQL setups, on this service config. Existing clusters keep running.
- Stopping PostgreSQL databases stops new instances. Existing instances stay fully manageable.
Delete setup asks you to type the service config's name:
| Setup | What deleting does | Refused while |
|---|---|---|
| Kubernetes clusters | Removes the network setting. Nothing is torn down. | Kubernetes clusters, or a Fully managed PostgreSQL setup, use it. |
| Fully managed | Uninstalls the operator and deletes the cluster created for it, with its backup store. | PostgreSQL instances exist, or any CloudNativePG database still runs on its cluster. |
| On your cluster | Uninstalls the operator, the backup store and what backups need from your cluster (cert-manager only if the platform installed it). | PostgreSQL instances exist, any CloudNativePG database still runs on the cluster (including ones created outside the platform), backup buckets, S3 users or keys still use the store, or the cluster can't be reached. |
| Your cluster and operator | Removes the setup only; the operator is left as it is. | PostgreSQL instances exist. |
A service config can be deleted only when it has no setups. So to delete a service config, work in this order:
- PostgreSQL instances.
- The PostgreSQL setup (with Fully managed, this deletes its cluster).
- The Kubernetes clusters on the service config.
- The Kubernetes clusters setup.
- The service config itself, typing its name to confirm.
Reusing a cluster after On your cluster
Deleting an On your cluster setup leaves the CloudNativePG resource definitions (CRDs) on your cluster. Remove them by hand before using that cluster for another On your cluster setup. Removing them deletes every CloudNativePG object on the cluster, so make sure none is still needed.
The same goes for the backup store's resource definitions: SeaweedFS (seaweed.seaweedfs.com), the Barman Cloud plugin (barmancloud.cnpg.io) and, if the platform installed cert-manager, cert-manager (cert-manager.io, acme.cert-manager.io). Another On your cluster setup on that cluster is refused until they are gone. Once nothing uses them:
kubectl get crd -o name | grep -E '\.(seaweed\.seaweedfs\.com|barmancloud\.cnpg\.io)$' | xargs kubectl delete
# only if the platform installed cert-manager and nothing else uses it:
kubectl get crd -o name | grep -E '\.cert-manager\.io$' | xargs kubectl delete
Permissions¶
Managing regions, zones, infrastructures, catalogs and service configs needs organization-level permissions; the OrganizationAdmin role has all of them. See Infrastructure Permissions for each action.
Best practices¶
- Start with one infrastructure to learn how it works before managing several.
- Use least-privilege credentials: register the infrastructure with credentials limited to the project the platform should use.
- Curate the catalog: enable only the flavors and images teams should use, and disable entries to retire them.
- Select volume types before teams create clusters that need persistent storage.
- Set up Kubernetes clusters before Fully managed PostgreSQL, which builds on them.
- Plan tiers before offering PostgreSQL: tiers can't be edited, so pick names and storage classes you can keep, and prefer classes that can grow volumes.