Use the following yaml sample file to create DSM API resources.

infrastructure.dataservices.vmware.com/v1alpha1

IPPool

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"

VMClass

apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: VMClass
metadata:
  name: medium
spec:
  requests:
    cpu: "4"
    memory: "8"

InfrastructurePolicy

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

databases.dataservices.vmware.com/v1alpha1

DatabaseConfig

apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: DatabaseConfig
metadata:
  name: test-config
  namespace: default
spec:
  params:
    max_connections: "200"
    some_other_thing: "off"

PostgresCluster

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

Adding Custom Parameters to a Postgres Cluster

  1. Create a DatabaseConfig resource.

  2. 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
    

Creating a New PostgresCluster using Point in Time Restore (PiTR)

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"

MySQLCluster

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

Adding Custom Parameters to a MySQL Cluster

  1. Create a DatabaseConfig resource.

  2. 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
    

Creating New MySQLCluster using PiTR

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"
check-circle-line exclamation-circle-line close-line
Scroll to top icon