Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl config set proxy

Tags:

proxy

kubectl

I can't connect to my cluster servers directly. How can I set HTTP_PROXY in kubectl configfile? Using kubectl for windows.

apiVersion: v1
kind: Config
clusters:
- name: "dev"
  cluster:
    server: "https://10.100.12.12:9006/k8s/clusters/c-jm5ws"
    certificate-authority-data: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJoekNDQ\
      VM2Z0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQTdNUnd3R2dZRFZRUUtFeE5rZVc1aGJXbGoKY\
      kdsemRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR1Z1WlhJdFkyRXdIa"
like image 309
MajinMo Avatar asked Mar 09 '21 10:03

MajinMo


People also ask

What is kubectl proxy command?

kubectl proxy –www=/my/files –www-prefix=/static/ –api-prefix=/api/ The above lets you 'curl localhost:8001/api/v1/pods'. To proxy the entire kubernetes api at a different root, use: kubectl proxy –api-prefix=/custom/ The above lets you 'curl localhost:8001/custom/api/v1/pods'

What is proxy in Kubernetes?

kube-proxy is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept. kube-proxy maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.


Video Answer


1 Answers

very hard to find on google.. but found the solution:

apiVersion: v1
kind: Config
clusters:
- name: "dev"
  cluster:
    proxy-url: http://user:password@proxy:port
    server: "https://10.100.12.12:9006/k8s/clusters/c-jm5ws"
    ...
like image 62
MajinMo Avatar answered Oct 19 '22 19:10

MajinMo