MajinMo
MajinMo

Reputation: 551

kubectl config set proxy

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"

Upvotes: 14

Views: 16915

Answers (2)

mathe_matician
mathe_matician

Reputation: 109

Update the cluster in your kube-config to use proxy-url:

kubectl config set clusters.dev.proxy-url <proxy-url>

https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy

kubectl config set --help or https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_config_set/

Upvotes: 2

MajinMo
MajinMo

Reputation: 551

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"
    ...

Upvotes: 34

Related Questions