1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Argo Workflow]MyDNS更新用ジョブ定義

Last updated at Posted at 2022-03-15

Jenkinsから移行中

Mydnsログイン情報をSecretとして作成

kubectl create secret generic -n argo mydns --from-literal=username=(mydnsユーザー名) --from-literal=password=(mydnsパスワード)

Mydnsワークフロー定義

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: mydns-update-
spec:
  entrypoint: mydns
  templates:
  - name: mydns
    dag:
      tasks:
      - name: mydns-update
        template: wget

  - name: wget
    container:
      image: alpine:3.7
      command: [sh, -c]
      args: ['
        wget -O- "http://$MYDNSUSERNAME:$MYDNSPASSWORD@www.mydns.jp/login.html";
      ']
      env:
      - name: MYDNSUSERNAME
        valueFrom:
          secretKeyRef:
            name: mydns
            key: username
      - name: MYDNSPASSWORD
        valueFrom:
          secretKeyRef:
            name: mydns
            key: password

ジョブ実行結果

argo submit -n argo --watch mydns.yaml
Name:                mydns-update-5rsv2
Namespace:           argo
ServiceAccount:      default
Status:              Running
Created:             Tue Mar 15 19:31:33 +0000 (2 seconds ago)
Started:             Tue Mar 15 19:31:33 +0000 (2 seconds ago)
Duration:            2 seconds
Progress:            0/1

STEP                   TEMPLATE  PODNAME                        DURATION  MESSAGE
 ● mydns-update-5rsv2  mydns                                                
 └─◷ mydns-update      wget      mydns-update-5rsv2-1870706736  2s          

This workflow does not have security context set. You can run your workflow pods more securely by setting it.
Learn more at https://argoproj.github.io/argo-workflows/workflow-pod-security-context/

image.png

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?