Skip to content

Knative http proxy sample #365

@zrss

Description

@zrss

Expected Behavior

I just successfully run a knative-serving in a private network kubernetes cluster for running the demo of helloworld-go

As i know the controller of knative-serving nees https_proxy, http_proxy and no_proxy env being set in its deployment.yaml env so that it can access the docker registry to get the digest of the image

u can check this code

https://github.com/knative/serving/blob/bfb3f5181b5ff18e4a16e9c158e8b9102404399c/pkg/reconciler/v1alpha1/revision/revision.go#L427-L431

and find out the comment about http.DefaultTransport

// DefaultTransport is the default implementation of Transport and is
// used by DefaultClient. It establishes network connections as needed
// and caches them for reuse by subsequent calls. It uses HTTP proxies
// as directed by the $HTTP_PROXY and $NO_PROXY (or $http_proxy and
// $no_proxy) environment variables.

i suppose there should be somewhere to mention this (or how to run knative in a private network) in docs

Actual Behavior

u can set the http proxy env in controller deploy yaml of knative-serving namespace

      - env:
        - name: http_proxy
          value: ...
        - name: https_proxy
          value: ...
        - name: no_proxy
          value: ...

and no_proxy should add the svc kubernetes cluster-ip (for example 10.96.0.1)

root@kubeadm-master-01:~# kubectl get svc 
NAME            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
helloworld-go   ClusterIP   10.107.116.79   <none>        80/TCP    6h
kubernetes      ClusterIP   10.96.0.1       <none>        443/TCP   1d

Steps to Reproduce the Problem

https://github.com/knative/docs/blob/master/install/Knative-with-any-k8s.md

Additional Info

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions