Skip to content

Add server-side apply mode #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 27, 2022
Prev Previous commit
Next Next commit
Update documentation
  • Loading branch information
smuth4 committed Apr 26, 2022
commit 867f4e8860927e9bfe4be4581cef24fd634f3f0b
16 changes: 16 additions & 0 deletions docs/docs/diff-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ tk diff --diff-strategy=native .
# validate: Like native but with a server-side validation
tk diff --diff-strategy=validate .

# server-side
tk diff --diff-strategy=server .

# subset
tk diff --diff-strategy=subset .
```
Expand All @@ -45,6 +48,19 @@ There is a
[known issue](known-issues.md#unexpected-diff-if-the-same-port-number-is-used-for-udp-and-tcp)
with `kubectl diff`, which affects ports configured to use both TCP and UDP.

### Server-side diffs

There are two additional modes which extend `native`: `validate` and `server`.
While all `kubectl diff` commands are sent to the API server, these two
methods take advantage of an additional server-side diff mode (which uses the
`kubectl diff --server-side` flag, complementing the
[server-side apply](/server-side-apply) mode).

Since a plain `server` diff often produces cruft, and wouldn't be representative
of a client-side apply, the `validate` method allows the server-side diff to
check that all models are valid server-side, but still displays the `native`
diff output to the user.

## Subset

If native diffing is not supported by your cluster, Tanka provides subset diff
Expand Down
7 changes: 4 additions & 3 deletions docs/docs/server-side-apply.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: "Server-Side Apply"
route: "/server-side-applye"
route: "/server-side-apply"
menu: Advanced features
---

# Server-Side Apply

Tanka supports [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/),
Tanka supports
[server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/),
which requires at least Kubernetes 1.16+, and was promoted to stable status in 1.22.

To enable server-side diff in tanka, add the following field to `spec.json`:
Expand All @@ -25,7 +26,7 @@ differences in how fields are managed that can make converting existing cluster
resources a non-trival change.

Identifying and fixing these changes are beyond the scope of this guide, but
many can be found before an apply with the `validate`
many can be found before an apply by using the `validate` or `server`
[diff strategy](/diff-strategy).

## Field conflicts
Expand Down