nulecule icon indicating copy to clipboard operation
nulecule copied to clipboard

Proposal: Mechanism for binding unbound variables in Kubernetes templates

Open markllama opened this issue 10 years ago • 0 comments

Nulecule needs a standardized mechanism for replacing unbound variables in the Kubernetes data structure templates which define a complex application in Kuberentes.

This proposal offers a suggestion for both the mechanics of inserting variables into the Kubernetes templates and for a way for Nulecule developers to indicate to application consumers what variables remain unbound and must be resolved to run a Nulecule.

Discussion points

  • Re-usable container images generally require some inputs (variables) which can be unique to each instance.
  • Kubernetes Container and Container Template data structures can provide these through environment variables and other means.
  • Kubernetes and Nulecule service developers will provide values for these variables in the Kubernetes YAML/JSON data structures when creating Kubernetes services, pods, replication controllers.

Suggestion

JSON and YAML components can be described and accessed using an XPATH formed string. When creating a Kubernetes template, any unresolved variables will be specified in a separate section in the Nulecule file. Each variable specification will consist of an ID or key and a llst of XPATH strings for the placement of the needed value in the matching JSON/YAML templates.

This offers two benefits:

  • The consumer of the Nulecule as a single location to look for the set of unbound variables which must be satisfied for the application to deploy and run.
  • The implementation can use a standard notation and mechanism for resolving and binding the variables when the application is instantiated.

Additional Discussion

What remains is to define the specification for how the variable/path sets will be provided in the Nulecule files and how they will be mechanically resolved at run-time.

Additional comments encouraged.

markllama avatar May 15 '15 15:05 markllama