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/