Set proxy config for PMK Clusters
Problem
kubectl logs results in Error forbidden when PMK cluster is created using Proxy.
Environment
- Issue resolved in Platform9 Managed Kubernetes 5.9
Resolution
Note : This solution will only work for Platform9 Managed Kubernetes 5.9 and above
Way to avoid landing into the proxy issues:
- Onboard node to DU
- Run
pf9ctl set-proxycommand on the node
pf9ctl set-proxy --protocol http --host-ip 10.149.107.44 --port 3128 --no-proxy 10.149.106.249,10.149.106.198
In above command --no-proxy takes ip addresses of worker nodes.
- Now create cluster, you will not see forbidden error for
kubectl logscommand.
Way to resolve this on existing cluster which is already behind proxy:
- SSH to master node
- Run
pf9ctl set-proxycommand like above and pass IPs or subnet of worker nodes to--no-proxyflag - Stop
pf9-hostagentandpf9-nodeletdservices
systemctl stop pf9-hostagent.service pf9-nodeletd.service
- Restart
Prepare configurationphase
/opt/pf9/nodelet/nodeletd phases restart --single -p 2
It will restart prepare configuration phase and it will append worker ips to no_proxy var in master.yaml
Note : It will restart kube-apiserver , kube-scheduler and kube-controller-manager
- Start
pf9-hostagentandpf9-nodeletdservices
systemctl start pf9-hostagent.service pf9-nodeletd.service
- Verify
kubectl logscommand. you will not see forbidden error forkubectl logscommand.
Was this page helpful?