Skip to content

Commit

Permalink
Merge pull request #736 from robscott/policy-implementation
Browse files Browse the repository at this point in the history
Implementing policy attachment GEP
  • Loading branch information
k8s-ci-robot authored Aug 11, 2021
2 parents 8a16b18 + f35e993 commit 73456c6
Show file tree
Hide file tree
Showing 23 changed files with 381 additions and 280 deletions.
60 changes: 60 additions & 0 deletions apis/v1alpha2/policy_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha2

// PolicyTargetReference identifies an API object to apply policy to. This
// should be used as part of Policy resources that can target Gateway API
// resources. For more information on how this policy attachment model works,
// and a sample Policy resource, refer to the policy attachment documentation
// for Gateway API.
type PolicyTargetReference struct {
// Group is the group of the target resource.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Group string `json:"group"`

// Kind is kind of the target resource.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Kind string `json:"kind"`

// Name is the name of the target resource.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Name string `json:"name"`

// Namespace is the namespace of the referent. When unspecified, the local
// namespace is inferred. Even when policy targets a resource in a different
// namespace, it MUST only apply to traffic originating from the same
// namespace as the policy.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +optional
Namespace *string `json:"namespace,omitempty"`

// ClassName is the name of the class this policy should apply to. When
// unspecified, the policy will apply to all classes that support it.
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +optional
ClassName *string `json:"className,omitempty"`
}
25 changes: 25 additions & 0 deletions apis/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site-src/geps/gep-713.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GEP-713: Policy Attachment

* Issue: [#713](https://github.com/kubernetes-sigs/gateway-api/issues/713)
* Status: Implementable
* Status: Implemented

## TLDR

Expand Down
1 change: 1 addition & 0 deletions site-src/images
Binary file removed site-src/images/api-model.png
Binary file not shown.
Binary file removed site-src/images/gateway-roles.png
Binary file not shown.
Binary file removed site-src/images/gateway-route-binding.png
Binary file not shown.
Binary file removed site-src/images/http-routing.png
Binary file not shown.
1 change: 0 additions & 1 deletion site-src/images/httproute-basic-example.svg

This file was deleted.

275 changes: 0 additions & 275 deletions site-src/images/schema-uml.svg

This file was deleted.

Binary file removed site-src/images/simple-split.png
Binary file not shown.
Binary file removed site-src/images/single-service-gateway.png
Binary file not shown.
3 changes: 0 additions & 3 deletions site-src/images/tls-overview.svg

This file was deleted.

Binary file removed site-src/images/traffic-splitting-1.png
Binary file not shown.
Binary file removed site-src/images/traffic-splitting-2.png
Binary file not shown.
Binary file removed site-src/images/traffic-splitting-3.png
Binary file not shown.
Binary file added site-src/v1alpha2/images/policy/hierarchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site-src/v1alpha2/images/policy/mesh-complex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site-src/v1alpha2/images/policy/mesh-simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 73456c6

Please sign in to comment.