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.