Skip to content

Instantly share code, notes, and snippets.

@fleeto
Created October 14, 2024 17:59
Show Gist options
  • Save fleeto/7c70b58a6ee7bdb93494f94f77db7c20 to your computer and use it in GitHub Desktop.
Save fleeto/7c70b58a6ee7bdb93494f94f77db7c20 to your computer and use it in GitHub Desktop.
operate huaweiyun with koocli + argo workflow
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