Created
October 14, 2024 17:59
-
-
Save fleeto/7c70b58a6ee7bdb93494f94f77db7c20 to your computer and use it in GitHub Desktop.
operate huaweiyun with koocli + argo workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: oh-my-ecs- | |
spec: | |
serviceAccountName: argo | |
entrypoint: print-ecs | |
arguments: | |
parameters: | |
- name: ak | |
value: "AKAKAK" | |
- name: sk | |
value: "SKSKSSK" | |
- name: region | |
value: "cn-north-4" | |
templates: | |
- name: print-ecs | |
steps: | |
- - name: list | |
template: list-ecs | |
- - name: echo | |
template: print-message | |
arguments: | |
parameters: | |
- name: message | |
value: "{{item.id}}" | |
withParam: "{{=toJSON(jsonpath(steps.list.outputs.result, '$.servers'))}}" | |
- name: list-ecs | |
container: | |
image: dustise/koocli:v0.0.2 | |
command: | |
- hcloud | |
args: | |
- ECS | |
- ListCloudServers | |
- --cli-region={{workflow.parameters.region}} | |
- --cli-access-key={{workflow.parameters.ak}} | |
- --cli-secret-key={{workflow.parameters.sk}} | |
- name: print-message | |
inputs: | |
parameters: | |
- name: message | |
container: | |
image: busybox:1.37.0-glibc | |
command: [echo] | |
args: ["{{inputs.parameters.message}}"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment