Skip to main content
Version: 3.2

storkctl create

Create stork resources

Example: storkctl create <resource> <flags>

note

The following commands support a set of global flags that can be used across all storkctl commands. For details, see the global flags section.

storkctl create applicationbackups

Start an applicationBackup

Aliases: applicationbackup, backup, backups

Example: storkctl create applicationbackup <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--backupLocation, -bstringBackupLocation to use for the backup-Yes
--namespacesstringSliceComma separated list of namespaces to backup[]Yes
--postExecRulestringRule to run after executing applicationbackup-Optional
--preExecRulestringRule to run before executing applicationbackup-Optional
--resourceTypesstringList of specific resource types which need to be backed up, ex: "Deployment,PersistentVolumeClaim"-Optional
--waitboolWait for applicationbackup to completefalseOptional

storkctl create applicationbackupschedules

Create a applicationBackup schedule

Aliases: applicationbackupschedule

Example: storkctl create applicationbackupschedule <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--backupLocation, -bstringBackupLocation to use for the backup-Yes
--namespacesstringSliceComma separated list of namespaces to migrate[]Yes
--postExecRulestringRule to run after executing applicationBackup-Optional
--preExecRulestringRule to run before executing applicationBackup-Optional
--schedulePolicyName, -sstringName of the schedule policy to usedefault-applicationbackup-policyOptional
--suspendboolFlag to denote whether schedule should be suspended on creationfalseOptional

storkctl create applicationclones

Start an applicationClone

Aliases: applicationclone, clone, clones

Example: storkctl create applicationclone <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--destinationNamespacestringThe namespace to where the applications should be cloned-Optional
--postExecRulestringRule to run after executing applicationclone-Optional
--preExecRulestringRule to run before executing applicationclone-Optional
--replacePolicy, -rstringPolicy to use if resources being cloned already exist in destination namespace (Retain or Delete).RetainOptional
--sourceNamespacestringThe namespace from where applications should be cloned-Optional
--waitboolWait for applicationclone to completefalseOptional

storkctl create applicationrestores

Start an applicationRestore

Aliases: applicationrestore, apprestore, apprestores

Example: storkctl create applicationrestore <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--backupLocation, -lstringBackupLocation to use for the restore-Yes
--backupName, -bstringBackup to restore from-Optional
--namespaceMappingstringNamespace mapping for each of the backed up namespaces, ex: <"srcns1:destns1,srcns2:destns2">-Optional
--replacePolicy, -rstringPolicy to use if resources being restored already exist (Retain or Delete).RetainOptional
--resourcesstringSpecific resources for restoring, should be given in format "<kind>/<namespace>/<name>,<kind>/<namespace>/<name>,<kind>/<name>", ex: "<Deployment>/<ns1>/<dep1>,<PersistentVolumeClaim>/<ns1>/<pvc1>,<ClusterRole>/<clusterrole1>"-Optional
--waitboolWait for applicationrestore to completefalseOptional

storkctl create clusterpair

Create ClusterPair on source and destination cluster

Example: storkctl create clusterpair <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--azure-account-keystringAccount key for Azure-Optional
--azure-account-namestringAccount name for Azure-Optional
--bucketstringBucket name-Optional
--dest-epstring(Optional)Endpoint of portworx-api service in destination cluster-Optional
--dest-kube-filestringPath to the kubeconfig of destination cluster-Yes
--dest-tokenstring(Optional)Destination cluster token for cluster pairing-Optional
--disable-sslboolSet to true to disable ssl when using S3falseOptional
--encryption-keystringEncryption key for encrypting the data stored in the objectstore.-Optional
--google-key-file-pathstringJson key file path for Google-Optional
--google-project-idstringProject ID for Google-Optional
--modestringMode of DR. [async-dr, sync-dr, migration]async-drOptional
--nfs-export-pathstringmount path exported by the NFS server-Optional
--nfs-mount-optsstringoptional NFS mount options-Optional
--nfs-serverstringNFS server address-Optional
--nfs-sub-pathstringsub-path to use in mount-Optional
--nfs-timeout-secondsintoptional nfs IO timeout in seconds (Valid Range: [1 30]) (default 5)5Optional
--project-mappingsstringProject mappings between source and destination clusters (currently supported only for Rancher).
Use comma-separated <source-project-id>=<dest-project-id> pairs.
For the project-id, you can also have a cluster-id field added as a prefix to the project-id.
It is recommended to include both one-to-one mappings of the project-id and Rancher cluster-id prefixed project-id as follows:
<source-project-id>=<dest-project-id>,<source-cluster-id>:<source-project-id>=<dest-cluster-id>:<dest-project-id>
-Optional
--provider, -pstringExternal objectstore provider name. [s3, azure, google, nfs]-Yes
--s3-access-keystringAccess Key for S3-Optional
--s3-endpointstringEndPoint for S3-Optional
--s3-regionstringRegion for S3-Optional
--s3-secret-keystringSecret Key for S3-Optional
--s3-storage-classstringStorage Class for S3-Optional
--src-epstring(Optional)Endpoint of portworx-api service in source cluster-Optional
--src-kube-filestringPath to the kubeconfig of source cluster-Yes
--src-tokenstring(Optional)Source cluster token for cluster pairing-Optional
--unidirectional, -ubool(Optional) to create Clusterpair from source -> dest onlyfalseOptional
--use-existing-objectstorelocationstring(Optional) Objectstorelocation with the provided name should be present in both source and destination cluster-Optional

