Skip to content

Commit

Permalink
chore: update linkinator comment (envoyproxy#3870)
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <[email protected]>
  • Loading branch information
zirain authored and zhaohuabing committed Jul 17, 2024
1 parent 995803c commit 4ba0de5
Show file tree
Hide file tree
Showing 5 changed files with 319 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/gatewayapi/securitypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (t *Translator) translateSecurityPolicyForGateway(
for _, r := range h.Routes {
// If any of the features are already set, it means that a more specific
// policy(targeting xRoute) has already set it, so we skip it.
if r.Security != nil {
if !r.Security.Empty() {
continue
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
gateways:
- apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
namespace: envoy-gateway
name: gateway-1
spec:
gatewayClassName: envoy-gateway-class
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: All
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: default
name: httproute-1
spec:
hostnames:
- gateway.envoyproxy.io
parentRefs:
- namespace: envoy-gateway
name: gateway-1
sectionName: http
rules:
- matches:
- path:
value: "/foo"
backendRefs:
- name: service-1
port: 8080
securityPolicies:
- apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
namespace: envoy-gateway
name: policy-for-gateway-1
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway-1
cors:
allowOrigins:
- "http://*.example.com"
- "http://foo.bar.com"
- "https://*"
allowMethods:
- GET
- POST
allowHeaders:
- "x-header-1"
- "x-header-2"
exposeHeaders:
- "x-header-3"
- "x-header-4"
maxAge: 1000s
jwt:
providers:
- name: example1
issuer: https://one.example.com
audiences:
- one.foo.com
remoteJWKS:
uri: https://one.example.com/jwt/public-key/jwks.json
claimToHeaders:
- header: one-route-example-key
claim: claim1
- apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
namespace: default
name: policy-for-route-1
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: httproute-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
gateways:
- apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
creationTimestamp: null
name: gateway-1
namespace: envoy-gateway
spec:
gatewayClassName: envoy-gateway-class
listeners:
- allowedRoutes:
namespaces:
from: All
name: http
port: 80
protocol: HTTP
status:
listeners:
- attachedRoutes: 1
conditions:
- lastTransitionTime: null
message: Sending translated listener configuration to the data plane
reason: Programmed
status: "True"
type: Programmed
- lastTransitionTime: null
message: Listener has been successfully translated
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: null
message: Listener references have been resolved
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
name: http
supportedKinds:
- group: gateway.networking.k8s.io
kind: HTTPRoute
- group: gateway.networking.k8s.io
kind: GRPCRoute
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
creationTimestamp: null
name: httproute-1
namespace: default
spec:
hostnames:
- gateway.envoyproxy.io
parentRefs:
- name: gateway-1
namespace: envoy-gateway
sectionName: http
rules:
- backendRefs:
- name: service-1
port: 8080
matches:
- path:
value: /foo
status:
parents:
- conditions:
- lastTransitionTime: null
message: Route is accepted
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: null
message: Resolved all the Object references for the Route
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parentRef:
name: gateway-1
namespace: envoy-gateway
sectionName: http
infraIR:
envoy-gateway/gateway-1:
proxy:
listeners:
- address: null
name: envoy-gateway/gateway-1/http
ports:
- containerPort: 10080
name: http-80
protocol: HTTP
servicePort: 80
metadata:
labels:
gateway.envoyproxy.io/owning-gateway-name: gateway-1
gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway
name: envoy-gateway/gateway-1
securityPolicies:
- apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
creationTimestamp: null
name: policy-for-route-1
namespace: default
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: httproute-1
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway-1
namespace: envoy-gateway
sectionName: http
conditions:
- lastTransitionTime: null
message: Policy has been accepted.
reason: Accepted
status: "True"
type: Accepted
controllerName: gateway.envoyproxy.io/gatewayclass-controller
- apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
creationTimestamp: null
name: policy-for-gateway-1
namespace: envoy-gateway
spec:
cors:
allowHeaders:
- x-header-1
- x-header-2
allowMethods:
- GET
- POST
allowOrigins:
- http://*.example.com
- http://foo.bar.com
- https://*
exposeHeaders:
- x-header-3
- x-header-4
maxAge: 16m40s
jwt:
providers:
- audiences:
- one.foo.com
claimToHeaders:
- claim: claim1
header: one-route-example-key
issuer: https://one.example.com
name: example1
remoteJWKS:
uri: https://one.example.com/jwt/public-key/jwks.json
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway-1
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway-1
namespace: envoy-gateway
conditions:
- lastTransitionTime: null
message: Policy has been accepted.
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: null
message: 'This policy is being overridden by other securityPolicies for these
routes: [default/httproute-1]'
reason: Overridden
status: "True"
type: Overridden
controllerName: gateway.envoyproxy.io/gatewayclass-controller
xdsIR:
envoy-gateway/gateway-1:
accessLog:
text:
- path: /dev/stdout
http:
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
metadata:
kind: Gateway
name: gateway-1
namespace: envoy-gateway
sectionName: http
name: envoy-gateway/gateway-1/http
path:
escapedSlashesAction: UnescapeAndRedirect
mergeSlashes: true
port: 10080
routes:
- destination:
name: httproute/default/httproute-1/rule/0
settings:
- addressType: IP
endpoints:
- host: 7.7.7.7
port: 8080
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
metadata:
kind: HTTPRoute
name: httproute-1
namespace: default
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
name: ""
prefix: /foo
security: {}
10 changes: 10 additions & 0 deletions internal/ir/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,16 @@ func (s *SecurityFeatures) Validate() error {
return errs
}

func (s *SecurityFeatures) Empty() bool {
return s == nil ||
(s.Authorization != nil &&
s.BasicAuth != nil &&
s.CORS != nil &&
s.ExtAuth != nil &&
s.OIDC != nil &&
s.JWT != nil)
}

// UnstructuredRef holds unstructured data for an arbitrary k8s resource introduced by an extension
// Envoy Gateway does not need to know about the resource types in order to store and pass the data for these objects
// to an extension.
Expand Down
9 changes: 4 additions & 5 deletions tools/make/docs.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
DOCS_OUTPUT_DIR := site/public
RELEASE_VERSIONS ?= $(foreach v,$(wildcard ${ROOT_DIR}/docs/*),$(notdir ${v}))
# TODO: github.com does not allow access too often, there are a lot of 429 errors
# find a way to remove github.com from ignore list
# TODO: example.com is not a valid domain, we should remove it from ignore list
LINKINATOR_IGNORE := "github.com githubusercontent.com example.com github.io _print"
CLEAN_NODE_MODULES ?= true

Expand Down Expand Up @@ -116,12 +119,8 @@ docs-release-gen:
@echo ' url = "/$(DOC_VERSION)"' >> site/hugo.toml

.PHONY: docs-check-links
docs-check-links:
docs-check-links: # Check for broken links in the docs
@$(LOG_TARGET)
# Check for broken links, right now we are focusing on the v1.0.0
# github.com does not allow access too often, there are a lot of 429 errors
# TODO: find a way to remove github.com from ignore list
# TODO: example.com is not a valid domain, we should remove it from ignore list
linkinator site/public/ -r --concurrency 25 --skip $(LINKINATOR_IGNORE)

release-notes-docs: $(tools/release-notes-docs)
Expand Down

0 comments on commit 4ba0de5

Please sign in to comment.