Giter VIP home page Giter VIP logo

Comments (9)

ensonic avatar ensonic commented on May 23, 2024

This would be useful for other projects too, see:
https://github.com/istio/istio/blob/HEAD/install/updateVersion.sh and https://github.com/istio/istio/tree/HEAD/install/kubernetes/templates

from rules_k8s.

mattmoor avatar mattmoor commented on May 23, 2024

I had this in my initial prototype and specifically avoided it because templating is a hot topic of debate in the K8s space right now.

I would much rather see this solved by templating rules that compose with (or even wrap) these rules. rules_jsonnet is an option, but without this may be of limited use.

from rules_k8s.

mattmoor avatar mattmoor commented on May 23, 2024

I'm going to close this for now, but happy to continue the discussion. If specific items fall out of further discussion, let's open more bugs. WDYT?

from rules_k8s.

ensonic avatar ensonic commented on May 23, 2024

It is mostly a question of what the purpose of the k8s rules is. if it is to configure the k8s templates for the given build, then we should look for a templating solution as part of it. I have an idea that I will try today and keep you posted.

from rules_k8s.

mattmoor avatar mattmoor commented on May 23, 2024

At this point I would say: mostly development.

I want folks to be able to build/push/deploy in a tight cycle, and for that Bazel needs to be able to model the dependencies of the K8s resources.

There is possibility for involving this in a release process to "freeze" templates via something like:

bazel run :everything > release.yaml

(I use that here)

I agree that templating is often the next thing folks will want, but the DSL wars for K8s are just getting started, so my goal is for rules_k8s to compose with things like rules_jsonnet vs. embed very limited templating (as my original prototype did).

You can see some of the original discussion on this here.

from rules_k8s.

mattmoor avatar mattmoor commented on May 23, 2024

@ensonic ... and yes, keep me posted (but I'm OOTO starting tonight).

from rules_k8s.

ensonic avatar ensonic commented on May 23, 2024

The problem with bazel run :everything > release.yaml is that this assumes all those things are safe to run. We have a build with all kind of things, tools, services, .... For some targets 'run' would actually run a binary. So conceptually we want to build everything and for the k8s rules that would mean to resolve the yaml files.

from rules_k8s.

mattmoor avatar mattmoor commented on May 23, 2024

For some targets 'run' would actually run a binary

bazel run on k8s_object[s] just publishes the images and prints the resolved template to stdout. It should not run any binaries. We do this on bazel run because publishing is non-hermetic, and neither is accessing your credential keyring.

from rules_k8s.

skyl avatar skyl commented on May 23, 2024

is there a way to use a list or object in the template?

from rules_k8s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.