Context
As a developer with a full bazel-ified monorepo (code and manifest generation together) it would have developer easier to have skaffold support rendering YAML from bazel directly.
Currently I work around this with by adding as many hooks to build the manifests as a I can to ensure they're up-to-date before the rawYaml renderer goes over them:
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: k8s
build:
tagPolicy:
gitCommit:
variant: CommitSha
local:
useDockerCLI: false
useBuildkit: true
concurrency: 0
artifacts:
- image: service
bazel:
target: //go/cmd/service:container-tarball.tar
platforms:
- platform: linux/amd64
target: //build/platforms:linux_amd64
- platform: linux/arm64
target: //build/platforms:linux_arm64
hooks:
after:
- command: ['bazel', 'build', '--remote_download_toplevel', '//manifests/local/service', '//manifests/local:local-namespaces-manifests']
os: [darwin, linux]
manifests:
rawYaml:
- '../../../../build/bazel-out/darwin_arm64-fastbuild/bin/manifests/local/namespaces-manifests/*'
- '../../../../build/bazel-out/darwin_arm64-fastbuild/bin/manifests/local/service/manifests/*'
deploy:
kubectl:
hooks:
before:
- host:
command: ['bazel', 'build', '--remote_download_toplevel', '//manifests/local/service', '//manifests/local:local-namespaces-manifests']
os: [darwin, linux]
However this is unstable with needing to manage the directory traversal & build options (darwin_arm64-fastbuild) so this config ends up not being portable between machines.
Feature Request
To support a renderer which takes a bazel target that outputs a directory (TreeArtifact) or a single YAML file then do the same processing as rawYaml over the file.
An example edit from the above config:
apiVersion: skaffold/v4beta13
kind: Config
metadata:
name: k8s
build:
tagPolicy:
gitCommit:
variant: CommitSha
local:
useDockerCLI: false
useBuildkit: true
concurrency: 0
artifacts:
- image: service
bazel:
target: //go/cmd/service:container-tarball.tar
platforms:
- platform: linux/amd64
target: //build/platforms:linux_amd64
- platform: linux/arm64
target: //build/platforms:linux_arm64
manifests:
bazel:
targets:
- '//manifests/local:local-namespaces-manifests'
- '//manifests/local/service'
deploy:
kubectl: {}
The //manifests/local:local-namespaces-manifests and //manifests/local/service targets are produced by rules_jsonnet's jsonnet_to_json as a single file & directory respectfully.
Context
As a developer with a full bazel-ified monorepo (code and manifest generation together) it would have developer easier to have skaffold support rendering YAML from bazel directly.
Currently I work around this with by adding as many hooks to build the manifests as a I can to ensure they're up-to-date before the
rawYamlrenderer goes over them:However this is unstable with needing to manage the directory traversal & build options (
darwin_arm64-fastbuild) so this config ends up not being portable between machines.Feature Request
To support a renderer which takes a bazel target that outputs a directory (
TreeArtifact) or a single YAML file then do the same processing asrawYamlover the file.An example edit from the above config:
The
//manifests/local:local-namespaces-manifestsand//manifests/local/servicetargets are produced byrules_jsonnet'sjsonnet_to_jsonas a single file & directory respectfully.