Skip to content

Commit

Permalink
Bump kapp docs to v0.58.x
Browse files Browse the repository at this point in the history
Signed-off-by: Praveen Rewar <[email protected]>
  • Loading branch information
praveenrewar committed Jul 25, 2023
1 parent c9f257d commit 3d24e5e
Show file tree
Hide file tree
Showing 43 changed files with 2,031 additions and 22 deletions.
5 changes: 3 additions & 2 deletions site/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ params:
name: kapp
short_name: kapp
root_link: /kapp/
latest_docs_link: /kapp/docs/v0.57.0/
latest_docs_link: /kapp/docs/v0.58.x/
github_url: https://github.com/carvel-dev/kapp
search: true
search_index_name: carvel-kapp
search_api_key: a38560864c2e9128ae57d5734df438ff
versioning: true
version_latest: v0.57.0
version_latest: v0.58.x
versions:
- develop
- v0.58.x
- v0.57.0
- v0.56.0
- v0.55.0
Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/]

title: "About kapp"
toc: "false"
cascade:
Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/apply-ordering.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/apply-ordering]

title: Apply Ordering
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/apply-waiting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/apply-waiting]

title: Apply Waiting
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/apply.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/apply]

title: Apply stage
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/apps.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/apps]

title: Applications
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/cheatsheet]

title: Cheatsheet
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/config]

title: Configuration
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/configmap-migration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/configmap-migration]

title: Configmap Migration (experimental)
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/dangerous-flags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/dangerous-flags]

title: Dangerous Flags
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/diff.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/diff]

title: Diff stage
---
## Overview
Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/faq]

title: FAQ
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/gitops.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/gitops]

title: GitOps
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/hpa-deployment-rebase.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/hpa-deployment-rebase]

title: HPA and Deployment rebase
---
## HPA and Deployment rebase
Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/install.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/install]

title: Install
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/integrating-with-other-tools]

title: Integrating with Other Tools
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/merge-method.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/merge-method]

title: "Resource Merge Method"
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/rbac.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/rbac]

title: Permissions
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/rebase-pvc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/rebase-pvc]

title: PersistentVolumeClaim rebase
---
## PersistentVolumeClaim rebase
Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/security.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/security]

title: Security
---

Expand Down
2 changes: 1 addition & 1 deletion site/content/kapp/docs/v0.57.0/state-namespace.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
aliases: [/kapp/docs/latest/state-namespace]

title: Namespace for State Storage
---

Expand Down
44 changes: 44 additions & 0 deletions site/content/kapp/docs/v0.58.x/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
aliases: [/kapp/docs/latest/]
title: "About kapp"
toc: "false"
cascade:
version: v0.58.x
toc: "true"
type: docs
layout: docs
---

`kapp` (pronounced: `kap`) CLI encourages Kubernetes users to manage resources in bulk by working with "Kubernetes applications" (sets of resources with the same label). It focuses on resource diffing, labeling, deployment and deletion. Unlike tools like Helm, `kapp` considers YAML templating and management of packages outside of its scope, though it works great with tools that generate Kubernetes configuration.

![Kapp Deploy](/images/kapp/kapp-deploy-screenshot.png)

Features:

- Works with standard Kubernetes YAMLs
- Focuses exclusively on deployment workflow, not packaging or templating
- but plays well with tools (such as [ytt](/ytt)) that produce Kubernetes configuration
- Converges application resources (creates, updates and/or deletes resources) in each deploy
- based on comparison between provided files and live objects in the cluster
- Separates calculation of changes ([diff stage](diff.md)) from application of changes ([apply stage](apply.md))
- [Waits for resources](apply-waiting.md) to be "ready"
- Creates CRDs and Namespaces first and supports [custom change ordering](apply-ordering.md)
- Works [without admin privileges](rbac.md) and does not use custom CRDs
- making it possible to use kapp as a regular user in a single namespace
- Records application deployment history
- Opt-in resource version management
- for example, to trigger Deployment rollout when ConfigMap changes
- Optionally streams Pod logs during deploy
- Works with any group of labeled resources (`kapp -a label:tier=web inspect -t`)
- Works without server side components
- GitOps friendly (`kapp app-group deploy -g all-apps --directory .`)

## Blog posts

- [Deploying Kubernetes Applications with ytt, kbld, and kapp](/blog/deploying-apps-with-ytt-kbld-kapp)

## Talks

- [ytt and kapp @ TGI Kubernetes 079](https://www.youtube.com/watch?v=CSglwNTQiYg) with Joe Beda
- [Managing Applications in Production: Helm vs ytt & kapp @ Kubecon 2020](https://www.youtube.com/watch?v=WJw1MDFMVuk)
- [Introduction to Carvel @ Rawkode Live](https://www.youtube.com/watch?v=LBCmMTofNxw)
94 changes: 94 additions & 0 deletions site/content/kapp/docs/v0.58.x/apply-ordering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
aliases: [/kapp/docs/latest/apply-ordering]
title: Apply Ordering
---

## Overview

kapp includes builtin rules to make sure certain changes are applied in particular order:

- Creates/updates
- CRDs are created/updated before custom resources
- Namespaces are created/updated before namespaced resources
- Pod related resources (ServiceAccount, ConfigMap, Secret, etc.) are created/updated before other resources (v0.25.0+)
- RBAC related resources (Role, RoleBinding, etc.) are created/updated before other resources (v0.25.0+)
- Deletions (below is order as of v0.29.0+)
- Custom resources are deleted first
- CRDs are deleted next
- Rest of resoures are deleted

As of v0.25.0+, builtin rules are specified via [changeGroupBindings and changeRuleBindings](config.md#changegroupbindings) configurations. Custom rules can be added via same mechanism.

Additionally kapp allows to customize order of changes via following resource annotations:

- `kapp.k14s.io/change-group` annotation to group one or more resource changes into arbitrarily named group. Example: `apps.big.co/db-migrations`. You can specify multiple change groups by suffixing each annotation with a `.x` where `x` is unique identifier (e.g. `kapp.k14s.io/change-group.istio-sidecar-order`).
- `kapp.k14s.io/change-rule` annotation to control when resource change should be applied (created, updated, or deleted) relative to other changes. You can specify multiple change rules by suffixing each annotation with a `.x` where `x` is unique identifier (e.g. `kapp.k14s.io/change-rule.istio-sidecar-order`).

`kapp.k14s.io/change-rule` annotation value format is as follows: `(upsert|delete) (after|before) (upserting|deleting) <name>`. For example:

- `kapp.k14s.io/change-rule: "upsert after upserting apps.big.co/db-migrations"`
- `kapp.k14s.io/change-rule: "delete before upserting apps.big.co/service"`

As of v0.41.0+, kapp provides change group placeholders, which can be used in change-group and change-rule annotation values and are later replaced by values from the resource manifest of the resource they are associated with. For example:

- `kapp.k14s.io/change-group: apps.co/db-migrations-{name}` - Here `{name}` would later be replaced by the name of the resource.
- `kapp.k14s.io/change-rule: upsert after upserting apps.co/namespaces-{namespace}` - Here `{namespace}` would later be replaced by the namespace of the resource.

kapp provides the following placeholders:

- `{api-group}` - apiGroup
- `{kind}` - kind
- `{name}` - name
- `{namespace}` - namespace
- `{crd-kind}` - spec.names.kind (available for CRDs only)
- `{crd-group}` - spec.group (available for CRDs only)

These placeholders can also be used in changeGroupBindings and changeRuleBindings. By default, they are used for CRDs, CRs, namespaces and namespaced resources. Due to this, CRs now wait for their respective CRDs only and namespaced resources now wait for their respective namespaces only.

## Example

Following example shows how to run `job/migrations`, start and wait for `deployment/app`, and finally `job/app-health-check`.

```yaml
kind: ConfigMap
metadata:
name: app-config
annotations: {}
#...
---
kind: Job
metadata:
name: migrations
annotations:
kapp.k14s.io/change-group: "apps.big.co/db-migrations"
#...
---
kind: Service
metadata:
name: app
annotations:
kapp.k14s.io/change-group: "apps.big.co/deployment"
#...
---
kind: Ingress
metadata:
name: app
annotations:
kapp.k14s.io/change-group: "apps.big.co/deployment"
#...
---
kind: Deployment
metadata:
name: app
annotations:
kapp.k14s.io/change-group: "apps.big.co/deployment"
kapp.k14s.io/change-rule: "upsert after upserting apps.big.co/db-migrations"
#...
---
kind: Job
metadata:
name: app-health-check
annotations:
kapp.k14s.io/change-rule: "upsert after upserting apps.big.co/deployment"
#...
```
47 changes: 47 additions & 0 deletions site/content/kapp/docs/v0.58.x/apply-waiting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
aliases: [/kapp/docs/latest/apply-waiting]
title: Apply Waiting
---

## Overview

kapp includes builtin rules on how to wait for the following resource types:

- any resource with `metadata.deletionTimestamp`: wait for resource to be fully removed
- any resource matching Config's waitRules: [see "Custom waiting behaviour" below](#custom-waiting-behaviour)
- [`apiextensions.k8s.io/<any>/CustomResourceDefinition`](https://github.com/vmware-tanzu/carvel-kapp/blob/develop/pkg/kapp/resourcesmisc/api_extensions_vx_crd.go): wait for Established and NamesAccepted conditions to be `True` (note that this is wait rule for CustomResourceDefinition resource itself, not CRs)
- `apps/v1/DaemonSet`: wait for `status.numberUnavailable` to be 0
- `apps/v1/Deployment`: [see "apps/v1/Deployment resource" below](#apps-v1-deployment-resource)
- `apps/v1/ReplicaSet`: wait for `status.replicas == status.availableReplicas`
- `batch/v1/Job`: wait for `Complete` or `Failed` conditions to appear
- `batch/<any>/CronJob`: immediately considered done
- `/v1/Pod`: looks at `status.phase`
- `/v1/Service`: wait for `spec.clusterIP` and/or `status.loadBalancer.ingress` to become set
- `apps/v1/StatefulSet`: [see "apps/v1/StatefulSet resource" below](#appsv1statefulset-resource)

If resource is not affected by the above rules, its waiting behaviour depends on aggregate of waiting states of its associated resources (associated resources are resources that share same `kapp.k14s.io/association` label value).

## Controlling waiting via resource annotations

- `kapp.k14s.io/disable-wait` annotation controls whether waiting will happen at all. Possible values: "".
- `kapp.k14s.io/disable-associated-resources-wait` annotation controls whether associated resources impact resource's waiting state. Possible values: "".

## apps/v1/Deployment resource

kapp by default waits for `apps/v1/Deployment` resource to have `status.unavailableReplicas` equal to zero. Additionally waiting behaviour can be controlled via following annotations:

- `kapp.k14s.io/apps-v1-deployment-wait-minimum-replicas-available` annotation controls how many new available replicas are enough to consider waiting successful. Example values: `"10"`, `"5%"`.

## apps/v1/StatefulSet resource

Available in v0.32.0+.

kapp will wait for any pods created from the updated template to be ready based on StatefulSet's status. This behaviour depends on the [update strategy](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies) used.

Note: kapp does not do anything special when `OnDelete` strategy is used. It will wait for StatefulSet to report it's reconciled (expecting some actor in the system to delete Pods per `OnDelete` requirements).

## Custom waiting behaviour

Available in v0.29.0+.

kapp can be extended with custom waiting behaviour by specifying [wait rules as additional config](config.md#wait-rules). (If this functionality is not enough to wait for resources in your use case, please reach out on Slack to discuss further.)
Loading

0 comments on commit 3d24e5e

Please sign in to comment.