Skip to content

Commit

Permalink
docs: Fix formatting and tags translation issues in new_docs (#3080)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
hairyhum and mergify[bot] authored Sep 19, 2024
1 parent 179da38 commit 3308f08
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 54 deletions.
7 changes: 3 additions & 4 deletions docs_new/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ type ActionSpec struct {
- `ConfigMaps` and `Secrets`, similar to `Artifacts`, are a mappings
of names specified in the Blueprint referencing the Kubernetes
object to be used.
- `Profile` is a reference to a `Profile<profiles>`{.interpreted-text
role="ref"} Kubernetes CustomResource that will be made available to
- `Profile` is a reference to a [Profile](#profiles) Kubernetes CustomResource that will be made available to
the Blueprint.
- `Options` is used to specify additional values to be used in the
Blueprint
Expand Down Expand Up @@ -369,8 +368,8 @@ in which it is deployed. When it sees an ActionSet with a nil status
field, it immediately initializes the ActionSet\'s status to the Pending
State. The status is also prepopulated with the pending phases.

Execution begins by resolving all the `templates`{.interpreted-text
role="ref"}. If any required object references or artifacts are missing
Execution begins by resolving all the [Templates](templates.md).
If any required object references or artifacts are missing
from the ActionSet, the ActionSet status is marked as failed. Otherwise,
the template params are used to render the output Artifacts, and then
the args in the Blueprint.
Expand Down
106 changes: 67 additions & 39 deletions docs_new/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,32 @@ this phase, we will use the `backupInfo` Artifact provided by backup
function.

``` yaml
- func: ScaleWorkload name: ShutdownApplication args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 0
- func: RestoreData name: RestoreFromObjectStore args: namespace: \"{{
.Deployment.Namespace }}\" pod: \"{{ index .Deployment.Pods 0 }}\"
image: ghcr.io/kanisterio/kanister-tools: backupArtifactPrefix:
s3-bucket/path/artifactPrefix backupTag: \"{{
.ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}\"
- func: ScaleWorkload
name: ShutdownApplication
args:
namespace: \"{{.Deployment.Namespace }}\"
name: \"{{ .Deployment.Name }}\"
kind: Deployment
replicas: 0
- func: RestoreData
name: RestoreFromObjectStore
args:
namespace: \"{{.Deployment.Namespace }}\"
pod: \"{{ index .Deployment.Pods 0 }}\"
image: ghcr.io/kanisterio/kanister-tools:0.110.0
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupTag: \"{{.ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}\"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload name: StartupApplication args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 1
- func: ScaleWorkload
name: StartupApplication
args:
namespace: \"{{.Deployment.Namespace }}\"
name: \"{{ .Deployment.Name }}\"
kind: Deployment
replicas: 1
```

### RestoreDataAll
Expand Down Expand Up @@ -491,30 +502,38 @@ on all pods concurrently. For this phase, we will use the `params`
Artifact provided by BackupDataAll function.

``` yaml
- func: ScaleWorkload name: ShutdownApplication args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 0
- func: RestoreDataAll name: RestoreFromObjectStore args: namespace:
\"{{ .Deployment.Namespace }}\" image:
ghcr.io/kanisterio/kanister-tools: backupArtifactPrefix:
s3-bucket/path/artifactPrefix backupInfo: \"{{
.ArtifactsIn.params.KeyValue.backupInfo }}\"
- func: ScaleWorkload
name: ShutdownApplication
args:
namespace: "{{ .Deployment.Namespace }}"
name: "{{ .Deployment.Name }}"
kind: Deployment
replicas: 0
- func: RestoreDataAll
name: RestoreFromObjectStore
args:
namespace: "{{ .Deployment.Namespace }}"
image: ghcr.io/kanisterio/kanister-tools:0.110.0
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupInfo: "{{ .ArtifactsIn.params.KeyValue.backupInfo }}"
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload name: StartupApplication args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 2
- func: ScaleWorkload
name: StartupApplication
args:
namespace: "{{ .Deployment.Namespace }}"
name: "{{ .Deployment.Name }}"
kind: Deployment
replicas: 2
```

### CopyVolumeData

This function copies data from the specified volume (referenced by a
Kubernetes PersistentVolumeClaim) into an object store. This data can be
restored into a volume using the `restoredata`{.interpreted-text
role="ref"} function
restored into a volume using the [RestoreData](#restoredata) function

::: tip NOTE

Expand Down Expand Up @@ -725,9 +744,8 @@ Arguments:
### CreateVolumeFromSnapshot

This function is used to restore one or more PVCs of an application from
the snapshots taken using the `createvolumesnapshot`{.interpreted-text
role="ref"} function. It deletes old PVCs, if present and creates new
PVCs from the snapshots taken earlier.
the snapshots taken using the [CreateVolumeSnapshot](#createvolumesnapshot) function.
It deletes old PVCs, if present and creates new PVCs from the snapshots taken earlier.

Arguments:

Expand Down Expand Up @@ -1546,21 +1564,31 @@ provided by backup function.

``` yaml
- func: ScaleWorkload name: shutdownPod args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 0
- func: RestoreDataUsingKopiaServer name: restoreFromS3 args:
namespace: \"{{ .Deployment.Namespace }}\" pod: \"{{ index
.Deployment.Pods 0 }}\" backupIdentifier: \"{{
.ArtifactsIn.backupIdentifier.KeyValue.id }}\" restorePath:
/mnt/data
- func: ScaleWorkload
name: shutdownPod
args:
namespace: \"{{.Deployment.Namespace }}\"
name: \"{{ .Deployment.Name }}\"
kind: Deployment
replicas: 0
- func: RestoreDataUsingKopiaServer
name: restoreFromS3
args:
namespace: \"{{ .Deployment.Namespace }}\"
pod: \"{{ index.Deployment.Pods 0 }}\"
backupIdentifier: \"{{.ArtifactsIn.backupIdentifier.KeyValue.id }}\"
restorePath: /mnt/data
podAnnotations:
annKey: annValue
podLabels:
labelKey: labelValue
- func: ScaleWorkload name: bringupPod args: namespace: \"{{
.Deployment.Namespace }}\" name: \"{{ .Deployment.Name }}\" kind:
Deployment replicas: 1
- func: ScaleWorkload
name: bringupPod
args:
namespace: \"{{.Deployment.Namespace }}\"
name: \"{{ .Deployment.Name }}\"
kind: Deployment
replicas: 1
```

### DeleteDataUsingKopiaServer
Expand Down
2 changes: 1 addition & 1 deletion docs_new/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ kubectl create secret tls my-tls-secret \--cert /path/to/tls.crt \--key
```

Install Kanister, providing the PEM-encoded CA bundle and the
[tls]{.title-ref} secret name like below:
`tls` secret name like below:

``` bash
helm upgrade \--install kanister kanister/kanister-operator \--namespace
Expand Down
5 changes: 2 additions & 3 deletions docs_new/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ The TemplateParams struct has one field for each well known object type,
which is effectively a union in go.

Other than the types mentioned above, Kanister can also act on any
Kubernetes object such as a CRD and the `object`{.interpreted-text
role="ref"} field in TemplateParams is populated with the unstructured
content of those.
Kubernetes object such as a CRD and the [object](#object) field in
TemplateParams is populated with the unstructured content of those.

Each param struct described below is a set of useful fields related to
the Object.
Expand Down
11 changes: 4 additions & 7 deletions docs_new/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ use more of Kanister's features to manage the application's data.
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
installed and setup
- [helm](https://helm.sh) installed and initialized using the command
[helm init]{.title-ref}
`helm init`
- docker
- A running Kanister controller. See `install`{.interpreted-text
role="ref"}
- A running Kanister controller. See [install](install)
- Access to an S3 bucket and credentials.

## Example Application
Expand Down Expand Up @@ -185,8 +184,7 @@ choose where to store the log based on values in a ConfigMap. ConfigMaps
are referenced in an ActionSet, which are fetched by the controller and
made available to Blueprints through parameter templating.

For more on templating in Kanister, see `templates`{.interpreted-text
role="ref"}.
For more on templating in Kanister, see [templates](templates).

In this section of the tutorial, we\'re going to use a ConfigMap to
choose where to backup our time log. We\'ll name our ConfigMap and
Expand Down Expand Up @@ -313,8 +311,7 @@ the ConfigMap, we can also push the log to S3. In this Secret, we store
the credentials as binary data. We can use the templating engine
`toString` and `quote` functions, courtesy of sprig.

For more on this templating, see `templates`{.interpreted-text
role="ref"}
For more on this templating, see [templates](templates)

``` yaml
cat <<EOF | kubectl apply -f -
Expand Down

0 comments on commit 3308f08

Please sign in to comment.