Skip to main content

Posts

Showing posts with the label YAML

How to Fix Modelfile YAML Errors During Ollama Custom Model Creation

  When you build local AI models using Ollama, defining custom behavior requires creating a   Modelfile . However, developers frequently encounter a hard parsing failure during the build step:   command must be one of from, license, template... . This specific error halts your pipeline and prevents the model from compiling. It occurs due to improper multiline string formatting or incorrect YAML indentation when embedding Modelfiles into infrastructure-as-code (IaC) or configuration files. Here is the technical breakdown of why the Ollama lexer fails, along with the precise fixes required to resolve the syntax errors. The Root Cause of the Syntax Error Ollama parses the  Modelfile  using a strict line-by-line evaluator. The parser expects every new logical line to begin with a reserved instruction keyword (e.g.,  FROM ,  SYSTEM ,  PARAMETER ,  TEMPLATE ). During custom LLM agent creation, developers inject complex system prompts and few-shot e...

Fixing Kubernetes Namespaces Stuck in 'Terminating' State

  Few things in Kubernetes administration are as universally frustrating as a namespace that refuses to die. You run   kubectl delete namespace <name> , and the terminal hangs. You check the status, and it sits in   Terminating . You wait an hour, come back, and it is still   Terminating . This "zombie namespace" issue is a rite of passage for DevOps engineers. While it is tempting to look for a "force delete" flag, Kubernetes does not provide a native  --force  flag for namespaces that works the way it does for Pods. This guide explores why namespaces get stuck, the architectural mechanics of  Finalizers , and the definitive, step-by-step method to manually purge the stuck namespace using the Kubernetes API. The Root Cause: Understanding Finalizers To fix the problem, we must first understand the mechanism blocking the deletion. Kubernetes uses a concept called  Finalizers  to manage the lifecycle of resources. When you issue a delete ...