sigs.k8s.io/cluster-api-provider-aws@v1.5.5/exp/api/v1alpha3/awsmanagedcluster_types.go (about)

     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 v1alpha3
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  
    22  	clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
    23  )
    24  
    25  // AWSManagedClusterSpec defines the desired state of AWSManagedCluster
    26  type AWSManagedClusterSpec struct {
    27  	// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
    28  	// +optional
    29  	ControlPlaneEndpoint clusterv1alpha3.APIEndpoint `json:"controlPlaneEndpoint"`
    30  }
    31  
    32  // AWSManagedClusterStatus defines the observed state of AWSManagedCluster
    33  type AWSManagedClusterStatus struct {
    34  	// Ready is when the AWSManagedControlPlane has a API server URL.
    35  	// +optional
    36  	Ready bool `json:"ready,omitempty"`
    37  
    38  	// FailureDomains specifies a list fo available availability zones that can be used
    39  	// +optional
    40  	FailureDomains clusterv1alpha3.FailureDomains `json:"failureDomains,omitempty"`
    41  }
    42  
    43  // +kubebuilder:object:root=true
    44  // +kubebuilder:resource:path=awsmanagedclusters,scope=Namespaced,categories=cluster-api,shortName=awsmc
    45  // +kubebuilder:subresource:status
    46  // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSManagedControl belongs"
    47  // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes"
    48  // +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.networkSpec.vpc.id",description="AWS VPC the control plane is using"
    49  // +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1
    50  
    51  // AWSManagedCluster is the Schema for the awsmanagedclusters API
    52  type AWSManagedCluster struct {
    53  	metav1.TypeMeta   `json:",inline"`
    54  	metav1.ObjectMeta `json:"metadata,omitempty"`
    55  
    56  	Spec   AWSManagedClusterSpec   `json:"spec,omitempty"`
    57  	Status AWSManagedClusterStatus `json:"status,omitempty"`
    58  }
    59  
    60  // +kubebuilder:object:root=true
    61  
    62  // AWSManagedClusterList contains a list of AWSManagedCluster.
    63  type AWSManagedClusterList struct {
    64  	metav1.TypeMeta `json:",inline"`
    65  	metav1.ListMeta `json:"metadata,omitempty"`
    66  	Items           []AWSManagedCluster `json:"items"`
    67  }
    68  
    69  func init() {
    70  	SchemeBuilder.Register(&AWSManagedCluster{}, &AWSManagedClusterList{})
    71  }