Skip to content

Exception thrown when using a file-based pod template #551

@cdavernas

Description

@cdavernas

I tried this:

Configured the operator to load the Kubernetes pod template to use from a YAML file, thanks to the SYNAPSE_RUNTIME_K8S_POD environment variable.

Here's the pod template:

metadata: {}
spec:
  containers:
    - image: ghcr.io/serverlessworkflow/synapse/runner:1.0.0-alpha5.19
      imagePullPolicy: IfNotPresent
      name: runner
      ports:
        - containerPort: 8080
          name: http
          protocol: TCP
  restartPolicy: Never

This happened:

An exception is thrown, indicating that the pod template is invalid.

Here are the related logs:

[08:23:31] fail: Synapse.Runtime.Kubernetes.Services.KubernetesRuntime[0]
      An error occurred while creating a new Kubernetes process for workflow instance 'form-package-deploy-f2252b913a64.default': System.InvalidOperationException: The configured Kubernetes runtime pod template is not valid
         at Synapse.Runtime.Kubernetes.Services.KubernetesRuntime.CreateProcessAsync(Workflow workflow, WorkflowInstance workflowInstance, ServiceAccount serviceAccount, CancellationToken cancellationToken) in /src/src/runtime/Synapse.Runtime.Kubernetes/Services/KubernetesRuntime.cs:line 94
[08:23:31] fail: Synapse.Operator.Services.WorkflowInstanceController[0]
      An error occurred while handling the creation of workflow instance 'form-package-deploy-f2252b913a64.default': System.InvalidOperationException: The configured Kubernetes runtime pod template is not valid
         at Synapse.Runtime.Kubernetes.Services.KubernetesRuntime.CreateProcessAsync(Workflow workflow, WorkflowInstance workflowInstance, ServiceAccount serviceAccount, CancellationToken cancellationToken) in /src/src/runtime/Synapse.Runtime.Kubernetes/Services/KubernetesRuntime.cs:line 94
         at Synapse.Operator.Services.WorkflowInstanceHandler.StartProcessAsync(CancellationToken cancellationToken) in /src/src/operator/Synapse.Operator/Services/WorkflowInstanceHandler.cs:line 137
         at Synapse.Operator.Services.WorkflowInstanceHandler.HandleAsync(CancellationToken cancellationToken) in /src/src/operator/Synapse.Operator/Services/WorkflowInstanceHandler.cs:line 123
         at Synapse.Operator.Services.WorkflowInstanceController.OnResourceCreatedAsync(WorkflowInstance workflowInstance, CancellationToken cancellationToken) in /src/src/operator/Synapse.Operator/Services/WorkflowInstanceController.cs:line 223

After verification, the issue occurs because the V1PodTemplate is not marked with the expected YAML attributes, thus property name resolution fails.

This can be solved by using the KubernetesYaml helper class to deserialize the V1PodTemplate.

I expected this:

The defined pod template to be successfully used by the operator.

Is there a workaround?

No response

Anything else?

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.name: Bug Report 🐞

Metadata

Metadata

Assignees

Labels

app: operatorConcerns the Operatorpriority: highIndicates a high priority issuetype: bugSomething isn't workingweight: 2An issue with a low development impact

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions