If you have an HTTP proxy, you will need to configure the runner to use your proxy when downloading and uploading artefacts:
yarn add hpagent
custom-proxy-config.js
const { HttpsProxyAgent } = require('hpagent');
const proxyConfig = (nxDefaultConfig) => ({
...nxDefaultConfig,
proxy: false,
httpsAgent: new HttpsProxyAgent({
proxy: 'https://your-customproxy.com:4042', // <-- enter your custom proxy details here
ca: [""], // <-- optional path to a certificate authority
rejectUnauthorized: false // <-- set this to false if you want it to ignore invalid certificate warnings
})
});
module.exports = {
nxCloudProxyConfig: proxyConfig,
fileServerProxyConfig: proxyConfig
}
Point the nx-cloud runner to your custom config:
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"accessToken": "…..",
"cacheableOperations": [
….
],
"url": "….",
"customProxyConfigPath": "./custom-proxy-config.js" <--- here
}
}
},
If you have an internal cluster but are using an external S3 bucket, then your proxy might block connections from the NxAPI to your S3 bucket. The same issue will happen with connection to your Github/Gitlab instance.
For that, you can try forcing the connection to bypass the proxy by setting the NO_PROXY=amazonaws.com,your-github-instance.com
env var on your
NxAPI pods.
If you are using a self-hosted Gitlab or Github instance, or a proxy, you will need to provide the extra CAs to NxCloud pods.
Upload your cert as a ConfigMap
kubectl create configmap self-signed-certs --from-file=self-signed-cert.crt=./cert.pem
Point your Helm values to the config map:
selfSignedCertConfigMap: 'self-signed-certs'