API Examples

API Examples

databases.dataservices.vmware.com/v1alpha1

DatabaseConfig

With a custom db param.

apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: DatabaseConfig
metadata:
  name: db-config-i4c35-1721685809783
  namespace: default
spec:
  params:
    max_connections: "300"

MySQLCluster

With a custom db param, backup config and 2 replicas.

apiVersion: databases.dataservices.vmware.com/v1alpha1
kind: MySQLCluster
metadata:
  name: foo-db
  namespace: default
spec:
  backupConfig:
    backupRetentionDays: 30
    schedules:
    - name: default-full-backup
      schedule: 59 23 * * 6
      type: full
  backupLocation:
    name: default-backup-storage
  databaseConfig:
    name: db-config-87o9b-1721686239818
  infrastructurePolicy:
    name: infra-policy-02-rp
  maintenanceWindow:
    duration: 6h0m0s
    startDay: SATURDAY
    startTime: "22:59"
  members: 3
  storagePolicyName: dsm-test
  storageSpace: 60Gi
  version: 8.0.34+vmware.v2.1.0
  vmClass:
    name: medium

PostgresCluster

With a custom db param, backup config and 1 replica.

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
  databaseConfig:
    name: db-config-i4c35-1721685809783
  databaseName: my-pg-cluster
  infrastructurePolicy:
    name: infra-policy-02-rp
  maintenanceWindow:
    duration: 6h0m0s
    startDay: SATURDAY
    startTime: "22:59"
  replicas: 1
  storagePolicyName: dsm-test
  storageSpace: 60Gi
  version: 16.3+vmware.v2.1.0
  vmClass:
    name: medium

infrastructure.dataservices.vmware.com/v1alpha1

IPPool

With 2 ip ranges.

apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: IPPool
metadata:
  name: test-ippool
spec:
  addresses:
  - 1.1.1.1
  - 1.1.1.12-1.1.1.50
  - 1.1.1.65-1.1.1.90
  gateway: 10.10.10.10
  prefix: 24

VMClass

With 8 vCPU and 16 Gi memory.

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

InfrastructurePolicy

With a resource pool.

apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: InfrastructurePolicy
metadata:
  name: infra-policy-02-rp
spec:
  enabled: true
  ipRanges:
  - poolName: ippools-test-01
    portGroups:
    - datacenter: dbaas-dc
      name: Mgmt
  placements:
  - cluster: dbaas-cluster
    datacenter: dbaas-dc
    folder: DSM
    portGroups:
    - Mgmt
    resourcePool: rp1
  storagePolicies:
  - dsm-test
  vmClasses:
  - name: small
  - name: medium
  - name: large

DirectoryService

With ldap configured.

apiVersion: v1
kind: Secret
metadata:
  name: sample-ldap-ca
  namespace: dsm-system
