ARTIFACTORY: Configuring Helm Smart Repository for K8sGPT Charts in Artifactory in an Air-Gapped Environment

ARTIFACTORY: Configuring Helm Smart Repository for K8sGPT Charts in Artifactory in an Air-Gapped Environment

AuthorFullName__c
Ori Zohar
articleNumber
000006339
ft:sourceType
Salesforce
FirstPublishedDate
2025-01-22T07:28:18Z
lastModifiedDate
2025-01-21
VersionNumber
3

Introduction 

In air-gapped environments, accessing external resources like Helm charts can be challenging. This guide provides a step-by-step process to configure a Helm smart repository in JFrog Artifactory to work with the K8sGPT Helm charts when operating in a self-hosted, air-gapped environment with limited connectivity.
This setup ensures that the air-gapped environment can indirectly fetch K8sGPT charts through Another Artifactory instance, which serves as the intermediary.
 

Resolution


Steps to Configure Helm Smart Repository

 

External Artifactory Instance Configuration

 

  1. Create a Helm Legacy Remote Repository
    • Navigate to the External Artifactory instance and create a remote repository pointing to the external URL: https://charts.k8sgpt.ai/ 
    • Test the connection tab to ensure the repository is reachable
    • Keep the Chartbase URL field empty
    • In the Advanced Settings, enable the External Dependency Rewrite option
       
  2.  Create a Virtual Helm Legacy Repository
    • Assign the remote repository created in the previous step to a Virtual Repository

      User-added image 

Enable the Remote Artifacts option in the Virtual Repository

User-added image User-added image 
Internal Artifactory Instance Configuration

 

1. Create a Remote Helm Legacy Repository
  • In your Internal Artifactory instance, create a remote repository pointing to the Virtual repository created in the step above
  • Make sure that the Chartbase URL is empty
  • In the Advanced Settings tab, Make sure the External Dependency Rewrite option is disabled

2. Create a Virtual Helm Legacy Repository
    • Assign the remote repository created in the previous step to a Virtual Repository
    • Ensure that the Remote Artifacts option is disabled

 

3. Using the Virtual Repository

Follow the Set Me Up instructions in the Artifactory UI when using the Virtual repository in your internal Artifactory instance. 

Please find an example of steps to configure the Helm client to work with the Virtual repository:

 

 

a. Adding the Helm repository:

helm repo add <VIRTUAL_REPOSITORY> http://ARTIFACTORY_HOST/artifactory/api/helm/<VIRTUAL_REPOSITORY> --username <username> --password <password>

For example:

helm repo add AIRGAPPED-helm-virtual http://ARTIFACTORY_HOST/artifactory/api/helm/AIRGAPPED-helm-virtual --username <username> --password <password>


b. Updating the Helm repository:

helm repo update


c. Pulling a chart from the repository, use the Helm pull command to pull charts from the  configured virtual repository:

helm pull <repo-name>/<chart-name> --version <chart-version>

For example:

helm pull AIRGAPPED-helm-virtual/k8sgpt-operator --debug