无法将argo工作流cron安装为舵图



我想安装一个argo工作流模板和工作流cron作业作为一个helm chart。Helm install命令表示已安装图表。但是我看到只有工作流模板被部署了,而cron job没有。

文件夹结构:

Argo_helm
|- templates
|-azure-migration-cron-etl.yaml
|-azure-migration-etl-template.yaml
|-Chart.yaml
|-values.yaml

当执行helm install命令时,我看到如下所示

helm upgrade --install argo-helm-charts --values values.yaml . 
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /Users/e192270/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /Users/e192270/.kube/config
Release "argo-helm-charts" does not exist. Installing it now.
NAME: argo-helm-charts
LAST DEPLOYED: Mon Feb  8 11:28:01 2021
NAMESPACE: argo
STATUS: deployed
REVISION: 1
TEST SUITE: None

当我列出模板时,我可以看到它

$ argo template list   
                                         
NAME
test-azure-migration

,不能查看作为图表

的一部分安装的cron
argo cron list -n argo 
NAME              AGE   LAST RUN   NEXT RUN   SCHEDULE      SUSPENDED

==========================================================================

cron code (azure-migration-cron-etl.yaml)

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: {{ .Values.workflow_name }}
namespace: {{ .Values.workflow_namespace }}
labels:
workflows.argoproj.io/controller-instanceid: fp
spec:
schedule: "0 1 * * *"
timezone: "America/Chicago"
workflowSpec:
entrypoint: sparkdatabricks-app
metrics:
prometheus:
- name: dim_bud_etl_duration
labels:
- key: team
value: foundational-projects-data-eng
help: "Duration of dim_bud etl"
gauge:
value: "{{`{{workflow.duration}}`}}"
serviceAccountName: argo-s3-service-account
volumes:
- name: bearer-token
secret:
secretName: databricks-bearer-token-ophie
templates:
- name: sparkdatabricks-app
steps:
- - name: create-databricks-cluster
templateRef:
name:  azure-migration-template
template: databricks-api
arguments:
parameters:
- name: databricks-api-command
........
.......

模板代码(azure-migration-etl-template.yaml)

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: {{ .Values.workflow_template_name}}
namespace: argo
spec:
entrypoint: databricks-api
serviceAccountName: fp-argo-workflow
arguments:
parameters:
- name: databricks-api-command
value: ""
templates:
- name: databricks-api
inputs:
parameters:
- name: databricks-api-command
container:
image: basic-ubuntu:1.0.0
imagePullPolicy: Always
command: [sh,-c]
args: [{{`"{{inputs.parameters.databricks-api-command}}"`}}]
env:
- name: BEARER
valueFrom:
secretKeyRef:
name: databricks-bearer-token-ophie
key: bearer
- name: ACCOUNT
valueFrom:
secretKeyRef:
name: databricks-bearer-token-ophie
key: account
volumeMounts:
- name: bearer-token
mountPath: "/secret/mountpath"
outputs:
parameters:
- name: id       # can be any id depends on what databricks api call it is
valueFrom:
path: /tmp/info.txt

values.yaml

workflow_name: v-dim-bud-test
workflow_namespace: argo
workflow_template_name: test-azure-migration

Argo允许您通过添加多个工作流控制器来垂直缩放。每个控制器都有一个"实例ID"。

您的CronWorkflow指定fp工作流控制器实例。

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: {{ .Values.workflow_name }}
namespace: {{ .Values.workflow_namespace }}
labels:
workflows.argoproj.io/controller-instanceid: fp

要列出由fp工作流控制器实例管理的CronWorkflows,使用--instanceid参数:

$ argo cron list -n argo --instanceid fp
NAME             AGE   LAST RUN   NEXT RUN   SCHEDULE    SUSPENDED
v-dim-bud-test   3m    N/A        12h        0 1 * * *   false

最新更新