> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cnap.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Generic Application Chart

> Understand how CNAP uses the generic Helm chart for GitHub repository deployments

<Card title="View Repository" icon="github" href="https://github.com/cnap-tech/charts">
  Browse the Helm charts repository
</Card>

When you deploy applications from GitHub repositories in CNAP, your code is automatically built into a Docker image and deployed using CNAP's generic application Helm chart. This chart provides a production-ready deployment configuration without requiring you to create a Helm chart yourself.

## What It Is

The generic application chart is a Helm chart published at `https://charts.cnap.tech` with the chart name `app`. It's designed to deploy any Docker container image to Kubernetes with sensible defaults and extensive customization options.

<Note>
  While the chart is used internally by CNAP for GitHub repository deployments, you can also use it directly with Helm if you want to deploy container images manually.
</Note>

## When CNAP Uses It

CNAP automatically uses the generic chart when:

* **Deploying from GitHub repositories** - When you create a product or installation using a GitHub repository source
* **Using Docker images** - When you deploy a Docker image without a custom Helm chart
* **Standalone installations** - When you deploy a Docker image or GitHub repository directly to a cluster as a <Tooltip headline="Standalone Installation" tip="An installation that runs on a cluster without being part of a product. Useful for internal tools, one-off deployments, or infrastructure services that don't need to be sold through the marketplace.">standalone installation</Tooltip>, without packaging it as a product first

The chart is automatically configured with your application's settings, including:

* Container image and tag
* Resource limits and requests
* Environment variables
* Exposed ports
* Health checks
* Scaling configuration

## Chart Features

### Container Configuration

* Deploy any Docker container image with configurable pull policies
* Multiple ports and protocols (HTTP, HTTPS, TCP, gRPC, UDP)
* Override the container's command (entrypoint) and args
* Environment variables with plain values or Kubernetes `secretKeyRef`
* [Private registry support](/platform/private-registries) via CNAP's registry proxy

### Gateway API Integration

* HTTPRoute creation for [external access with custom domains](/networking)
* Support for multiple hostnames
* Path-based routing rules with header and query parameter matching
* Traffic splitting via additional backend refs and weights
* Request header modification filters
* Gateway parentRefs for routing through specific gateways (Cilium, Cloudflare, etc.)

### Health Checks

* Liveness and readiness probes (disabled by default)
* HTTP, TCP, and exec probe types
* Configurable delays, intervals, timeouts, and failure thresholds

### Scaling and Resources

* Horizontal Pod Autoscaler (HPA) with CPU and memory utilization targets
* Configurable CPU and memory requests and limits
* Configurable replica count and min/max replicas

### Advanced

* Init containers and sidecar containers
* Volume mounts and persistent storage
* Pod and container security contexts (runs as non-root by default)
* Node selectors, tolerations, and affinity rules
* Pod annotations and labels
* ServiceAccount creation and configuration

## How It Works

When you deploy from a GitHub repository:

1. **Code is built** — Your repository code is built into a Docker image using Railpack (via GitHub Actions workflows)
2. **Chart is selected** — CNAP automatically uses the generic `app` chart from `https://charts.cnap.tech`
3. **Values are generated** — CNAP generates Helm values from your deployment configuration (ports, env vars, resources, scaling, command/args, HTTPRoute hostnames)
4. **Chart is deployed** — The chart is deployed to your cluster with the generated values
5. **Application runs** — Your application runs in Kubernetes with all configured resources

For Docker image deployments, steps 2–5 are the same — the only difference is you provide the image directly instead of building from source.

## Using the Chart Directly

The chart is published as a Helm repository:

```bash theme={null}
helm repo add cnap-tech https://charts.cnap.tech
helm repo update
```

You can inspect the chart directly:

```bash theme={null}
helm show chart cnap-tech/app
helm show values cnap-tech/app
```

## Customization

While CNAP automatically configures the chart, you can customize the deployment through the **Settings** tab on any installed app (or during app creation):

* **Ports** - Configure container ports and expose them externally with hostnames
* **Environment variables** - Add plain-text or secret configuration values
* **Scaling** - Set replica count or enable HPA with CPU/memory targets
* **Resources** - Set CPU and memory requests and limits
* **Command and args** - Override the container's entrypoint and arguments

All customizations are automatically converted to Helm values and applied when the chart is deployed.

## Example Values

Here's an example of the Helm values CNAP generates for a typical Node.js application with an exposed port:

```yaml theme={null}
image:
  repository: ghcr.io/username/myapp
  tag: sha-abc123
  pullPolicy: IfNotPresent

replicaCount: 1

container:
  ports:
    - name: http
      containerPort: 3000
      protocol: TCP
  env:
    - name: NODE_ENV
      value: production
    - name: DB_PASSWORD
      valueFrom:
        secretKeyRef:
          name: app-secrets
          key: DB_PASSWORD
  command: []
  args: []

resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 500m
    memory: 512Mi

autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80

httpRoute:
  enabled: true
  hostnames:
    - myapp.example.com
  parentRefs:
    - name: cilium-gateway
      namespace: pde-abc123
```

## Source Code

The chart source code is available in the [cnap-tech/charts](https://github.com/cnap-tech/charts) repository. You can:

* Review the chart structure and templates
* Understand how it works internally
* Contribute improvements
* Use it as a reference for creating custom charts

## Related Topics

* [Custom Domains →](/networking) - Expose apps externally with custom domains via Gateway API
* [GitHub Actions →](/tools/github-actions) - Learn about the build workflows that create images for this chart
* [Application Sources →](/app-sources) - Understand how GitHub repositories work as sources
* [Templates →](/products/templates) - See how templates use Helm charts
* [Package Generation →](/charts/chart-generation) - Learn how CNAP packages charts
