GithubHelp home page GithubHelp logo

networking's Introduction

knative/networking

This repository contains the Knative Ingress and Certificate CRDs, as well as their conformance tests. These are our extension points to plugin different Ingress plugins (Ambassador, Contour, Gloo, Istio, Kong and Kourier), as well as different ExternalDomainTLS plugins (CertManager and Knative's own HTTP01 challenge solver).

Knative Ingress aka KIngress

The Knative Ingress CRD is based on the Kubernetes Ingress CRD, with the following additions:

  1. Traffic splitting
  2. Header modification applied to requests based on the traffic split they are assigned to.
  3. Host header rewrite
  4. Traffic redirection predicates based on a regexp based condition on headers.

In addition to these, we previously added Timeout and Retry settings but no longer used them and may deprecate these parts in future versions.

See https://knative.dev/docs/install/yaml-install/serving/install-serving-with-yaml/#install-a-networking-layer for a list of the current supported KIngress implementations.

Check out:

See also:

Knative Certificate aka KCert

Knative Certificate CRD is a Knative abstraction for various SSL certificate provisioning solutions (such as cert-manager or self-signed SSL certificate).

Check out:

Contributing

If you would like to contribute to Knative, take a look at CLOTRIBUTOR for a list of help wanted issues across the project.

networking's People

Contributors

andrew-su avatar arghya88 avatar davidhadas avatar dprotaso avatar evankanderson avatar greghaynes avatar impl avatar jonjohnsonjr avatar jpeach avatar jrbancel avatar julz avatar k4leung4 avatar kauzclay avatar knative-automation avatar lichuqiang avatar markusthoemmes avatar mattmoor avatar mattmoor-sockpuppet avatar mdemirhan avatar nader-ziada avatar nak3 avatar psschwei avatar rafaeltello avatar retocode avatar rmoe avatar savitaashture avatar shashwathi avatar tcnghia avatar vagababov avatar wtam2018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

networking's Issues

"--enable-alpha" option must implement all alpha features

When we use --enable-alpha flag, all alpha tests are included.
For example in the current alpha tests:

if test.ServingFlags.EnableAlphaFeatures {
// Add your conformance test for alpha features
t.Run("headers/tags", TestTagHeaders)
t.Run("host-rewrite", TestRewriteHost)
}

we want to run TestTagHeaders but we did not implement TestRewriteHost yet. In this case, we need to give up both tests to run.

Add a flag to control future trust support

Current tls implementation support internal-encryption without trust
We need to have a roadmap for one with mutual trust which seems achievable using a number of future steps.

Add flag for InternalTrust bool in knative.dev/networking/pkg/config/config.go so we can start alpha it.

/assign davidhadas

Visibility test (proxy image) fails with KinD 0.12.0 + k8s 1.23.x due to DNS issue

When trying to upgrade KinD to 0.12.0, k8s 1.23.x always fails with the following error:

https://github.com/knative-sandbox/net-contour/actions/runs/2164723487
https://github.com/knative-sandbox/net-kourier/actions/runs/2164695709

              lookup ingress-conformance-visibility-path-ijgjgogt.serving-tests.svc.c2164695709.local on 10.96.0.10:53: server misbehaving

For now, the issue happens as:

  • All k8s 1.23.x fails with KinD 0.12.0.
  • All net-* repo fails with k8s 1.23.x + KinD 0.12.0.
  • All k8s 1.23.x does NOT fail with KinD 0.11.1.

Autotls issues with venafi

I tried to set up auto tls with venafi tpp instead of let encrypt and acme. I get the below error

'Failed to request venafi certificate: Certificate requests submitted to Venafi issuers must have the ''commonName'' field or at least one other subject field set.'

I checked the csr, it just had the SAN. For venafi looks like CN is required, please refer to this issue.

Is there anyway we can include common name in the certificate resource.

Deprecate ingress.status.LoadBalancer

There are three LB status in ingress.status, LoadBalancer, PublicLoadBalancer and PrivateLoadBalancer.

// LoadBalancer contains the current status of the load-balancer.
// This is to be superseded by the combination of `PublicLoadBalancer` and `PrivateLoadBalancer`
// +optional
LoadBalancer *LoadBalancerStatus `json:"loadBalancer,omitempty"`
// PublicLoadBalancer contains the current status of the load-balancer.
// +optional
PublicLoadBalancer *LoadBalancerStatus `json:"publicLoadBalancer,omitempty"`
// PrivateLoadBalancer contains the current status of the load-balancer.
// +optional
PrivateLoadBalancer *LoadBalancerStatus `json:"privateLoadBalancer,omitempty"`

PublicLoadBalancer and PrivateLoadBalancer make sense but LoadBalancer does not in the status field.

some research in the current KIngress implementations

net-istio and net-kourier

  • external LB or internal LB is assigned in the LoadBalancer based on ingress.Spec.Visibility. But ingress.Spec.Visibility was deprecated.

net-contour

  • net-contour does not use it and always set LoadBalancer to nil.

Deprecate retry

I believe that route has stopped specifying this, but we still have tests for it which run a pretty sizable matrix of now unexercised functionality.

Consider deprecating the field, and removing the conformance tests.

/assign @tcnghia
/kind cleanup

Support post-split RewriteHost

In order to target ExternalName services that rely on Host-based dispatch (the way we do for ksvc), we essentially need to support rewriting every service reference to it's internal hostname in order for it to correctly receive traffic.

We can work around this today for the trivial vanity domain case because we can put the RewriteHost pre-split, since there's a single split, however, if we wanted to correctly traffic split over two ksvc with kingress, then we could not do that with the kingress we have today.

cc @julz @tcnghia

Related: #107
This would need some extension: knative-extensions/net-contour#220

Drop deprecated generation field

ie.

// DeprecatedGeneration was used prior in Kubernetes versions <1.11
// when metadata.generation was not being incremented by the api server
//
// This property will be dropped in future Knative releases and should
// not be used - use metadata.generation
//
// Tracking issue: https://github.com/knative/serving/issues/643
//
// +optional
DeprecatedGeneration int64 `json:"generation,omitempty"`

Knative istio client ip is not working

Hi,
I am using istio in knative. Since the client ip did not come, I activated the reverse-prox. I added envoyfilter. but I get "upstream connect error or disconnect/reset before headers. reset reason: connection termination" error in services on knative.
if it's not knative service I can access it.

virtualservice


apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test-entry-route
namespace: default
spec:
gateways:
- knative-serving/knative-ingress-gateway
hosts:
- "test.net"
http:
- match:
- uri:
prefix: /test/ #working
rewrite:
uri: /
route:
- destination:
host: user-api.test.svc.cluster.local
port:
number: 80
- match:
- uri:
prefix: /user/ #not working
route:
- destination:
host: istio-ingressgateway.istio-system.svc.cluster.local
port:
number: 80
weight: 100
rewrite:
authority: user-api.poker-test.k8s.test.net
uri: /

EnvoyFilter


apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: proxy-protocol
namespace: istio-system
spec:
configPatches:
- applyTo: LISTENER
patch:
operation: MERGE
value:
listener_filters:
- name: envoy.listener.proxy_protocol
- name: envoy.listener.tls_inspector
workloadSelector:
labels:
istio: ingressgateway

service load balancer


annotations:
service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
externalTrafficPolicy: Local

Annotation validation for networking.knative.dev

/kind good-first-issue

Currently we validate that users can't create resources with annotations with the serving.knative.dev prefix in the validateKnativeAnnotations. We currently don't appear to have any such validation for the networking.knative.dev prefix.

I see two useful things to get out of this:

  • We can create a file similar to annotation_validation in autoscaler, which performs validation on all the annotations owned by autoscaler, including validating the values of the annotations themselves.
  • We could modify the validateKnativeAnnotations to validate all annotation prefixes owned by knative. I suspect this gap exists for other annotation groups as well.

Moved from knative/serving#9192

Add Retry Checker for conformance test's request?

Currently conformance test for net-* is flaky due to some test failed with connection reset by peer or connection refused.

Example logs:

Serving repo has a response checker and so it does not stop e2e tests by the TCP errors.

https://github.com/knative/serving/blob/ab2fcc63551eecc408deef6e5f06b4defbd46e12/vendor/knative.dev/pkg/test/spoof/spoof.go#L167

So should networking conformance test also implement the retry checker which is same with Serving?

Bogus README.md

The root /README.md hasn't been updated since the fork from sample-controller, so it isn't appropriate to the repo.

Document how to write a plugin that fulfils the KIngress spec

Describe the change you'd like to see

I received some feedback along the lines:

I think its still hard to understand integrating with [Knative]

Looking for some docs related to the internal pluggable types ie. KIngress I couldn't find any. We should aim to have some documentation around these types and maybe even some examples.

Intermittent 502s during "visibility/split"

I was originally tracking this in knative-extensions/net-contour#189, but have also seen this in net-istio and net-kourier.

They basically all fail on a DNS lookup (:53 is DNS):

    util.go:860: Error meeting response expectations: got unexpected status: 502, expected map[200:{}]
    util.go:860: HTTP/1.1 502 Bad Gateway
        Content-Length: 164
        Content-Type: text/plain; charset=utf-8
        Date: Wed, 12 Aug 2020 09:37:18 GMT
        Server: istio-envoy
        X-Content-Type-Options: nosniff
        X-Envoy-Upstream-Service-Time: 8
        
        dial tcp: lookup ingress-conformance-visibility-split-pxtddfbt.serving-tests.svc.cluster.local on 10.11.240.10:53: dial udp 10.11.240.10:53: operation was canceled

cc @tcnghia

net-* should have consistent naming

Avoid the Go iterator capture issue

Issue

When table test is running with t.Parallel() like below, the variable tt needs to be created by a new variable before t.Parallel(). Otherwise all tests use the same instance as https://golang.org/doc/faq#closures_and_goroutines.

        for _, tt := range tests {
                t.Run(tt.name, func(t *testing.T) {
                        t.Parallel()

Reproducer

For example, I verified that the issue by inserting a debug log as:

diff --git a/test/conformance/ingress/visibility.go b/test/conformance/ingress/visibility.go
index 77e4b36e..f7d17e34 100644
--- a/test/conformance/ingress/visibility.go
+++ b/test/conformance/ingress/visibility.go
@@ -363,6 +363,7 @@ func TestVisibilityPath(t *testing.T) {
        for path, want := range tests {
                t.Run(path, func(t *testing.T) {
                        t.Parallel()
+                       fmt.Printf("[debug] path %q, want %q\n", path, want)

                        ri := RuntimeRequest(ctx, t, client, "http://"+publicHostName+path)
                        if ri == nil {

Then, all tests in the table test uses the last variable /asdf only. (Please find [debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou")

$ go test -v   -tags=e2e -count=1  ./test/conformance/...  -run "TestIngressConformance/visibility/path" --ingressendpoint=172.20.0.3  --ingressClass=kourier.ingress.networking.knative.dev --enable-beta
 ...
=== RUN   TestIngressConformance/visibility/path//foo
=== PAUSE TestIngressConformance/visibility/path//foo
=== RUN   TestIngressConformance/visibility/path//bar
=== PAUSE TestIngressConformance/visibility/path//bar
=== RUN   TestIngressConformance/visibility/path//baz
=== PAUSE TestIngressConformance/visibility/path//baz
=== RUN   TestIngressConformance/visibility/path/#00
=== PAUSE TestIngressConformance/visibility/path/#00
=== RUN   TestIngressConformance/visibility/path//asdf
=== PAUSE TestIngressConformance/visibility/path//asdf
=== CONT  TestIngressConformance/visibility/path//foo
[debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou"
=== CONT  TestIngressConformance/visibility/path/#00
[debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou"
=== CONT  TestIngressConformance/visibility/path//asdf
[debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou"
=== CONT  TestIngressConformance/visibility/path//baz
[debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou"
=== CONT  TestIngressConformance/visibility/path//bar
[debug] path "/asdf", want "ingress-conformance-visibility-path-dvfrawou"
=== CONT  TestIngressConformance/visibility/path

The test expects different five cases.

tests := map[string]string{
"/foo": fooName,
"/bar": barName,
"/baz": bazName,
"": mainName,
"/asdf": mainName,
}

Document compatibility of knative/serving and knative/net-* versions

Since we follow the 6-month deprecation policy, any knative/serving version should work with a net-xxx version released 6 months ago, i.e. backward compatibility.

However, I am not sure we have any guarantee the other way around. Since we only get testing of knative/serving version 0.X.y with knative-sandbox/net-* version 0.X.z, the only forward compatibility is just with patch versions.

I'd love to see some confirmation from @nak3 @ZhiminXiang @mattmoor about this, following by some documentations.

Thanks @houshengbo who raised this very interesting question.

Add mechanism to override the scheme used for Knative routes

Currently, the ability to surface a https:// fronted URL in Knative is bound to the AutoTLS feature. AutoTLS however hooks itself directly into the ingress flow and might not be applicable in all situations. If you were to front the Knative Ingress with an external loadbalancer that's doing the termination for instance, the Route would still be available via HTTPS but we wouldn't enable AutoTLS to achieve that.

As such, I'd love to have a mechanism to override the scheme Knative thinks is appropriate. This could be as simple as adding overrideExternalScheme and overrideInternalScheme to config-network to allow to override the respective URLs published. There could be similarly named annotations as well to override per-service. Initially proposed here knative/serving#7708 (comment).

Require kingress to implement the dataplane contract

We should add a kingress conformance test that validates conformance to our dataplane contract.

Base Case

If we send:

K-Network-Probe: probe
K-Network-Hash: override

Then we should get back a response with K-Network-Hash: {hash reflecting config}.

Inductive Step

If we send:

K-Network-Probe: probe
K-Network-Hash: {hex}

Then we should get back a response with K-Network-Hash: {hex}.


This verifies that we can enable composition of kingress using ExternalName services.

Retry Get requests

Use the new reconciler.RetryTestErrors (see: #145) to wrap Get requests in kingress conformance.

I saw this on a recent net-contour test run:

percentage.go:47: Error waiting for Endpoints to contain a Pod IP: rpc error: code = Unavailable desc = etcdserver: leader changed

Cleanup test flags naming

We have 3 kinds of flag names:

  • resolvabledomain -> ResolvableDomain
  • enable-alpha -> enableAlpha
  • ingressClass -> ingressClass

Would be nice to use same style, so test writers don't have to be confused about which way is right.

Clean up DeprecatedDefaultIngressClassKey

clusteringress.class was deprecated for a long time ago, we should clean up DeprecatedDefaultIngressClassKey and related code like:

// DeprecatedDefaultIngressClassKey Please use DefaultIngressClassKey instead.
DeprecatedDefaultIngressClassKey = "clusteringress.class"

/kind good-first-issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.