...

Source file src/sigs.k8s.io/gateway-api/apis/v1alpha2/gatewayclass_types.go

Documentation: sigs.k8s.io/gateway-api/apis/v1alpha2

     1  /*
     2  Copyright 2020 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package v1alpha2
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  
    22  	v1 "sigs.k8s.io/gateway-api/apis/v1"
    23  )
    24  
    25  // +genclient
    26  // +genclient:nonNamespaced
    27  // +kubebuilder:object:root=true
    28  // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc
    29  // +kubebuilder:subresource:status
    30  // +kubebuilder:skipversion
    31  // +kubebuilder:deprecatedversion:warning="The v1alpha2 version of GatewayClass has been deprecated and will be removed in a future release of the API. Please upgrade to v1."
    32  // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName`
    33  // +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status`
    34  // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
    35  // +kubebuilder:printcolumn:name="Description",type=string,JSONPath=`.spec.description`,priority=1
    36  
    37  // GatewayClass describes a class of Gateways available to the user for creating
    38  // Gateway resources.
    39  //
    40  // It is recommended that this resource be used as a template for Gateways. This
    41  // means that a Gateway is based on the state of the GatewayClass at the time it
    42  // was created and changes to the GatewayClass or associated parameters are not
    43  // propagated down to existing Gateways. This recommendation is intended to
    44  // limit the blast radius of changes to GatewayClass or associated parameters.
    45  // If implementations choose to propagate GatewayClass changes to existing
    46  // Gateways, that MUST be clearly documented by the implementation.
    47  //
    48  // Whenever one or more Gateways are using a GatewayClass, implementations SHOULD
    49  // add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the
    50  // associated GatewayClass. This ensures that a GatewayClass associated with a
    51  // Gateway is not deleted while in use.
    52  //
    53  // GatewayClass is a Cluster level resource.
    54  type GatewayClass v1.GatewayClass
    55  
    56  // +kubebuilder:object:root=true
    57  
    58  // GatewayClassList contains a list of GatewayClass
    59  type GatewayClassList struct {
    60  	metav1.TypeMeta `json:",inline"`
    61  	metav1.ListMeta `json:"metadata,omitempty"`
    62  	Items           []GatewayClass `json:"items"`
    63  }
    64  
    65  // GatewayClassSpec reflects the configuration of a class of Gateways.
    66  // +k8s:deepcopy-gen=false
    67  type GatewayClassSpec = v1.GatewayClassSpec
    68  
    69  // ParametersReference identifies an API object containing controller-specific
    70  // configuration resource within the cluster.
    71  // +k8s:deepcopy-gen=false
    72  type ParametersReference = v1.ParametersReference
    73  
    74  // GatewayClassConditionType is the type for status conditions on
    75  // Gateway resources. This type should be used with the
    76  // GatewayClassStatus.Conditions field.
    77  // +k8s:deepcopy-gen=false
    78  type GatewayClassConditionType = v1.GatewayClassConditionType
    79  
    80  // GatewayClassConditionReason defines the set of reasons that explain why a
    81  // particular GatewayClass condition type has been raised.
    82  // +k8s:deepcopy-gen=false
    83  type GatewayClassConditionReason = v1.GatewayClassConditionReason
    84  
    85  // GatewayClassStatus is the current status for the GatewayClass.
    86  // +k8s:deepcopy-gen=false
    87  type GatewayClassStatus = v1.GatewayClassStatus
    88  

View as plain text