Proxy Sidecar with Kubernetes
This guide explains how to deploy the Qpoint Proxy as a sidecar container in your Kubernetes pods. This approach allows you to route traffic through the Qpoint Proxy for individual pods without needing to deploy it as a separate service.
We'll skip Certificate Installation in this guide. See the Kubernetes Connect guide for additional information on how to supply certificates.
Prerequisites
Kubernetes cluster
kubectl
command-line toolQpoint registration token
Create a Kubernetes Secret for the Registration Token
Instead of passing the registration token directly in the pod specification, we'll create a Kubernetes Secret to store it securely:
Save this as qpoint-secret.yaml
and apply it:
Create the Pod Specification
Here's an example pod specification that includes the Qpoint Proxy as a sidecar:
Note: The main container also needs the NET_ADMIN capability for the iptables rules to take effect.
Save this as qpoint-sidecar-pod.yaml
.
Deploy the Pod
Apply the pod specification:
Verify the Deployment
Check if the pod is running:
You should see the pod in the "Running" state with 2/2 containers ready.
Testing the Proxy
To test if the proxy is working, you can exec into the main container and make a request:
Once inside the container, you can use curl to make a request:
This request should be routed through the Qpoint Proxy sidecar.
Notes
The
qpoint-init
container sets up iptables rules to route traffic through the proxy.The main container and the proxy container both have the
NET_ADMIN
capability to allow network configuration.The registration token is securely stored in a Kubernetes Secret and injected into the proxy container as an environment variable.
Adjust the
PORT_MAPPING
,ACCEPT_UIDS
, andACCEPT_GIDS
in theqpoint-init
container as needed for your specific use case. Qproxy always runs as User / Group 1010.You may need to adjust resource requests and limits for the proxy container based on your requirements.
This setup allows you to use the Qpoint Proxy on a per-pod basis, giving you fine-grained control over which pods use the proxy.
Last updated