Skip to main content
Use Kustomize when you want to manage Newt with rendered manifests, environment-specific overlays, and explicit patches in Git. For Newt, the supported Kustomize workflow is:
  1. Render the Newt Helm chart to manifests.
  2. Use the rendered output as the Kustomize base.
  3. Create overlays per site, cluster, or environment.
  4. Apply the overlay with kubectl apply -k or reconcile it with Argo CD or Flux.

When to use Kustomize for Newt

Use Kustomize if you:
  • want site-specific or environment-specific overlays
  • need explicit patches committed to Git
  • prefer reviewing rendered Kubernetes manifests before applying them
  • use Argo CD or Flux with Kustomize sources
  • want to customize Helm-rendered output without forking the chart
For a simpler single-site setup, use Newt Helm.

Supported approach

The Newt chart does not provide native Kustomize bases. Render the Helm chart first, then use Kustomize on the rendered manifests.
Do not manage the same Newt resources with both a live Helm release and Kustomize. Pick one ownership model per environment.
Recommended ownership model:
  • Use Helm only to render the Newt chart.
  • Use Kustomize, Argo CD, or Flux to apply and reconcile the rendered manifests.
  • Re-render the base when upgrading the chart or changing Helm values.

Example directory structure

Step 1: Create the namespace

Create the namespace before applying rendered manifests:
If your cluster uses Pod Security Admission, namespace labels, or other policy labels, apply them before creating workloads. Example:

Step 2: Create Newt credentials

Create a Kubernetes Secret for each Newt site or instance.
For a second site:
Use existing Kubernetes Secrets for production. Do not commit Newt credentials into Helm values, rendered manifests, or Kustomize patches.

Step 3: Create base values

Create values/values-base.yaml:
This values file uses an existing Secret. The default Secret keys are:
Use auth.keys.* only when your Secret uses different key names.

Step 4: Render Newt to the base

Add and update the Helm repository:
Render the Newt chart:
You can also render from the GHCR OCI chart:

Step 5: Create the base kustomization

The namespace is already rendered by Helm through --namespace pangolin. You can also set namespace: pangolin in Kustomize, but avoid changing namespaces in overlays unless you have verified all rendered resources and references.

Step 6: Inspect the rendered resource names

Before writing patches, check the generated names:
Or list the deployments:
Use the actual rendered Deployment name in your patch targets.
Do not assume the rendered Deployment name without checking the generated manifests. Helm naming can change with release name, chart name, nameOverride, or fullnameOverride.

Step 7: Create site-specific overlays

Example overlay for Site A:
Example resource patch:
Replace newt-main-tunnel with the actual Deployment name from your rendered manifests.
Example overlay for Site B with a different Secret is usually better handled by rendering a second base with a different values file. Create values/values-site-b.yaml:
Then render a separate base for Site B:
For different credentials, endpoints, provisioning keys, or instance names, prefer separate Helm-rendered bases. Use Kustomize patches for environment-level changes such as labels, annotations, resources, scheduling, or NetworkPolicy adjustments.

Common Kustomize patches for Newt

Patch resource requests and limits

Patch log level

Prefer configuring log level through Helm values before rendering. If you still need a manifest patch, patch the generated environment variable carefully after inspecting the rendered Deployment. Example JSON6902-style patch:
Only use index-based JSON patches after checking the rendered manifest. Container order and environment variable layout can change between chart versions.

Add node affinity

Reference the patch:

Add annotations

Do not rename rendered Helm resources by default

Avoid Kustomize options such as namePrefix and nameSuffix for Helm-rendered bases unless you have validated every generated reference. Renaming rendered resources can break:
  • Service selectors
  • Secret references
  • ConfigMap references
  • ServiceAccount references
  • NetworkPolicy selectors
  • Prometheus monitor selectors
If you need different resource names, prefer changing the Helm release name or chart naming values before rendering.

Apply the overlay

Preview the rendered output:
Compare with the live cluster:
Apply the overlay:
Verify the deployment:

Updating the rendered base

When upgrading the Newt chart, re-render the base and review the changes.
Render the updated chart output:
Or with OCI:
Validate the overlay:
Review the diff:
Commit the updated base and overlays:
Apply after review:

Ownership model

Do not run helm upgrade against a release that is managed by Kustomize. Avoid this pattern:
Use one of these models instead:

Validation

Validate Kustomize output:
Run a server-side dry run:
Preview live changes:
Check live resources:

Troubleshooting

The patch does not apply

Check the rendered resource name and kind:
Then verify the patch target in your overlay.

The pod does not start

Check pod status and events:

Newt does not connect

Check logs:
Verify:
  • the Secret exists in the same namespace
  • PANGOLIN_ENDPOINT is reachable from the pod
  • NEWT_ID and NEWT_SECRET are correct
  • outbound DNS and HTTPS are allowed
  • TLS certificates for the Pangolin endpoint are valid

Next steps

Helm Install

Install Newt with Helm.

Configuration

Review Newt chart options.

Troubleshooting

Debug Newt deployment and connection issues.

GitOps

Deploy Kustomize overlays with Argo CD or Flux.