data:
  tls.crt: |
    -----BEGIN CERTIFICATE-----
    MIID0DCCArigAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJGUjET
    MBEGA1UECAwKU29tZS1TdGF0ZTEOMAwGA1UEBwwFUGFyaXMxDTALBgNVBAoMBERp
    bWkxDTALBgNVBAsMBE5TQlUxEDAOBgNVBAMMB0RpbWkgQ0ExGzAZBgkqhkiG9w0B
    CQEWDGRpbWlAZGltaS5mcjAeFw0xNDAxMjgyMDM2NTVaFw0yNDAxMjYyMDM2NTVa
    MFsxCzAJBgNVBAYTAkZSMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ
    bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFDASBgNVBAMMC3d3dy5kaW1pLmZyMIIB
    IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvpnaPKLIKdvx98KW68lz8pGa
    RRcYersNGqP-this-is-a-dummy-cert-uidhasaFSJSAKCvrtWhN+haKbSp+QWX
    SxiTrW99HBfAl1MDQyWcukoEb9Cw6INctVUN4iRvkn9T8E6q174RbcnwA/7yTc7p
    1NCvw+6B/aAN9l1G2pQXgRdYC/+G6o1IZEHtWhqzE97nY5QKNuUVD0V09dc5CDYB
    aKjqetwwv6DFk/GRdOSEd/6bW+20z0qSHpa3YNW6qSp+x5pyYmDrzRIR03os6Dau
    ZkChSRyc/Whvurx6o85D6qpzywo8xwNaLZHxTQPgcIA5su9ZIytv9LH2E+lSwwID
    AQABo3sweTAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVy
    YXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQU+tugFtyN+cXe1wxUqeA7X+yS3bgw
    HwYDVR0jBBgwFoAUhMwqkbBrGp87HxfvwgPnlGgVR64wDQYJKoZIhvcNAQEFBQAD
    ggEBAIEEmqqhEzeXZ4CKhE5UM9vCKzkj5Iv9TFs/a9CcQuepzplt7YVmevBFNOc0
    +1ZyR4tXgi4+5MHGzhYCIVvHo4hKqYm+J+o5mwQInf1qoAHuO7CLD3WNa1sKcVUV
    vepIxc/1aHZrG+dPeEHt0MdFfOw13YdUc2FH6AqEdcEL4aV5PXq2eYR8hR4zKbc1
    fBtuqUsvA8NWSIyzQ16fyGve+ANf6vXvUizyvwDrPRv/kfvLNa3ZPnLMMxU98Mvh
    PXy3PkB8++6U4Y3vdk2Ni2WYYlIls8yqbM4327IKmkDc2TimS8u60CT47mKU7aDY
    cbTV5RDkrlaYwm5yqlTIglvCv7o=
    -----END CERTIFICATE-----
---
apiVersion: v1
kind: Secret
metadata:
  name: sample-ldap-credentials
  namespace: dsm-system
type: "kubernetes.io/basic-auth"
data:
  username: bGRhcGFkbWlu  # This is 'ldapadmin' encoded in Base64
  password: cGFzc3dvcmQ=  # This is 'password' encoded in Base64
---
apiVersion: infrastructure.dataservices.vmware.com/v1alpha1
kind: DirectoryService
metadata:
  name: ldap-default
  namespace: dsm-system
spec:
  type: "ActiveDirectory"
  domain: vmware.com
  baseDnUsers: dc=vmware,dc=com
  bindCredentials:
    name: sample-ldap-credentials
  primaryServerUrl: ldaps://ldap.vmware.com:3269
  secondaryServerUrls:
    - ldaps://scrootdc1.vmware.com:3269
    - ldaps://scdc2rootdc04.vmware.com:3269
  trustBundle:
    name: sample-ldap-ca
    namespace: dsm-system
  userSearchAttribute: "userPrincipalName"

system.dataservices.vmware.com/v1alpha1

DsmSystemConfig

With ntp configured.

apiVersion: system.dataservices.vmware.com/v1alpha1
kind: DsmSystemConfig
metadata:
  name: dsm-system-config
spec:
  ceipConsent: true
  dnsServers:
  - 1.2.3.4
  dsmProviderId: f9b039f9-2683-43b1-aae0-5602614cde0b
  externalLogDestination:
    enabled: false
    trustBundle: {}
  gateway: 10.11.12.13
  ip: 5.6.7.8
  netmask: 255.255.224.0
  ntpServers:
  - time.vmware.com

With external log destination - udp configured.

apiVersion: system.dataservices.vmware.com/v1alpha1
kind: DsmSystemConfig
...
spec:
  externalLogDestination:
    enabled: true
    remoteLogDestinationProvider: syslog server
    remoteLogUrl: udp://0.0.1.1:514
	trustBundle: {}

With external log destination - tls configured.

apiVersion: system.dataservices.vmware.com/v1alpha1
kind: DsmSystemConfig
...
spec:
  externalLogDestination:
    enabled: true
    remoteLogDestinationProvider: syslog server
    remoteLogUrl: ssl://0.0.1.1:1514
	trustBundle:
	  name: trusted-root-ca
	  namespace: dsm-system