Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a5e23ef5
Commit
a5e23ef5
authored
Sep 17, 2015
by
Jian Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ingress API Resource Type for L7 loadbalancing
parent
cad5f033
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
0 deletions
+162
-0
register.go
pkg/apis/experimental/register.go
+4
-0
types.go
pkg/apis/experimental/types.go
+77
-0
register.go
pkg/apis/experimental/v1/register.go
+4
-0
types.go
pkg/apis/experimental/v1/types.go
+77
-0
No files found.
pkg/apis/experimental/register.go
View file @
a5e23ef5
...
@@ -42,6 +42,8 @@ func addKnownTypes() {
...
@@ -42,6 +42,8 @@ func addKnownTypes() {
&
DaemonSet
{},
&
DaemonSet
{},
&
ThirdPartyResourceData
{},
&
ThirdPartyResourceData
{},
&
ThirdPartyResourceDataList
{},
&
ThirdPartyResourceDataList
{},
&
Ingress
{},
&
IngressList
{},
)
)
}
}
...
@@ -59,3 +61,5 @@ func (*DaemonSet) IsAnAPIObject() {}
...
@@ -59,3 +61,5 @@ func (*DaemonSet) IsAnAPIObject() {}
func
(
*
DaemonSetList
)
IsAnAPIObject
()
{}
func
(
*
DaemonSetList
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceData
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceData
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceDataList
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceDataList
)
IsAnAPIObject
()
{}
func
(
*
Ingress
)
IsAnAPIObject
()
{}
func
(
*
IngressList
)
IsAnAPIObject
()
{}
pkg/apis/experimental/types.go
View file @
a5e23ef5
...
@@ -462,3 +462,80 @@ type JobCondition struct {
...
@@ -462,3 +462,80 @@ type JobCondition struct {
// Human readable message indicating details about last transition.
// Human readable message indicating details about last transition.
Message
string
`json:"message,omitempty"`
Message
string
`json:"message,omitempty"`
}
}
// An Ingress is a way to give services externally-reachable urls. Each Ingress is a
// collection of rules that allow inbound connections to reach the endpoints defined by
// a backend.
type
Ingress
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
api
.
ObjectMeta
`json:"metadata,omitempty"`
// Spec is the desired state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Spec
IngressSpec
`json:"spec,omitempty"`
// Status is the current state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Status
IngressStatus
`json:"status,omitempty"`
}
// IngressList is a collection of Ingress.
type
IngressList
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
unversioned
.
ListMeta
`json:"metadata,omitempty"`
// Items is the list of Ingress.
Items
[]
Ingress
`json:"items"`
}
// IngressSpec describes the Ingress the user wishes to exist.
type
IngressSpec
struct
{
// TODO: Add the ability to specify load-balancer IP just like what Service has already done?
// A list of rules used to configure the Ingress.
// http://<host>:<port>/<path>?<searchpart> -> IngressBackend
// Where parts of the url conform to RFC 1738.
Rules
[]
IngressRule
`json:"rules"`
}
// IngressStatus describe the current state of the Ingress.
type
IngressStatus
struct
{
// LoadBalancer contains the current status of the load-balancer.
LoadBalancer
api
.
LoadBalancerStatus
`json:"loadBalancer,omitempty"`
}
// IngressRule represents the rules mapping the paths under a specified host to the related backend services.
type
IngressRule
struct
{
// Host is the fully qualified domain name of a network host, or its IP
// address as a set of four decimal digit groups separated by ".".
// Conforms to RFC 1738.
Host
string
`json:"host,omitempty"`
// Paths describe a list of load-balancer rules under the specified host.
Paths
[]
IngressPath
`json:"paths"`
}
// IngressPath associates a path regex with an IngressBackend.
// Incoming urls matching the Path are forwarded to the Backend.
type
IngressPath
struct
{
// Path is a regex matched against the url of an incoming request.
Path
string
`json:"path,omitempty"`
// Define the referenced service endpoint which the traffic will be forwarded to.
Backend
IngressBackend
`json:"backend"`
}
// IngressBackend describes all endpoints for a given Service, port and protocol.
type
IngressBackend
struct
{
// Specifies the referenced service.
ServiceRef
api
.
LocalObjectReference
`json:"serviceRef"`
// Specifies the port of the referenced service.
ServicePort
util
.
IntOrString
`json:"servicePort,omitempty"`
// Specifies the protocol of the referenced service.
Protocol
api
.
Protocol
`json:"protocol,omitempty"`
}
pkg/apis/experimental/v1/register.go
View file @
a5e23ef5
...
@@ -46,6 +46,8 @@ func addKnownTypes() {
...
@@ -46,6 +46,8 @@ func addKnownTypes() {
&
DaemonSet
{},
&
DaemonSet
{},
&
ThirdPartyResourceData
{},
&
ThirdPartyResourceData
{},
&
ThirdPartyResourceDataList
{},
&
ThirdPartyResourceDataList
{},
&
Ingress
{},
&
IngressList
{},
)
)
}
}
...
@@ -63,3 +65,5 @@ func (*DaemonSet) IsAnAPIObject() {}
...
@@ -63,3 +65,5 @@ func (*DaemonSet) IsAnAPIObject() {}
func
(
*
DaemonSetList
)
IsAnAPIObject
()
{}
func
(
*
DaemonSetList
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceData
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceData
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceDataList
)
IsAnAPIObject
()
{}
func
(
*
ThirdPartyResourceDataList
)
IsAnAPIObject
()
{}
func
(
*
Ingress
)
IsAnAPIObject
()
{}
func
(
*
IngressList
)
IsAnAPIObject
()
{}
pkg/apis/experimental/v1/types.go
View file @
a5e23ef5
...
@@ -464,3 +464,80 @@ type JobCondition struct {
...
@@ -464,3 +464,80 @@ type JobCondition struct {
// Human readable message indicating details about last transition.
// Human readable message indicating details about last transition.
Message
string
`json:"message,omitempty"`
Message
string
`json:"message,omitempty"`
}
}
// An Ingress is a way to give services externally-reachable urls. Each Ingress is a
// collection of rules that allow inbound connections to reach the endpoints defined by
// a backend.
type
Ingress
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1
.
ObjectMeta
`json:"metadata,omitempty"`
// Spec is the desired state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Spec
IngressSpec
`json:"spec,omitempty"`
// Status is the current state of the Ingress.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Status
IngressStatus
`json:"status,omitempty"`
}
// IngressList is a collection of Ingress.
type
IngressList
struct
{
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
unversioned
.
ListMeta
`json:"metadata,omitempty"`
// Items is the list of Ingress.
Items
[]
Ingress
`json:"items"`
}
// IngressSpec describes the Ingress the user wishes to exist.
type
IngressSpec
struct
{
// TODO: Add the ability to specify load-balancer IP just like what Service has already done?
// A list of rules used to configure the Ingress.
// http://<host>:<port>/<path>?<searchpart> -> IngressBackend
// Where parts of the url conform to RFC 1738.
Rules
[]
IngressRule
`json:"rules"`
}
// IngressStatus describe the current state of the Ingress.
type
IngressStatus
struct
{
// LoadBalancer contains the current status of the load-balancer.
LoadBalancer
v1
.
LoadBalancerStatus
`json:"loadBalancer,omitempty"`
}
// IngressRule represents the rules mapping the paths under a specified host to the related backend services.
type
IngressRule
struct
{
// Host is the fully qualified domain name of a network host, or its IP
// address as a set of four decimal digit groups separated by ".".
// Conforms to RFC 1738.
Host
string
`json:"host,omitempty"`
// Paths describe a list of load-balancer rules under the specified host.
Paths
[]
IngressPath
`json:"paths"`
}
// IngressPath associates a path regex with an IngressBackend.
// Incoming urls matching the Path are forwarded to the Backend.
type
IngressPath
struct
{
// Path is a regex matched against the url of an incoming request.
Path
string
`json:"path,omitempty"`
// Define the referenced service endpoint which the traffic will be forwarded to.
Backend
IngressBackend
`json:"backend"`
}
// IngressBackend describes all endpoints for a given Service, port and protocol.
type
IngressBackend
struct
{
// Specifies the referenced service.
ServiceRef
v1
.
LocalObjectReference
`json:"serviceRef"`
// Specifies the port of the referenced service.
ServicePort
util
.
IntOrString
`json:"servicePort,omitempty"`
// Specifies the protocol of the referenced service.
Protocol
v1
.
Protocol
`json:"protocol,omitempty"`
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment