-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: rcmadhankumar <[email protected]>
- Loading branch information
1 parent
3d10fbd
commit ef2634b
Showing
47 changed files
with
2,328 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/] | ||
|
||
title: "About kapp" | ||
toc: "false" | ||
cascade: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/apply-ordering] | ||
|
||
title: Apply Ordering | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/apply-waiting] | ||
|
||
title: Apply Waiting | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/apply] | ||
|
||
title: Apply stage | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/apps] | ||
|
||
title: Applications | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/cheatsheet] | ||
|
||
title: Cheatsheet | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/command-reference] | ||
|
||
title: Command Reference | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/config] | ||
|
||
title: Configuration | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/configmap-migration] | ||
|
||
title: Configmap Migration (experimental) | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/dangerous-flags] | ||
|
||
title: Dangerous Flags | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/diff] | ||
|
||
title: Diff stage | ||
--- | ||
## Overview | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/faq] | ||
|
||
title: FAQ | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/gitops] | ||
|
||
title: GitOps | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/install] | ||
|
||
title: Install | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/merge-method] | ||
|
||
title: "Resource Merge Method" | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/preflight] | ||
|
||
title: Preflight Checks | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/rbac] | ||
|
||
title: Permissions | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
aliases: [/kapp/docs/latest/security] | ||
|
||
title: Security | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.62.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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
#... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/carvel-dev/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.) |
Oops, something went wrong.