storkctl create groupsnapshots

Create a group volume snapshot

Aliases: groupsnapshot

Example: storkctl create groupsnapshot <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--maxRetriesintNumber of times to retry the groupvolumesnapshot on failure0Optional
--optsstringSliceComma-separated list of options to provide to the storage driver. These are in the format key1=value1,key2=value2. e.g portworx/snapshot-type=cloud[]Optional
--postExecRulestringRule to run after triggering group volume snapshot-Optional
--preExecRulestringRule to run before triggering group volume snapshot-Optional
--pvcSelectorsstringSliceComma-separated list of PVC selectors in the format key1=value1,key2=value2. e.g app=mysql,tier=db[]Yes
--restoreNamespacesstringSliceList of namespaces to which the snapshots can be restored to[]Optional

storkctl create migrations

Start a migration

Aliases: migration

Example: storkctl create migration <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--clusterPair, -cstringClusterPair name for migration-Yes
--dry-runboolValidate migration params before starting migrationfalseOptional
--file, -fstringfile to run migration-Optional
--includeResources, -rboolInclude resources in the migrationtrueOptional
--includeVolumesboolInclude volumees in the migrationtrueOptional
--namespacesstringSliceComma separated list of namespaces to migrate[]Yes
--postExecRulestringRule to run after executing migration-Optional
--preExecRulestringRule to run before executing migration-Optional
--previewboolPreview resources that will be migratedfalseOptional
--previewFilestringfile where migration preview will be saved-Optional
--startApplications, -aboolStart applications on the destination cluster after migrationtrueOptional
--waitboolWait for migration to completefalseOptional

storkctl create migrationschedules

Create a migration schedule

Aliases: migrationschedule

Example: storkctl create migrationschedule <name> <flags> -n <migrationschedule-namespace>

Flags

FlagInput typeDescriptionDefaultRequired
--admin-cluster-pairstringSpecify the name of the admin ClusterPair used to migrate cluster-scoped resources, if the ClusterPair is present in a non-admin namespace-Optional
--annotationsstringToStringAdd required annotations to the resource in comma-separated key value pairs. key1=value1,key2=value2,...[]Optional
--cluster-pair, -cstringSpecify the name of the ClusterPair in the same namespace to be used for the migration-Yes
--disable-auto-suspendboolPrevent automatic suspension of DR migration schedules on the source cluster in case of a disasterfalseOptional
--disable-skip-deleted-namespacesboolIf present, Stork will fail the migration when it encounters a namespace that is deleted but specified in the namespaces field. By default, Stork ignores deleted namespaces during migrationfalseOptional
--exclude-resource-typesstringSliceComma-separated list of the specific resource types which need to be excluded from migration, ex: Deployment,PersistentVolumeClaim[]Optional
--exclude-resourcesboolIf present, Kubernetes resources will not be migratedfalseOptional
--exclude-selectorsstringToStringResources with the provided labels will be excluded from the migration. All the labels provided in this option will be OR'ed[]Optional
--exclude-volumesboolIf present, the underlying Portworx volumes will not be migrated. This is the only allowed and default behaviour in sync-dr use-cases or when storage options are not provided in the cluster pairfalseOptional
--ignore-owner-references-checkboolIf set, resources with ownerReferences will also be migrated, even if the corresponding owners are getting migratedfalseOptional
--include-jobsboolSet this flag to ensure that K8s Job resources are migrated. By default, the Job resources are not migratedfalseOptional
--include-network-policy-with-cidrboolIf set, the underlying network policies will be migrated even if a fixed CIDR is present on themfalseOptional
--interval, -iintSpecify the time interval, in minutes, at which Stork should trigger migrations30Optional
--namespace-selectorsstringToStringResources in the namespaces with the specified namespace labels will be migrated. All the labels provided in this option will be OR'ed[]Optional
--namespacesstringSliceSpecify the comma-separated list of namespaces to be included in the migration[]Yes
--post-exec-rulestringSpecify the name of the rule to be executed after every migration is triggered-Optional
--pre-exec-rulestringSpecify the name of the rule to be executed before every migration is triggered-Optional
--previewboolPreview resources that will be migratedfalseOptional
--preview-filestringfile where migration preview will be saved-Optional
--purge-deleted-resourcesboolSet this flag to automatically delete Kubernetes resources in the target cluster when they are removed from the source clusterfalseOptional
--schedule-policy-name, -sstringName of the schedule policy to use. If you want to create a new interval policy, use the --interval flag insteaddefault-migration-policyOptional
--selectorsstringToStringOnly resources with the provided labels will be migrated. All the labels provided in this option will be OR'ed[]Optional
--skip-service-updateboolIf set, service objects will be skipped during migrationfalseOptional
--start-applications, -aboolIf present, the applications will be scaled up on the target cluster after a successful migrationfalseOptional
--suspendboolFlag to denote whether schedule should be suspended on creationfalseOptional
--transform-specstringSpecify the ResourceTransformation spec to be applied during migration-Optional

