Configure Stork for Proxy Server
This topic explains how to configure Stork in application cluster to communicate through a network proxy in environments that require it. Depending on your setup, you may use:
-
A proxy with authentication or a custom CA
-
An unauthenticated proxy without a custom CA
With Portworx
Option 1: Authenticated Proxy or Custom CA
If your proxy requires a username/password or uses a non-public CA, follow the steps below.
-
Create a Kubernetes Secret in your Stork deployed namespace containing your proxy settings and optional CA certificate:
kubectl create secret generic <your-proxy-secret-name> \--from-literal=HTTP_PROXY=<authenticated-proxy-url> \--from-literal=HTTPS_PROXY=<authenticated-proxy-url> \--from-literal=NO_PROXY="10.0.0.0/8, <internal-domains>,<cluster-ips>" \--from-file=CA=/path/to/ca.crtReplace
<your-proxy-secret-name>with any valid proxy secret name. Replace<authenticated-proxy-url>with your actual proxy URL, typically in the formatusername:password@host:port. The proxy URL can use either the http or https scheme, depending on your setup. -
Update StorageCluster with Proxy secret. Reference the secret in the StorageCluster spec for Stork:
stork:enabled: trueargs:webhook-controller: "true"env:- name: http_proxyvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: HTTP_PROXY- name: https_proxyvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: HTTPS_PROXY- name: HTTP_PROXYvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: HTTP_PROXY- name: HTTPS_PROXYvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: HTTPS_PROXY- name: NO_PROXYvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: NO_PROXY- name: no_proxyvalueFrom:secretKeyRef:name: <your-proxy-secret-name>key: NO_PROXY- name: SSL_CERT_DIRvalue: /etc/ssl/certs:/etc/ssl/certs/proxyimage: <your-stork-image>volumes:- name: proxy-ca-volumesecret:secretName: <your-proxy-secret-name>items:- key: CApath: proxy-ca.pemoptional: truedefaultMode: 420mountPath: /etc/ssl/certs/proxy
Option 2: Unauthenticated Proxy (No Custom CA)
-
If your proxy does not require authentication and uses a public or default-trusted CA. You can configure proxy settings directly without a secret.
Sample StorageCluster Configuration:
stork:enabled: trueargs:webhook-controller: "true"env:- name: http_proxyvalue: <proxy-url>- name: https_proxyvalue: <proxy-url>- name: HTTP_PROXYvalue: <proxy-url>- name: HTTPS_PROXYvalue: <proxy-url>- name: NO_PROXYvalue: "10.0.0.0/8,<internal-domains>,<cluster-ips>"- name: no_proxyvalue: "10.0.0.0/8,<internal-domains>,<cluster-ips>"image: <your-stork-image>
If you have Portworx deployment in the application cluster (if the application cluster contains Portworx volumes), you need to add Portworx internal services (.portworx, .portworx-api) to the NO_PROXY/no_proxy ENV values.
Without Portworx
Option 1: Authenticated Proxy or Custom CA
If your proxy requires a username/password or uses a non-public CA, follow the steps below.
-
Create a Kubernetes Secret in your Stork deployed namespace containing your proxy settings and optional CA certificate:
kubectl create secret generic <your-proxy-secret-name> \--from-literal=HTTP_PROXY=<authenticated-proxy-url> \--from-literal=HTTPS_PROXY=<authenticated-proxy-url> \--from-literal=NO_PROXY="10.0.0.0/8, <internal-domains>,<cluster-ips>" \--from-file=CA=/path/to/ca.crtReplace
<your-proxy-secret-name>with any meaningful name. Replace<authenticated-proxy-url>with your actual proxy URL, typically in the formatusername:password@host:port. The proxy URL can use either the http or https scheme, depending on your setup. -
Edit the Stork deployment:
kubectl edit deployment stork -n <stork-namespace> -
Add the required proxy environment variables:
env:- name: HTTPS_PROXYvalueFrom:secretKeyRef:key: HTTPS_PROXYname: <your-proxy-secret-name>- name: HTTP_PROXYvalueFrom:secretKeyRef:key: HTTP_PROXYname: <your-proxy-secret-name>- name: http_proxyvalueFrom:secretKeyRef:key: HTTP_PROXYname: <your-proxy-secret-name>- name: https_proxyvalueFrom:secretKeyRef:key: HTTPS_PROXYname: <your-proxy-secret-name>- name: no_proxyvalueFrom:secretKeyRef:key: NO_PROXYname: <your-proxy-secret-name>- name: NO_PROXYvalueFrom:secretKeyRef:key: NO_PROXYname: <your-proxy-secret-name>- name: SSL_CERT_DIRvalue: /etc/ssl/certs:/etc/ssl/certs/proxy -
Add volume mounts:
volumeMounts:- mountPath: /etc/ssl/certs/proxyname: user-proxy-ca-volume -
Add a volume:
volumes:- name: user-proxy-ca-volumesecret:defaultMode: 420items:- key: CApath: proxy-ca.pemoptional: truesecretName: <your-proxy-secret-name> -
Save the changes and wait for the Stork pods to restart.
Option 2: Unauthenticated Proxy (No Custom CA)
If your proxy does not require authentication and uses a public or default-trusted CA. You can configure proxy settings directly without a secret,follow the steps below.
-
Edit the Stork deployment:
kubectl edit deployment stork -n <stork-namespace> -
Add the required proxy environment variables:
env:- name: HTTPS_PROXYvalue: <proxy-url>- name: HTTP_PROXYvalue: <proxy-url>- name: http_proxyvalue: <proxy-url>- name: https_proxyvalue: <proxy-url>- name: no_proxyvalue: "10.0.0.0/8,<internal-domains>,<cluster-ips>"- name: NO_PROXYvalue: "10.0.0.0/8,<internal-domains>,<cluster-ips>"
Related Topics