Skip to content

Commit

Permalink
Update docs to reflect podAnnotations and podLabels args for Kani…
Browse files Browse the repository at this point in the history
…ster functions (#3014)
  • Loading branch information
viveksinghggits authored Aug 21, 2024
1 parent 314b65d commit c3c3bc9
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 1 deletion.
72 changes: 72 additions & 0 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ This allows you to run a new Pod from a Blueprint.
`image`, Yes, `string`, image to be used for executing the task
`command`, Yes, `[]string`, command list to execute
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Example:

Expand All @@ -138,6 +140,10 @@ Example:
containers:
- name: container
imagePullPolicy: IfNotPresent
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
command:
- sh
- -c
Expand Down Expand Up @@ -241,6 +247,8 @@ ScaleWorkload.
`command`, Yes, `[]string`, command list to execute
`serviceaccount`, No, `string`, service account info
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
The ``volumes`` argument does not support ``subPath`` mounts so the
Expand Down Expand Up @@ -270,6 +278,10 @@ Example:
volumes:
application-pvc-1: "/data"
application-pvc-2: "/restore-data"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
command:
- sh
- -c
Expand Down Expand Up @@ -434,6 +446,8 @@ and restores data to the specified path.
`encryptionKey`, No, `string`, encryption key to be used during backups
`insecureTLS`, No, `bool`, enables insecure connection for data mover
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
The ``image`` argument requires the use of ``ghcr.io/kanisterio/kanister-tools``
Expand Down Expand Up @@ -468,6 +482,10 @@ backup function.
image: ghcr.io/kanisterio/kanister-tools:|version|
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupTag: "{{ .ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload
name: StartupApplication
args:
Expand Down Expand Up @@ -510,6 +528,8 @@ respective PVCs and restores data to the specified path.
`backupInfo`, Yes, `string`, snapshot info generated as output in BackupDataAll function
`insecureTLS`, No, `bool`, enables insecure connection for data mover
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
The `image` argument requires the use of `ghcr.io/kanisterio/kanister-tools`
Expand Down Expand Up @@ -544,6 +564,10 @@ BackupDataAll function.
image: ghcr.io/kanisterio/kanister-tools:|version|
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupInfo: "{{ .ArtifactsIn.params.KeyValue.backupInfo }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload
name: StartupApplication
args:
Expand Down Expand Up @@ -581,6 +605,8 @@ Arguments:
`encryptionKey`, No, `string`, encryption key to be used during backups
`insecureTLS`, No, `bool`, enables insecure connection for data mover
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Outputs:

Expand All @@ -606,6 +632,10 @@ If the ActionSet ``Object`` is a PersistentVolumeClaim:
namespace: "{{ .PVC.Namespace }}"
volume: "{{ .PVC.Name }}"
dataArtifactPrefix: s3-bucket-name/path
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
.. _deletedata:

Expand All @@ -627,6 +657,8 @@ This function deletes the snapshot data backed up by the :ref:`backupdata` funct
`encryptionKey`, No, `string`, encryption key to be used during backups
`insecureTLS`, No, `bool`, enables insecure connection for data mover
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Example:

Expand All @@ -643,6 +675,10 @@ For this phase, we will use the ``backupInfo`` Artifact provided by backup funct
namespace: "{{ .Namespace.Name }}"
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupTag: "{{ .ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
.. _deletedataall:

Expand All @@ -665,6 +701,8 @@ BackupDataAll function.
`reclaimSpace`, No, `bool`, provides a way to specify if space should be reclaimed
`insecureTLS`, No, `bool`, enables insecure connection for data mover
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Example:

Expand All @@ -682,6 +720,10 @@ For this phase, we will use the ``params`` Artifact provided by backup function.
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupInfo: "{{ .ArtifactsIn.params.KeyValue.backupInfo }}"
reclaimSpace: true
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
LocationDelete
--------------
Expand Down Expand Up @@ -879,6 +921,8 @@ Arguments:
`backupID`, Yes, `string`, unique snapshot id generated during backup
`mode`, No, `string`, mode in which stats are expected
`encryptionKey`, No, `string`, encryption key to be used for backups
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Outputs:

Expand Down Expand Up @@ -912,6 +956,10 @@ Example:
backupArtifactPrefix: s3-bucket/path/artifactPrefix
mode: restore-size
backupID: "{{ .ArtifactsIn.snapshot.KeyValue.backupIdentifier }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
CreateRDSSnapshot
Expand Down Expand Up @@ -991,6 +1039,8 @@ Arguments:
`securityGroupID`, No, `[]string`, list of ``securityGroupID`` to be passed to temporary RDS instance. ()
`dbSubnetGroup`, No, `string`, DB Subnet Group to be passed to temporary RDS instance
`image`, No, `string`, kanister-tools image to be used for running export job
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
- If ``databases`` argument is not set, backup of all the databases will be taken.
Expand Down Expand Up @@ -1052,6 +1102,10 @@ Example:
snapshotID: "{{ .Phases.createSnapshot.Output.snapshotID }}"
backupArtifactPrefix: test-postgresql-instance/postgres
dbSubnetGroup: "{{ .Phases.createSnapshot.Output.dbSubnetGroup }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
RestoreRDSSnapshot
Expand Down Expand Up @@ -1082,6 +1136,8 @@ Arguments:
`dbEngine`, No, `string`, one of the RDS db engines. Supported engines: ``PostgreSQL`` ``aurora`` ``aurora-mysql`` and ``aurora-postgresql``. Required if ``snapshotID`` is nil or Aurora is run in RDS instance
`dbSubnetGroup`, No, `string`, DB Subnet Group to be passed to restored RDS instance
`image`, No, `string`, kanister-tools image to be used for running restore. Only relevant when restoring from data dump (if `snapshotID` is empty)
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
- If ``snapshotID`` is not set, restore will be done from data dump. In that case ``backupID`` `arg` is required.
Expand Down Expand Up @@ -1124,6 +1180,10 @@ Example:
password: '{{ index .Phases.restoreSnapshots.Secrets.dbsecret.Data "password" | toString }}'
dbEngine: "PostgreSQL"
dbSubnetGroup: "{{ .ArtifactsIn.backupInfo.KeyValue.dbSubnetGroup }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
DeleteRDSSnapshot
-----------------
Expand Down Expand Up @@ -1646,6 +1706,8 @@ function argument and restores data to the specified path.
`volumes`, No, `map[string]string`, mapping of `pvcName` to `mountPath` under which the volume will be available
`podOverride`, No, `map[string]interface{}`, specs to override default pod specs with
`repositoryServerUserHostname`, No, `string`, user's hostname to access the kopia repository server. Hostname would be available in the user access credential secret
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

.. note::
The ``image`` argument requires the use of ``ghcr.io/kanisterio/kanister-tools``
Expand Down Expand Up @@ -1684,6 +1746,10 @@ backup function.
pod: "{{ index .Deployment.Pods 0 }}"
backupIdentifier: "{{ .ArtifactsIn.backupIdentifier.KeyValue.id }}"
restorePath: /mnt/data
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload
name: bringupPod
args:
Expand Down Expand Up @@ -1716,6 +1782,8 @@ function. It creates a new Pod that runs ``delete snapshot`` command.
`backupID`, Yes, `string`, unique snapshot id generated during backup
`image`, Yes, `string`, image to be used for running delete job (should contain kopia binary)
`repositoryServerUserHostname`, No, `string`, user's hostname to access the kopia repository server. Hostname would be available in the user access credential secret
`podAnnotations`, No, `map[string]string`, custom annotations for the temporary pod that gets created
`podLabels`, No, `map[string]string`, custom labels for the temporary pod that gets created

Example:

Expand All @@ -1732,6 +1800,10 @@ For this phase, we will use the ``backupIdentifier`` Artifact provided by backup
namespace: "{{ .Deployment.Namespace }}"
backupID: "{{ .ArtifactsIn.backupIdentifier.KeyValue.id }}"
image: ghcr.io/kanisterio/kanister-tools:0.89.0
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
Registering Functions
---------------------
Expand Down
Loading

0 comments on commit c3c3bc9

Please sign in to comment.