Skip to content

Commit

Permalink
add new gateway version
Browse files Browse the repository at this point in the history
  • Loading branch information
珩轩 committed Aug 10, 2023
1 parent 237fe8f commit 59008c7
Show file tree
Hide file tree
Showing 19 changed files with 1,086 additions and 24 deletions.
195 changes: 195 additions & 0 deletions charts/yurt-manager/crds/raven.openyurt.io_gateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,201 @@ spec:
type: object
type: object
served: true
storage: false
subresources:
status: {}
- name: v1beta1
schema:
openAPIV3Schema:
description: Gateway is the Schema for the gateways API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: GatewaySpec defines the desired state of Gateway
properties:
endpoints:
description: Endpoints are a list of available Endpoint.
items:
description: Endpoint stores all essential data for establishing
the VPN tunnel and Proxy
properties:
config:
additionalProperties:
type: string
description: Config is a map to record config for the raven
agent of node
type: object
nodeName:
description: NodeName is the Node hosting this endpoint.
type: string
port:
description: Port is the exposed port of the node
type: integer
publicIP:
description: PublicIP is the exposed IP of the node
type: string
type:
description: Type is the service type of the node, proxy or
tunnel
type: string
underNAT:
description: UnderNAT indicates whether node is under NAT
type: boolean
required:
- nodeName
- type
type: object
type: array
exposeType:
description: ExposeType determines how the Gateway is exposed.
type: string
nodeSelector:
description: NodeSelector is a label query over nodes that managed
by the gateway. The nodes in the same gateway should share same
layer 3 network.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
proxyConfig:
description: ProxyConfig determine the l7 proxy configuration
properties:
Replicas:
description: Replicas is the number of gateway active endpoints
that enabled proxy
type: integer
proxyHTTPPort:
description: ProxyHTTPPort is the proxy http port of the cross-domain
request
type: string
proxyHTTPSPort:
description: ProxyHTTPSPort is the proxy https port of the cross-domain
request
type: string
required:
- Replicas
type: object
tunnelConfig:
description: TunnelConfig determine the l3 tunnel configuration
properties:
Replicas:
description: Replicas is the number of gateway active endpoints
that enabled tunnel
type: integer
required:
- Replicas
type: object
type: object
status:
description: GatewayStatus defines the observed state of Gateway
properties:
activeEndpoints:
description: ActiveEndpoints is the reference of the active endpoint.
items:
description: Endpoint stores all essential data for establishing
the VPN tunnel and Proxy
properties:
config:
additionalProperties:
type: string
description: Config is a map to record config for the raven
agent of node
type: object
nodeName:
description: NodeName is the Node hosting this endpoint.
type: string
port:
description: Port is the exposed port of the node
type: integer
publicIP:
description: PublicIP is the exposed IP of the node
type: string
type:
description: Type is the service type of the node, proxy or
tunnel
type: string
underNAT:
description: UnderNAT indicates whether node is under NAT
type: boolean
required:
- nodeName
- type
type: object
type: array
nodes:
description: Nodes contains all information of nodes managed by Gateway.
items:
description: NodeInfo stores information of node managed by Gateway.
properties:
nodeName:
description: NodeName is the Node host name.
type: string
privateIP:
description: PrivateIP is the node private ip address
type: string
subnets:
description: Subnets is the pod ip range of the node
items:
type: string
type: array
required:
- nodeName
- privateIP
- subnets
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Expand Down
54 changes: 48 additions & 6 deletions charts/yurt-manager/templates/yurt-manager-auto-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,14 @@ webhooks:
service:
name: yurt-manager-webhook-service
namespace: {{ .Release.Namespace }}
path: /mutate-raven-openyurt-io-v1alpha1-gateway
path: /mutate-raven-openyurt-io-v1beta1-gateway
failurePolicy: Fail
name: mutate.raven.v1alpha1.gateway.openyurt.io
name: mutate.gateway.v1beta1.raven.openyurt.io
rules:
- apiGroups:
- raven.openyurt.io
apiVersions:
- v1alpha1
- v1beta1
operations:
- CREATE
- UPDATE
Expand Down Expand Up @@ -560,6 +560,27 @@ webhooks:
resources:
- yurtstaticsets
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: yurt-manager-webhook-service
namespace: {{ .Release.Namespace }}
path: /mutate-raven-openyurt-io-v1alpha1-gateway
failurePolicy: Fail
name: mutate.gateway.v1alpha1.raven.openyurt.io
rules:
- apiGroups:
- raven.openyurt.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- gateways
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
Expand All @@ -574,14 +595,14 @@ webhooks:
service:
name: yurt-manager-webhook-service
namespace: {{ .Release.Namespace }}
path: /validate-raven-openyurt-io-v1alpha1-gateway
path: /validate-raven-openyurt-io-v1beta1-gateway
failurePolicy: Fail
name: validate.raven.v1alpha1.gateway.openyurt.io
name: validate.gateway.v1beta1.raven.openyurt.io
rules:
- apiGroups:
- raven.openyurt.io
apiVersions:
- v1alpha1
- v1beta1
operations:
- CREATE
- UPDATE
Expand Down Expand Up @@ -731,3 +752,24 @@ webhooks:
resources:
- yurtstaticsets
sideEffects: None
- admissionReviewVersions:
- v1
- v1alpha1
clientConfig:
service:
name: yurt-manager-webhook-service
namespace: {{ .Release.Namespace }}
path: /validate-raven-openyurt-io-v1alpha1-gateway
failurePolicy: Fail
name: validate.gateway.v1alpha1.raven.openyurt.io
rules:
- apiGroups:
- raven.openyurt.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- gateways
sideEffects: None
26 changes: 26 additions & 0 deletions pkg/apis/addtoscheme_raven_v1beta1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright 2023 The OpenYurt 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 apis

import (
version "github.com/openyurtio/openyurt/pkg/apis/raven/v1beta1"
)

func init() {
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes, version.SchemeBuilder.AddToScheme)
}
2 changes: 1 addition & 1 deletion pkg/apis/apps/v1alpha1/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 pkg/apis/apps/v1beta1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 59008c7

Please sign in to comment.