Skip to content

Commit

Permalink
docs: Add docs for Argo Workflow controller-instanceid label (#290) (#…
Browse files Browse the repository at this point in the history
…292)

* docs: Add docs for Argo Workflow controller-instanceid label (#290)
- Added a section to explain the requirement of the `workflows.argoproj.io/controller-instanceid` label in the Workflow YAML.
- Included an example showing where to add the label.
- Explained how to retrieve the instanceID value from the workflow-controller-configmap.

Signed-off-by: Thiha Min Thant <[email protected]>
  • Loading branch information
thiha-min-thant authored Oct 5, 2024
1 parent d25b7fc commit d0229fe
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 22 deletions.
24 changes: 24 additions & 0 deletions website/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ To configure a git repo the user must provide the Git URL of the repository and

Once GitOps is enabled, any new chaos experiments created will be stored in the configured repo in the path `litmus/<project-id>/<chaos-experiment-name>.yaml`.

### Why is my Argo Workflow not being picked up by the Workflow controller upon applying it manually?

If your Argo Workflow is not being picked up by the Workflow controller after applying it, you may be missing the `workflows.argoproj.io/controller-instanceid` label in your Workflow manifest. This label is required for the Workflow controller to reconcile the Workflow upon its creation.

To fix this, ensure the following label is added under `metadata.labels` field in the Workflow manifest:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
labels:
workflows.argoproj.io/controller-instanceid: <instanceID>
```
The `instanceID` value can be found in the `workflow-controller-configmap`. Here’s how to retrieve it:

```shell
kubectl get configmap workflow-controller-configmap -n <namespace> -o yaml
```

Look for the `instanceID` key in the configmap and use that value in your Workflow manifest.

Without this label, the Workflow controller will not be able to reconcile the Workflow.

## Litmusctl

### Does Litmusctl support actions that are currently performed from the portal dashboard?
Expand Down
29 changes: 18 additions & 11 deletions website/docs/user-guides/construct-experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,24 @@ Here, the template with the name `custom-chaos` will be executed first.
4. **Artifacts** : Artifacts are defined as the files saved by the containers in each step.

```yaml
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
```

### Ensuring Your Workflow is Recognized by the Argo Workflow Controller

When applying a Workflow manually without ChaosCenter, it's crucial to include the `workflows.argoproj.io/controller-instanceid` label in the manifest. This label helps Argo Workflow controller identify and reconcile the Workflow upon its creation.
The instanceID value can be found in the `workflow-controller-configmap` under the instanceID key.

Once the chaos experiment is constructed, it should look like this:

```yaml
Expand All @@ -86,6 +91,8 @@ kind: Workflow
metadata:
name: pod-delete-experiment
namespace: litmus
labels:
workflows.argoproj.io/controller-instanceid: 86a4f130-d99b-4e91-b34b-8f9eee22cb63
spec:
arguments:
parameters:
Expand Down
24 changes: 24 additions & 0 deletions website/versioned_docs/version-3.10.0/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ To configure a git repo the user must provide the Git URL of the repository and

Once GitOps is enabled, any new chaos experiments created will be stored in the configured repo in the path `litmus/<project-id>/<chaos-experiment-name>.yaml`.

### Why is my Argo Workflow not being picked up by the Workflow controller upon applying it manually?

If your Argo Workflow is not being picked up by the Workflow controller after applying it, you may be missing the `workflows.argoproj.io/controller-instanceid` label in your Workflow manifest. This label is required for the Workflow controller to reconcile the Workflow upon its creation.

To fix this, ensure the following label is added under `metadata.labels` field in the Workflow manifest:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
labels:
workflows.argoproj.io/controller-instanceid: <instanceID>
```
The `instanceID` value can be found in the `workflow-controller-configmap`. Here’s how to retrieve it:

```shell
kubectl get configmap workflow-controller-configmap -n <namespace> -o yaml
```

Look for the `instanceID` key in the configmap and use that value in your Workflow manifest.

Without this label, the Workflow controller will not be able to reconcile the Workflow.

## Litmusctl

### Does Litmusctl support actions that are currently performed from the portal dashboard?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,24 @@ Here, the template with the name `custom-chaos` will be executed first.
4. **Artifacts** : Artifacts are defined as the files saved by the containers in each step.

```yaml
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
```

### Ensuring Your Workflow is Recognized by the Argo Workflow Controller

When applying a Workflow manually without ChaosCenter, it's crucial to include the `workflows.argoproj.io/controller-instanceid` label in the manifest. This label helps Argo Workflow controller identify and reconcile the Workflow upon its creation.
The instanceID value can be found in the `workflow-controller-configmap` under the instanceID key.

Once the chaos scenario is constructed, it should look like this:

```yaml
Expand All @@ -86,6 +91,8 @@ kind: Workflow
metadata:
name: pod-delete-experiment
namespace: litmus
labels:
workflows.argoproj.io/controller-instanceid: 86a4f130-d99b-4e91-b34b-8f9eee22cb63
spec:
arguments:
parameters:
Expand Down

0 comments on commit d0229fe

Please sign in to comment.