Getting Started
Verified against v0.60.3. Commands assume a working Kubernetes cluster and a configured
kubectl.
Prerequisites
- A Kubernetes cluster you can reach with cluster-admin rights (a local
kindorminikubecluster is fine). kubectlconfigured to point at that cluster.
Install
Install kapp-controller by applying its release manifest:
kubectl apply -f https://github.com/carvel-dev/kapp-controller/releases/latest/download/release.ymlThis creates the kapp-controller deployment, its custom resource definitions (App, PackageInstall, PackageRepository), and the aggregated API service.
A first working setup
The core job is to declare an App and let the controller fetch, template, and deploy it. The example below uses a public Carvel sample repository.
Wait for the controller to become ready:
bashkubectl rollout status deployment/kapp-controller -n kapp-controllerCreate a service account and namespaced RBAC the
Appwill deploy under. Save this asrbac.yml:yamlapiVersion: v1 kind: ServiceAccount metadata: name: default-ns-sa namespace: default --- kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: default-ns-role namespace: default rules: - apiGroups: ["*"] resources: ["*"] verbs: ["*"] --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: default-ns-role-binding namespace: default subjects: - kind: ServiceAccount name: default-ns-sa namespace: default roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: default-ns-roleApply it:
bashkubectl apply -f rbac.ymlDeclare an
Appthat fetches from git, templates withytt, and deploys withkapp. Save this asapp.yml:yamlapiVersion: kappctrl.k14s.io/v1alpha1 kind: App metadata: name: simple-app namespace: default spec: serviceAccountName: default-ns-sa fetch: - git: url: https://github.com/k14s/k8s-simple-app-example ref: origin/develop subPath: config-step-2-template template: - ytt: {} deploy: - kapp: {}Apply it:
bashkubectl apply -f app.yml
Verify it works
Check the App status. The DESCRIPTION column reports each reconcile result:
kubectl get app simple-app -n defaultA healthy result shows Reconcile succeeded. To see the per-stage detail (fetch, template, deploy output and exit codes) recorded in the status:
kubectl get app simple-app -n default -o yamlThe resources rendered by the sample (a Deployment and Service) should now exist in the default namespace:
kubectl get deployment,service -n defaultWhere to go next
- The kapp-controller documentation covers packaging (
PackageRepositoryandPackageInstall), private registry authentication, and air-gapped installs. - For production concerns such as restricting the deploy service account, scoping namespaces with the
--namespaceflag, and the sidecar security model, start from the same docs and the main repository.