Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Helm Overrides Plugin

A Helm plugin that simplifies working with Harness's complex override hierarchy. Never wonder "which file should I modify?" again.

πŸš€ Quick Start

# 1. Install as Helm plugin (recommended)
helm plugin install https://github.com/harness/helm-overrides-manager/releases/latest/download/helm-overrides-linux-amd64.tar.gz

# 2. Go to your harness-pl-infra directory
cd /path/to/harness-pl-infra/

# 3. Find which file to modify (interactive guide)
helm overrides guide

# 4. Generate manifests for any service (GAR path auto-resolved)
helm overrides template \
  --env prod --cluster prod0 --service ng-manager

⚑ What This Plugin Does

Problem: Harness has a complex 9-layer override system. Developers waste time figuring out which files to modify and how overrides merge together.

Solution: This plugin provides 2 essential commands that make override management simple:

  1. guide - "Which file should I modify?" (Interactive)
  2. template - "Generate final manifests" (Like generateHelmValues.sh)

πŸ“¦ Installation

Prerequisites

  • Helm 3.x (required)
  • yq (required) - brew install yq or install guide
  • gcloud CLI (recommended) - For GAR authentication

Method 1: Helm Plugin (Recommended)

# Install for your platform
helm plugin install https://github.com/harness/helm-overrides-manager/releases/latest/download/helm-overrides-linux-amd64.tar.gz

# Other platforms:
# macOS Intel: helm-overrides-darwin-amd64.tar.gz
# macOS Apple Silicon: helm-overrides-darwin-arm64.tar.gz  
# Linux ARM64: helm-overrides-linux-arm64.tar.gz
# Windows: helm-overrides-windows-amd64.tar.gz

Method 2: Direct Binary Download

# Download latest release
curl -LO https://github.com/harness/helm-overrides-manager/releases/latest/download/helm-overrides-linux-amd64.tar.gz
tar -xzf helm-overrides-linux-amd64.tar.gz
sudo mv helm-overrides-linux-amd64/helm-overrides /usr/local/bin/

Method 3: Build from Source

git clone https://github.com/harness/helm-overrides-manager.git
cd helm-overrides-manager
make build
# Binary will be at: bin/helm-overrides

Verify Installation

cd /path/to/harness-pl-infra/
helm overrides --help

🧭 Command Guide

1. guide - Find the Right File

When to use: "I need to modify configuration but don't know which file"

helm overrides guide

Example interaction:

πŸ“¦ Question 1: Service Scope
Is this a single service change or does it affect multiple services?
  1) Single service  ← [Your choice]

Which service? ng-manager

🌍 Question 2: Environment Scope  
Is this a single environment change or applicable to multiple environments?
  1) Single environment  ← [Your choice]

Which environment? prod

πŸ‘€ Question 3: User/Cluster Scope
Is this a single user/cluster change or applicable to multiple users?
  1) Single user/cluster  ← [Your choice]

Which user/cluster? prod0

🎯 Result
File to CREATE: non-dev/prod/prod0/Chart-Overrides/ng-manager-values.yaml

2. template - Generate Manifests

When to use: "I want to see the final Kubernetes manifests" or "Test my configuration changes"

# Basic usage (GAR path auto-resolved from versions.yaml)
helm overrides template \
  --env prod --cluster prod0 --service ng-manager

# With custom GAR path
helm overrides template \
  --env prod --cluster prod0 --service ng-manager \
  --gar-path us-west1-docker.pkg.dev/gar-setup/helm/ng-manager:1.90.0

# Save to file
helm overrides template \
  --env prod --cluster prod0 --service ng-manager \
  --output manifests.yaml

# Show the merged overrides too
helm overrides template \
  --env prod --cluster prod0 --service ng-manager \
  --show-overrides

Special environments:

# DR environment
helm overrides template --env prod --cluster prod0-dr --service ng-manager --is-dr

# HAR-enabled environment  
helm overrides template --env prod --cluster eu1 --service ng-manager --har-enabled

# Custom GAR registry
helm overrides template --env prod --cluster prod0 --service ng-manager --gar-registry us-central1-docker.pkg.dev/my-project/helm

🎯 Common Workflows

New Service Configuration

# 1. Find which file to modify
helm overrides guide
# Answer: Single service β†’ ng-manager, Single env β†’ prod, Single user β†’ prod0
# Result: non-dev/prod/prod0/Chart-Overrides/ng-manager-values.yaml

# 2. Create/edit the file with your config
vim non-dev/prod/prod0/Chart-Overrides/ng-manager-values.yaml

# 3. Test your changes
helm overrides template --env prod --cluster prod0 --service ng-manager

Development Workflow

# 1. Make changes to override files (guided by `helm overrides guide`)
# 2. Test your changes locally
helm overrides template --env dev --cluster dev0 --service ng-manager

# 3. Deploy to dev environment, then generate prod manifests for comparison
helm overrides template --env prod --cluster prod0 --service ng-manager

πŸ”§ Environment Variables

You can set these to avoid typing common values:

export HELM_OVERRIDES_GAR_REGISTRY="us-west1-docker.pkg.dev/gar-setup/helm"
export HELM_OVERRIDES_DEFAULT_ENV="dev"
export HELM_OVERRIDES_DEFAULT_CLUSTER="dev0"

❗ Important Notes

Execution Context

Always run from harness-pl-infra root directory:

cd /path/to/harness-pl-infra/  # ← Must be here
helm overrides guide           # ← Then run commands

GAR Authentication

Make sure you're authenticated with Google Cloud:

gcloud auth application-default login
# or
gcloud auth login

Chart Paths and Version Resolution

  • GAR paths are auto-resolved from system/environments/{env}/{cluster}/versions.yaml
  • Default registry: us-west1-docker.pkg.dev/gar-setup/helm
  • Override with --gar-registry flag or specify full path with --gar-path

πŸ› Troubleshooting

"Validation failed: system/service-catalog.yaml not found"

Solution: You're not in the harness-pl-infra root directory

cd /path/to/harness-pl-infra/

"Chart download failed" or GAR authentication errors

Solution: Authenticate with gcloud

gcloud auth application-default login

"versions.yaml not found" or "service not found in versions.yaml"

Solution: Either the versions.yaml file doesn't exist or the service isn't listed

# Check if file exists
ls system/environments/prod/prod0/versions.yaml

# If missing, specify GAR path manually
helm overrides template --env prod --cluster prod0 --service ng-manager --gar-path us-west1-docker.pkg.dev/gar-setup/helm/ng-manager:1.90.0

Command not found

Solution: Make sure the plugin is installed correctly

# Check if plugin is installed
helm plugin list

# If not installed, install it
helm plugin install https://github.com/harness/helm-overrides-manager/releases/latest/download/helm-overrides-linux-amd64.tar.gz

# Verify installation
helm overrides --help

πŸ“š Understanding the Override Hierarchy

The plugin processes 9 layers of overrides in this order:

  1. Additional YAML files (command-line inputs)
  2. System-level overrides (system/environments/overrides/)
  3. Environment-level overrides (system/environments/{ENV}/overrides/)
  4. Profile-based overrides (system/environments/profiles/)
  5. Primary cluster overrides (if different from user)
  6. Namespace-level overrides (Chart-Overrides at namespace level)
  7. User/cluster-specific overrides (Chart-Overrides at user level)
  8. DR overrides (system/environments/profiles/dr/)
  9. Runtime-generated overrides (workload identity, HAR config, etc.)

The guide command helps you identify which layer (and file) to modify for your specific use case.

🀝 Support

  • Issues: Create issues in this GitHub repository
  • Questions: Ask in #harness-infra Slack channel
  • Feature Requests: Create issues with "enhancement" label

πŸ”„ Version

Current version: 1.0.0

This plugin replaces manual use of generateHelmValues.sh and provides additional comparison capabilities.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages