KubeCon + CloudNativeCon is next week! See all the places we'll be here.
Carvel Logo

Continuous delivery and package management for Kubernetes

kapp-controller's declarative APIs and layered approach enables you to build, deploy, and manage your own applications. It also helps package your software into easily distributable packages and enables your users to discover, configure, and install these packages on a Kubernetes cluster.

Kubernetes Developers

Build your application for Kubernetes and let kapp-controller continuously fetch configuration and images from a variety of sources (git, helm charts, OCI image registry, etc.), template using various tools (ytt, kbld, helm, etc.), and deploy out to a cluster.

Package Authors

Encapsulate, version, and distribute your software for others to install on a Kubernetes cluster. Share your software packages with users in the same cluster where they are developing.

Package Consumers

Discover, configure, and install versioned software on a Kubernetes cluster without needing to know all the underlying details. kapp-controller will continuously fetch, template, and deploy the installed package just like an application.

Example Usage

Install and update your application declaratively

kapp-controller's App CRD provides a declarative way to install, manage, and upgrade applications on a Kubernetes cluster

apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
  name: simple-app
  namespace: default
spec:
  serviceAccountName: default-ns-sa
  fetch:
  - git:
      url: https://github.com/carvel-dev/simple-app-on-kubernetes
      ref: origin/develop
      subPath: config-step-2-template
  template:
  - ytt: {}
  deploy:
  - kapp: {}

Install our default-ns-rbac example. It creates the default-ns-sa service account that allows us to change any resource in the default namespace. It used as the serviceAccountName in the app spec above.

  $ kapp deploy -a default-ns-rbac -f https://raw.githubusercontent.com/carvel-dev/kapp-controller/develop/examples/rbac/default-ns.yml

Apply the App CR to your cluster and verify the deployment was successful:

$ kubectl apply -f simple-app.yml

$ kubectl get app simple-app

NAME         DESCRIPTION           SINCE-DEPLOY   AGE
simple-app   Reconcile succeeded   9s             10s

Discover more in the App CR documentation.

Create a Package

kapp-controller's Package CRD provides a way for you to write and share software as Packages so that Kubernetes users can easily discover and install them.

apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
  name: simple-app.corp.com.1.0.0
spec:
  refName: simple-app.corp.com
  version: 1.0.0
  releaseNotes: |
    Initial release of the simple app package    
  template:
    spec:
fetch:
- imgpkgBundle:
    image: index.docker.io/k8slt/kctrl-example-pkg@sha256:8ffa7f9352149dba1d539d0006b38eda357917edcdd39b82497a61dab2c27b75
template:
- ytt:
    paths:
    - config/
- kbld:
    paths:
    - .imgpkg/images.yml
    - '-'
deploy:
- kapp: {}
  valuesSchema:
    openAPIv3:
title: simple-app.corp.com values schema
examples:
- svc_port: 80
  app_port: 80
  hello_msg: stranger
properties:
  svc_port:
    type: integer
    description: Port number for the service.
    default: 80
    examples:
    - 80
  app_port:
    type: integer
    description: Target port for the application.
    default: 80
    examples:
    - 80
  hello_msg:
    type: string
    description: Name used in hello message from app when app is pinged.
    default: stranger
    examples:
    - stranger

Install a Package

kapp-controller's PackageRepository CRD allows you to easily discover a collection of Packages.

apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
metadata:
  name: simple-package-repository
  namespace: default
spec:
  fetch:
    imgpkgBundle:
      image: k8slt/corp-com-pkg-repo:1.0.0

Apply the PackageRepository to your cluster and view available software packages with kubectl:

$ kubectl apply -f repository.yml

$ kubectl get packages
NAME                             PACKAGEMETADATA NAME   VERSION      AGE
simple-app.corp.com.1.0.0        simple-app.corp.com    1.0.0        1m50s
simple-app.corp.com.2.0.0        simple-app.corp.com    2.0.0        1m50s
simple-app.corp.com.3.0.0-rc.1   simple-app.corp.com    3.0.0-rc.1   1m50s

kapp-controller's PackageInstall CR provides users a way to install Packages on a Kubernetes cluster.

apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
  name: pkg-demo
  namespace: default
spec:
  serviceAccountName: default-ns-sa
  packageRef:
    refName: simple-app.corp.com
    versionSelection:
      constraints: 1.0.0

Apply the PackageInstall to your cluster and verify the Package was installed successfully:

$ kubectl apply -f packageinstall.yml

$ kubectl get packageinstall pkg-demo
    
NAME       PACKAGE NAME          PACKAGE VERSION   DESCRIPTION           AGE
pkg-demo   simple-app.corp.com   1.0.0             Reconcile succeeded   1m50s

View the App CR created as a result of the PackageInstall creation:

$ kubectl get app pkg-demo

NAME         DESCRIPTION           SINCE-DEPLOY   AGE
pkg-demo     Reconcile succeeded   9s             1m45s

Discover more about creating and installing Packages in the docs

Demo

Getting started

To help you get started, see the documentation.