This is a minor release with one bugfix and one minor feature.
- process: With 0.11.0, tanka started automatically adding namespaces to all manifests it processed. We updated this to not add a namespace to cluster-wide object types in order to make handling of these resources more consistent in different workflows. (#320)
- export: Fix inverted logic while checking if a file already exists. This broke
tk export
entirely. (#317)
2 months later and here we are with another release! Packed with many detail-improvements, this is what we want to highlight:
From now on, Tanka handles the resources it extracts from your Jsonnet output in an enhanced way:
- Lists: Contents of lists, such as
RoleBindingList
are automatically flattened into the resource stream Tanka works with. This makes sure they are properly labeled for garbage collection, etc. - Default namespaces: While you could always define the default namespace
(the one for resources without an explicit one) in
spec.json
, this information is now also persisted into the YAML returned bytk show
andtk export
. See https://tanka.dev/namespaces for more information.
tk export
can now do even more than just writing YAML files to disk:
--extension
can be used to control the file-extension (defaults to.yaml
)- When you put a
/
in your--format
for the filename, Tanka creates a directory or you. This allows e.g. sorting by namespace:--format='{{.metadata.namespace}}/{{.kind}}-{{.metadata.name}}'
- Using
--merge
, you can export multiple environments into the same directory tree, so you get the full YAML picture of your entire cluster!
The tk env list
command now has a --names
option making it easy to operate on multiple environments:
# diff all environments:
for e in $(tk env list --names); do
tk diff $e;
done
Also, to use a more granular subset of your environments, you can now use
--selector
/ -l
to match against metadata.labels
of defined in your
spec.json
:
$ tk env list -l status=dev
- cli:
tk env list
now supports label selectors, similar tokubectl get -l
(#295) - cli: If
spec.apiServer
ofspec.json
lacks a protocol, it now defaults tohttps
(#289) - cli:
tk delete
command to teardown environments (#313)
- cli: Support different file-extensions than
.yaml
fortk export
(#294) (@marthjod) - cli: Support creating sub-directories in
tk export
(#300) (@simonfrey) - cli: Allow writing into existing folders during
tk export
(#314)
- process:
List
types are now unwrapped by Tanka itself (#306) - process: Automatically set
metadata.namespace
to the value ofspec.namespace
if not set from Jsonnet (#312)
- jsonnet: Using
import "tk"
twice no longer panics (#290) - tooling:
tk tool imports
no longer gets stuck when imports are recursive (#298) - process: Fully deterministic recursion, so that error messages are consistent (#307)
New month, new release! And this one ships with a long awaited feature:
Tanka can finally clean up behind itself. By optionally attaching a
tanka.dev/environment
label to each resource it creates, we can find these
afterwards and purge those removed from the Jsonnet code. No more dangling
resources!
⚠️ Keep in mind this is still experimental!
To get started, enable labeling in your environment's spec.json
:
"spec": {
+ "injectLabels": true,
}
Don't forget to tk apply
afterwards! From now on, Tanka can clean up using tk prune
.
Docs: https://tanka.dev/garbage-collection
Tanka now has it's very own logo, and here it is:
Tanka is now present in some package managers, notably brew
for macOS and the
AUR of ArchLinux! See the updated install
instructions to
make sure to use these if possible.
- cli:
TANKA_JB_PATH
environment variable introduced to set thejb
binary if required (#272). Thanks @qckzr
- kubernetes: Garbage collection (#251)
- kubernetes: Resource sorting is now deterministic (#259)
Mini-release to fix an issue with our Makefile (required for packaging). No changes in functionality.
- build: Enable
static
Makefile target on all operating systems (#262)
Small patch release to fix a panic
issue with tk apply
.
- kubernetes: don't panic on failed diff (#256)
This release includes a critical fix, update ASAP.
Another Tanka release is here, just in time for Easter. Enjoy the built-in formatter, much more intelligent apply and several important bug fixes.
The recently released kubectl
version v1.18.0
includes a critical issue
that causes kubectl diff
(and so tk diff
as well) to apply the changes.
This can be very harmful, so Tanka decided to require you to downgrade
to v1.17.x
, until the fix in kubectl
version v1.18.1
is released.
- Upstream issue: kubernetes/kubernetes#89762)
- Unreleased fix: kubernetes/kubernetes#89795
Since jsonnetfmt
was rewritten in Go
recently, Tanka now ships it as
tk fmt
. Just run tk fmt .
to keep all Jsonnet files recursively formatted.
When using tk apply
, Tanka now automatically sorts your objects
based on dependencies between them, so that for example
CustomResourceDefinitions
created before being used, all in the same run. No
more partly failed applies!
- kubernetes ✨: Objects are now sorted by dependency before
apply
(#244) - cli: Env var
TANKA_KUBECTL_PATH
can now be used to set a customkubectl
binary (#221) - jsonnet ✨ : Bundle
jsonnetfmt
astk fmt
(#241)
- docker: The Docker image now includes GNU
less
, instead of the BusyBox one (#232) - docker: Added
kubectl
,jsonnet-bundler
,coreutils
,git
anddiffutils
to the Docker image, so Tanka can be fully used in there. (#243)
- cli: The diff shown on
tk apply
is now colored again (#216)
- client: The namespace patch file saved to a temporary location is now removed after run (#225)
- client: Scanning for the correct context won't panic anymore, but print a proper error (#228)
- client: Use
os.PathListSeparator
during context patching, so that Tanka also works on non-UNIX platforms (e.g. Windows) (#242)
- kubernetes 🚨: Refuse to diff on
kubectl
versionv1.18.0
, because of above mentioned unfixed issue (#254) - kubernetes: Apply no longer aborts when diff fails (#231)
- kubernetes ✨: Namespaces that will be created in the same run are now
properly handled during
diff
(#237)
- cli: Migrates from
spf13/cobra
to much smallergo-clix/cli
. This cuts our dependencies to a minimum. (#235)
The next big one is here! Feature packed with environment overriding and tk export
. Furthermore lots of bugs were fixed, so using Tanka should be much
smoother now!
Highlight: Overriding vendor
per Environment (#198)
It is now possible, to have a vendor/
directory managed by jb
on an
environment basis: https://tanka.dev/libraries/overriding. This means you can
test out changes in libraries in single environments (like dev
), without
affecting others (like prod
).
Changes done in the last release (v0.7.1) can cause indentation changes when
using std.manifestYAMLFromJSON()
, related to bumping gopkg.in/yaml.v2
to
gopkg.in/yaml.v3
.
Please encourage all your teammembers to upgrade to at least v0.7.1 to avoid
whitespace-only diffs on your projects.
- cli:
tk export
can be used to write all generated Kubernetes resources to.yaml
files
- kubernetes: Fail on
diff
whenkubectl
had an internal error (#213) - kubernetes: Stop injecting namespaces into wrong places:
Tanka was injecting the default namespace into resources of all kinds, regardless of whether they actually took one. This caused errors, so we stopped doing this. From now on, the default namespace will only be injected when the resource is actually namespaced. (#208)
- cli:
tk diff
colors:
Before, the coloring was unstable when scrolling up and down. We fixed this by pressing CAPS-LOCK.
Furthermore, the output oftk diff
now also works on light color schemes, without messing up the background color. (#210) - cli: Proper
--version
output:
The release binaries now show the real semver ontk --version
, instead of the git commit sha. (#201) - cli: Print diff on apply again:
While refactoring, we accidentally forgot to dereference a pointer, so thattk apply
showed a memory address instead of the actual differences, which was kinda pointless. (#200)
This is a smaller release focused on critical bug fixes and some other minor enhancements. While features are included, none of them are significant, meaning they are part of a patch release.
Before, std.native('parseYaml')
did not work at all, a line of code got lost
during merge/rebase, resulting in parseYaml
returning invalid data, that
Jsonnet could not process. This issue has been fixed in
(#195).
The built-in Jsonnet compiler has been upgraded to the lastest master
07fa4c0
.
In some cases, this should provide up to 50% more speed, especially when
base64
is involved, which is now natively implemented.
(#196)
- cli:
tk env set|add
has been extended by--server-from-context
, which allows to parse$KUBECONFIG
to find the apiServer's IP directly from that file, instead of having to manually specify it by hand. (#184) - jsonnet:
vendor
overrides:
It is now possible to have avendor/
directory per environment, so that updating upstream libraries can be done gradually. (#185) - kubernetes: disable
kubectl
validation:tk apply
now takes--validate=false
to pass that exact flag tokubectl
as well, for disabling the integrated schema validation. (#186)
- jsonnet, cli: Stable environment name: The value of
(import "tk").env.name
does not anymore depend on how Tanka was invoked, but will always be the relative path from<rootDir>
to the environment's directory. (#182) - jsonnet: The nativeFunc
parseYaml
has been fixed to actually return a valid result (#195)
The promised big update is here! In the last couple of weeks a lot has happened.
Grafana Labs announced Tanka to the public, and the project got a lot of positive feedback, shown both on HackerNews and in a 500+ increase in GitHub stars!
While we do not ship big new features this time, we ironed out many annoyances and made the overall experience a lot better:
Better website + tutorial (#134)
Our new website is published! It does not only look super sleek and performs like a supercar, we also revisited (and rewrote) the most of the content, to provide especially new users a good experience.
This especially includes the new tutorial, which gives new and probably even more experienced users a good insight into how Tanka is meant to be used.
🚨🚨 Disabling import ".yaml"
(#176) 🚨🚨
Unfortunately, we had to disable the feature that allowed to directly import
YAML files using the familiar import
syntax, introduced in v0.6.0, because it
caused serious issues with importstr
, which became unusable.
While our extensions to the Jsonnet language are cool, it is a no-brainer that
compatibility with upstream Jsonnet is more important. We will work with the
maintainers of Jsonnet to find a solution to enable both, importstr
and
import ".yaml"
Workaround:
- import "foo.yaml"
+ std.parseYaml(importstr "foo.yaml")
k.libsonnet
installation (#140)
Previously, installing k.libsonnet
was no fun. While the library is required
for nearly every Tanka project, it was not possible to install it properly using
jb
, manual work was required.
From now on, Tanka automatically takes care of this. A regular tk init
installs everything you need. In case you prefer another solution, disable this
new thing using tk init --k8s=false
.
- cli, kubernetes:
k.libsonnet
is now automatically installed ontk init
(#140):
Before, installingk.libsonnet
was a time consuming manual task. Tanka now takes care of this, as long asjb
is present on the$PATH
. See https://tanka.dev/tutorial/k-lib#klibsonnet for more details. - cli:
tk env --server-from-context
:
This new flag allows to infer the cluster IP from an already set upkubectl
context. No need to remember IP's anymore – and they are even autocompleted on the shell. (#145) - cli, jsonnet: extCode, extVar:
-e
/--extCode
and--extVar
allow usingstd.extVar()
in Tanka as well. In general,-e
is the flag to use, because it correctly handles all Jsonnet types (string, int, bool). Strings need quoting! (#178)
- jsonnet: The contents of
spec.json
are now accessible from Jsonnet using(import "tk").env
. (#163) - jsonnet: Lists (
[ ]
) are now fully supported, at an arbitrary level of nesting! (#166)
- jsonnet:
nil
values are ignored from the output. This allows to disable objects using theif ... then {}
pattern, which returns nil iffalse
(#162). - cli:
-t
/--target
is now case-insensitive (#130)
First release of the new year! This one is a quick patch that lived on master
for some time, fixing an issue with the recent "missing namespaces" enhancement
leading to apply
being impossible when no namespace is included in Jsonnet.
More to come soon :D
It has been quite some time since the last release during which Tanka has become much more mature, especially regarding the code quality and structure.
Furthermore, Tanka has just hit the 100 Stars 🎉
Notable changes include:
API (#97)
The most notable change is probably the Go API, available at
https://godoc.org/github.com/grafana/tanka/pkg/tanka
, which allows to use all
features of Tanka directly from any other Golang application, without needing to
exec the binary. The API is inspired by the command line parameters and should
feel very similar.
Importing YAML (#106)
It is now possible to import .yaml
documents directly from Jsonnet. Just use
the familiar syntax import "foo.yaml"
like you would with JSON.
Missing Namespaces (#120)
Tanka now handles namespaces that are not yet created, in a more user friendly
way than `kubectl** does natively.
During diff, all objects of an in-existent namespace are shown as new and when
applying, namespaces are applied first to allow applying in a single step.
- tool/imports: import analysis using upstream jsonnet: Due to recent changes to google/jsonnet, we can now use the upstream compiler for static import analysis (#84)
- Array output: The output of Jsonnet may now be an array of Manifests. Nested arrays are not supported yet. (#112)
- Command Usage Guidelines: Tanka now uses the command description syntax (#94)
- cli/env resolved panic on missing
spec.json
(#108)
This version adds a set of commands to manipulate environments (tk env add, rm, set, list
) (#73). The commands are
mostly ks env
compatible, allowing tk env
be used as a drop-in replacement
in scripts.
Furthermore, an error message has been improved, to make sure users can
differentiate between parse issues in .jsonnet
and spec.json
(#71).
After nearly a month, the next feature packed release of Tanka is ready! Highlights include the new documentation website https://tanka.dev, regular expression support for targets, diff histograms and several bug-fixes.
- cli:
tk show
now aborts by default, when invoked in a non-interactive session. Use--dangerous-allow-redirect
to disable this safe-guard (#47). - kubernetes: Regexp Targets: It is now possible to use regular expressions
when specifying the targets using
--target
/-t
. Use it to easily select multiple objects at once: https://tanka.dev/targets/#regular-expressions (#64). - kubernetes: Diff histogram: Tanka now allows to summarize the differences
between the live configuration and the local one, by using the unix
diffstat(1)
utility. Gain a sneek peek at a change usingtk diff -s .
! (#67)
- kubernetes: Tanka does not fail anymore, when the configuration file
spec.json
is missing from an Environment. While you cannot apply or diff, the show operation works totally fine (#56, #63). - kubernetes: Errors from
kubectl
are now correctly passed to the user (#61). - cli:
tk diff
does not output useless empty lines (\n
) anymore (#62).
Tanka v0.3.0 is here!
This version includes lots of tiny fixes and detail improvements, to make it easier for everyone to configure their Kubernetes clusters.
Enjoy target support, enhancements to the diff UX and an improved CLI experience.
The most important feature is target support (#30) (caf205a): Using --target=kind/name
, you can limit your working set to a subset of the objects, e.g. to do a staged rollout.
There where some other features added:
- cli: autoApprove, forceApply (#35) (626b097): allows to skip the interactive verification. Furthermore,
kubectl
can now be invoked with--force
. - cli: print deprecated warnings in verbose mode. (#39) (6de170d): Warnings about the deprecated configs are only printed in verbose mode
- kubernetes: add namespace to apply preamble (#23) (9e2d927): The interactive verification now shows the
metadata.namespace
as well. - cli: diff UX enhancements (#34) (7602a19): The user experience of the
tk diff
subcommand has been improved:- if the output is too long to fit on a single screen, the systems
PAGER
is invoked - if differences are found, the exit status is set to
16
. - When
tk apply
is invoked, the diff is shown again, to make sure you apply what you want
- if the output is too long to fit on a single screen, the systems
- cli: invalid command being executed twice (#42) (28c6898): When the command failed, it was executed twice, due to an error in the error handling of the CLI.
- cli: config miss (#22) (32bc8a4): It was not possible to use the new configuration format, due to an error in the config parsing.
- cli: remove datetime from log (#24) (1e37b20)
- kubernetes: correct diff type on 1.13 (#31) (574f946): On kubernetes 1.13.0,
subset
was used, althoughnative
is already supported. - kubernetes: Nil pointer deference in subset diff. (#36) (f53c2b5)
- kubernetes: sort during reconcile (#33) (ab9c43a): The output of the reconcilation phase is now stable in ordering
0.2.0 (2019-08-07)
- cli: Completions (#7) (aea3bdf): Tanka is now able auto-complete most of the command line arguments and flags. Supported shells are
bash
,zsh
andfish
. - cmd: allow the baseDir to be passed as an argument (#6) (55adf80), (#12) (3248bb9):
tk
breaks with the current behaviour and requires the baseDir / environment to be passed explicitely on the command line, instead of assuming it aspwd
. This is because it allows morego
-like UX. It is also very handy for scripts not needing to switch the directory. - kubernetes: subset-diff (#11) (13f6fdd):
tk diff
support for version below Kubernetes1.13
is here 🎉! The strategy is called subset diff and effectively compares only the fields already present in the config. This allows the (hopefully) most bloat-free experience possible without server side diff. - tooling: import analysis (#10) (ce2b0d3): Adds
tk tool imports
, which allows to list all imports of a single file (even transitive ones). Optionally pass a git commit hash, to check whether any of the changed files is imported, to figure out which environments need to be re-applied.
This release marks the begin of tanka's history 🎉!
As of now, tanka aims to nearly seemlessly connect to the point where ksonnet left.
The current feature-set is basic, but usable: The three main workflow commands are available (show
, diff
, apply
), environments are supported, code-sharing is done using jb
.
Stay tuned!
- kubernetes: Show (7c4bee8): Equivalent to
ks show
, allows previewing the generated yaml. - kubernetes: Diff (a959f38): Uses the
kubectl diff
to obtain a sanitized difference betweent the current and the desired state. Requires Kubernetes 1.13+ - kubernetes: Apply (8fcb4c1): Applies the changes to the cluster (like
ks apply
) - kubernetes: Apply approval (4c6414f): Requires a typed
yes
to apply, gives the user the chance to verify cluster and context. - kubernetes: Smart context (2b3fd3c): Infers the correct context from the
spec.json
. Prevents applying the correct config to the wrong cluster. - Init Command (ff8857c): Initializes a new repository with the suggested directory structure.