storkctl create persistentvolumeclaims

Create persistent volume claims (PVCs) from snapshots

Aliases: persistentvolumeclaim, volume, pvc

Example: storkctl create pvc <pvc-name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--acccess-mode, -astringAccess mode for the new PVCReadWriteOnceOptional
--sizestringSize for the new PVC (example 2Gi)-Yes
--snapshot, -sstringName of the snapshot to use to create the PVC-Yes
--source-nsstringThe source namespace if the snapshot was created in a different namespace-Optional

storkctl create schedulepolicy

Create schedule policy

Aliases: sp

Example: storkctl create schedulepolicy <name>

Flags

FlagInput typeDescriptionDefaultRequired
--date-of-monthintSpecify the date of the month when Stork should trigger the operation.1Optional
--day-of-weekstringSpecify the day of the week when Stork should trigger the operation. You can use both the abbreviated or the full name of the day of the week.SundayOptional
--force-full-snapshot-daystringFor daily scheduled backup operations, specify on which day to trigger a full backup.MondayOptional
--interval-minutes, -iintSpecify the interval, in minutes, after which Stork should trigger the operation.30Optional
--policy-type, -tstringSelect Type of schedule policy to apply. Interval / Daily / Weekly / Monthly.IntervalOptional
--retainintFor backup operations,specify how many backups triggered as part of this schedule should be retained.0Optional
--timestringSpecify the time of the day in the 12 hour AM/PM format, when Stork should trigger the operation.12:00AMOptional

storkctl create volumesnapshotrestore

Restore snapshot to source PVC

Aliases: volumesnapshotrestores, snapshotrestore, snapshotrestore, snaprestore, snapsrestores

Example: storkctl create volumesnapshotrestore <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--groupsnapshot, -gboolTrue if snapshot is group, default falsefalseOptional
--snapnamestringSnapshot name to be restored-Optional
--sourcenamepacestringNamespace of snapshotdefaultOptional

storkctl create volumesnapshots

Create snapshot resources

Aliases: volumesnapshot, snapshots, snapshot, snap

Example: storkctl create volumesnapshot <snapshot-name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--pvc, -pstringName of the PVC which should be used to create a snapshot-Yes

storkctl create volumesnapshotschedules

Create a snapshot schedule

Aliases: volumesnapshotschedule, snapshotschedule, snapshotschedules

Example: storkctl create volumesnapshotschedule <name> <flags>

Flags

FlagInput typeDescriptionDefaultRequired
--postExecRulestringRule to run after executing snapshot-Optional
--preExecRulestringRule to run before executing snapshot-Optional
--pvc, -pstringName of the PVC for which to create a snapshot schedule-Optional
--reclaimPolicystringReclaim policy for the created snapshots (Retain or Delete)RetainOptional
--schedulePolicyName, -sstringName of the schedule policy to use-Yes
--suspendboolFlag to denote whether schedule should be suspended on creationfalseOptional