Use the following yaml sample file to create DSM API resources.
apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: IPPool
metadata:
name: sample-ip-pool
spec:
addresses:
- "10.10.10.10-10.10.10.20"
prefix: 24
gateway: "10.10.10.1"
apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: VMClass
metadata:
name: medium
spec:
requests:
cpu: "4"
memory: "8"
apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: InfrastructurePolicy
metadata:
name: sample-infra-policy
spec:
enabled: true
ipRanges:
- poolName: sample-ip-pool
portGroups:
- datacenter: sample-datacenter
name: sample-port-group
placements:
- cluster: sample-cluster
datacenter: sample-datacenter
folder: some-dc-Folder
portGroups:
- sample-port-group
storagePolicies:
- sample-storage-policy
vmClasses:
- name: medium
- name: large
apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: DatabaseConfig
metadata:
name: test-config
namespace: default
spec:
params:
max_connections: "200"
some_other_thing: "off"
apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: PostgresCluster
metadata:
name: my-pg-cluster
namespace: default
spec:
adminUsername: pgadmin
backupConfig:
backupRetentionDays: 30
schedules:
- name: default-full-backup
schedule: 59 23 * * 6
type: full
- name: default-incremental-backup
schedule: 59 23 1/1 * *
type: incremental
backupLocation:
name: default-backup-storage
databaseName: my-pg-cluster
infrastructurePolicy:
name: sample-infra-policy
maintenanceWindow:
duration: 6h0m0s
startDay: SATURDAY
startTime: "23:59"
replicas: 1
storagePolicyName: dsm-test
storageSpace: 20Gi
version: 14.10+vmware.v2.0.0-rc.7
vmClass:
name: medium
Create a DatabaseConfig resource.
Create or edit a PostgresCluster spec to reference the databaseConfig.
Both the config and the database resource must be in the same namespace.
spec:
databaseConfig:
name: my-pg-config
To create a new database cluster from another database cluster's backup throug restore or clone, add the basedOn
section in the spec of new cluster yaml file.
spec:
basedOn:
cluster:
name: source-cluster-name
timestamp: "2024-01-17T01:00:00Z"
apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: MySQLCluster
metadata:
name: team-mysql-cluster
namespace: default
spec:
backupConfig:
backupRetentionDays: 30
schedules:
- name: default-full-backup
schedule: 59 23 * * 6
type: full
backupLocation:
name: default-backup-storage
infrastructurePolicy:
name: sample-infra-policy
maintenanceWindow:
duration: 6h0m0s
startDay: SATURDAY
startTime: "23:59"
members: 1
storagePolicyName: dsm-test
storageSpace: 60Gi
version: 8.0.29+vmware.v2.0.0-rc.7
vmClass:
name: medium
Create a DatabaseConfig resource.
Create or edit a PostgresCluster spec to reference the databaseConfig.
Both the config and the database resource need to be in the same namespace.
spec:
databaseConfig:
name: my-mysql-config
To create a new database cluster from another database cluster's backup through restore or clone, add the basedOn
section in the spec of new cluster yaml file.
spec:
basedOn:
cluster:
name: source-cluster-name
timestamp: "2024-01-17T01:00:00Z"