docs: Add docs for Argo Workflow controller-instanceid label (#290) (#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 <thihaminthant20@gmail.com>
This commit is contained in:
Thiha Min Thant 2024-10-05 13:13:53 +08:00 committed by GitHub
parent d25b7fcd62
commit d0229fea18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 82 additions and 20 deletions

View File

@ -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`. Heres 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?

View File

@ -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
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
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
@ -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:

View File

@ -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`. Heres 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?

View File

@ -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
- name: install-chaos-experiments
inputs:
artifacts:
- name: pod-delete
path: /tmp/pod-delete.yaml
raw:
data: >
apiVersion: litmuschaos.io/v1alpha1
description:
message: |...
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
@ -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: