ARTIFACTORY: Best practice configuring Helm smart remote repository

ARTIFACTORY: Best practice configuring Helm smart remote repository

AuthorFullName__c
Sai Undurthi
articleNumber
000005536
ft:sourceType
Salesforce
FirstPublishedDate
2023-01-01T10:29:01Z
lastModifiedDate
2023-01-22T11:10:26Z
VersionNumber
3

This article talks about best practices that we should implement while configuring a Smart remote repository with Helm.

It is a common practice to use reverse proxies with port while setting up On-premise Artifactory instances. Overriding the port in reverseProxy configuration in config descriptor as shown below is how one would configure:

Note: This applies only when hardcoding the port in ReverseProxy section

 <reverseProxies>
        <reverseProxy>
            <key>nginx</key>
            <webServerType>nginx</webServerType>
            <artifactoryAppContext>artifactory</artifactoryAppContext>
            <publicAppContext>artifactory</publicAppContext>
            <serverName>server.artifactory.com</serverName>
            <serverNameExpression xsi:nil="true"/>
            <sslCertificate xsi:nil="true"/>
            <sslKey xsi:nil="true"/>
            <dockerReverseProxyMethod>portPerRepo</dockerReverseProxyMethod>
            <useHttps>false</useHttps>
            <useHttp>true</useHttp>
            <sslPort>443</sslPort>

When we do so and reach the on-prem environment with "443" (as can be seen in the "reverseProxies" section in the config.xml), we have to align the remote repo config in the target Artifactory instance to have the port mentioned as well.

For example:

Even though 443 is default port for https you’d need to configure the target Artifactory instance remote repository to be "https://server.artifactory.com:443/artifactory/helm/" instead of
"https://server.artifactory.com/artifactory/helm/".

Absence of doing that can cause the “index.yaml” file in target remote repository to not be overwritten with target Artifactory URL.