Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Argo入門/Getting Started with Argo

watawuwu
June 01, 2018

Argo入門/Getting Started with Argo

watawuwu

June 01, 2018
Tweet

More Decks by watawuwu

Other Decks in Technology

Transcript

  1. Agenda ⊸ What’s Argo ⊸ What’s Workflow Engine ⊸ Why

    use Argo ⊸ Argo projects ▫ Argo Workflows ▫ Argo CD/Argo Events ⊸ Conclusions
  2. Workflow engines mainly have three functions • Verification of the

    current status • Determine the authority of users • Executing condition script By Wikipedia
  3. Argo projects • Argo Workflows(Stable) • Argo CI(Not active?) •

    Argo CD(Early development) • Argo Events(Planning)
  4. Installing Argo v2.1.0 into namespace 'kube-system' Proceeding with Kubernetes version

    1.9.6 CustomResourceDefinition 'workflows.argoproj.io' created ServiceAccount 'argo' created ClusterRole 'argo-cluster-role' created ClusterRoleBinding 'argo-binding' created Deployment 'workflow-controller' created ServiceAccount 'argo-ui' created ClusterRole 'argo-ui-cluster-role' created ClusterRoleBinding 'argo-ui-binding' created Deployment 'argo-ui' created Service 'argo-ui' created Install Argo
  5. Configuration workflow apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: hello-world- spec:

    entrypoint: hello templates: - name: hello container: image: docker/whalesay:latest command: [cowsay] args: ["hello world"]
  6. templates: - name: hello inputs: parameters: - name: message container:

    image: docker/whalesay:latest command: [cowsay] args: ["{{inputs.parameters.message}}"] Args parameter
  7. entrypoint: step-run templates - name: container-run container: { image: alpine

    } - name: step-run steps: - - name: step-A template: container-run - - name: step-B template: container-run Steps
  8. entrypoint: step-run templates: - name: container-run container: { image: alpine

    } - name: step-run steps: - - name: step-A template: container-run - - name: step-B template: container-run - name: step-C template: container-run Parallel
  9. entrypoint: dag-run templates: - name: container-run container: { image: alpine

    } - name: dag-run dag: tasks: - name: dag-A template: container-run - name: dag-B template: container-run dependencies: [dag-A] - name: dag-C template: container-run dependencies: [dag-A] DAG 1 2a 2b
  10. entrypoint: pwd-ls templates: - name: pwd-ls script: image: debian:9.4 command:

    [bash] source: | pwd ls entrypoint: container-ls templates: - name: container-ls container: image: debian:9.4 command: [bash] args: - -c - | pwd ls Script bash
  11. templates: - name: random script: image: python:alpine3.6 command: [python] source:

    | import random i = random.randint(1, 100) print(i) templates: - name: random script: image: node:9.1-alpine command: [node] source: | var rand = Math.floor(Math.random() * 100); console.log(rand); Script
  12. apiVersion: v1 kind: Secret metadata: name: my-secret type: Opaque data:

    # 1f2d1e2e67df my-password: MWYyZDFlMmU2N2Rm Secret K8S側のSecretマニフェスト
  13. entrypoint: whalesay volumes: - name: my-secret-vol secret: secretName: my-secret templates:

    - name: whalesay container: image: alpine:3.7 command: [sh, -c] args: ['echo "secret from file: `cat /secret/mountpath/my-password`"'] volumeMounts: - name: my-secret-vol mountPath: "/secret/mountpath" Secret from volume K8S側のSecretの名前
  14. templates: - name: whalesay container: image: alpine:3.7 command: [sh, -c]

    args: ['echo "secret from env: $PASS";'] env: - name: PASS valueFrom: secretKeyRef: name: my-secret key: my-password Secret from env K8S側のSecretの名前
  15. Other • Data sharing between job • Loops • Conditions

    • Recursion • Exit handlers • Timeouts • Daemon container • Sidecar • Artifacts(S3, HTTP, Git) • Kubernetes resource • Docker in Docker
  16. Argo projects state • Argo Workflows • Argo CI •

    Argo CD • Argo Events HOLD Trial ASSESS HOLD