billions-sundown-65740
06/25/2025, 2:44 PMhelm_deployment
target. I have added the docker_image target to the values
in the `helm_deployment`as described in the documentation. When I add the target explicitly as a dependency pants will build the docker image but it will not replace the image with the actually image (pants seems to treat it as a normal string)
helm_chart(
name = 'test',
)
helm_deployment(
name = 'test-preview',
chart = ':test',
sources = [
'values.yaml',
'values.preview.yaml',
],
values = {"test-loader.image": "load/test:test_docker"},
namespace= 'test-preview',
)
load/test/BUILD
docker_image(
name="test_docker",
build_platform=["linux/amd64"],
image_tags=["1.0", "latest"],
)
billions-sundown-65740
06/25/2025, 3:27 PMbillions-sundown-65740
06/25/2025, 3:44 PMbillions-sundown-65740
06/25/2025, 3:46 PMbillions-sundown-65740
06/25/2025, 3:56 PM---
apiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
chart: "test"
spec:
containers:
- name: my-app
# Uses the `image` value entry from the deployment inputs
image: {{ index .Values "test-loader" "image" }}
This does not work:
---
apiVersion: <http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>
kind: CronWorkflow
metadata:
name: my-pod
labels:
chart: "test"
spec:
containers:
- name: my-app
# Uses the `image` value entry from the deployment inputs
image: {{ index .Values "test-loader" "image" }}
breezy-twilight-65275
06/25/2025, 4:05 PMRuntimeError
when it finds a K8S manifest for an`
# API version and kind that doesn't understand.
Did you try explicitly adding your images to the dependencies
field of the helm_deployment
target?billions-sundown-65740
06/25/2025, 5:28 PMdependencies
field of the helm_deployment
target. Pants knows than to build the docker images but unfortunately it will still not be added to the kubernetes deploymentbillions-sundown-65740
06/25/2025, 5:32 PMCreate Custom Resource Definitions
As of release 1.0.0, Hikaru supports the creation of CRDs that integrate with the rest of Hikaru. Automatically generate schema from a Hikaru class, define CRDs to Kubernetes, manage CRD instances with CRUD methods, and create watchers that allow you to build your own controllers for your CRDs.
billions-sundown-65740
06/26/2025, 2:51 PMk8s_parser_main.py
and it is able to infer the dependencies and render the helm charts correctly.
from hikaru.model.rel_1_28.v1 import *
from hikaru import (HikaruBase, HikaruDocumentBase,
set_default_release)
from hikaru.crd import register_crd_class, HikaruCRDDocumentMixin
from typing import Optional, List
from dataclasses import dataclass
set_default_release("rel_1_28")
plural = "myplatforms"
@dataclass
class ContainersSpec(Container):
name: Optional[str]
@dataclass
class TemplatesSpec(HikaruBase):
name: str
container: Optional[ContainersSpec]
@dataclass
class WorkflowSpec(HikaruBase):
templates: List[TemplatesSpec]
@dataclass
class MyPlatformSpec(HikaruBase):
workflowSpec: WorkflowSpec
@dataclass
class MyPlatform(HikaruDocumentBase, HikaruCRDDocumentMixin):
metadata: ObjectMeta
apiVersion: str = f"<http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>"
kind: str = "CronWorkflow"
spec: Optional[MyPlatformSpec] = None
register_crd_class(MyPlatform, plural, is_namespaced=False)