sigs.k8s.io/cluster-api-provider-azure@v1.17.0/api/v1beta1/azuremanagedcluster_types.go (about)

     1  /*
     2  Copyright 2023 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 v1beta1
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  	clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
    22  )
    23  
    24  // AzureManagedClusterSpec defines the desired state of AzureManagedCluster.
    25  type AzureManagedClusterSpec struct {
    26  	// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
    27  	// Immutable, populated by the AKS API at create.
    28  	// Because this field is programmatically set by CAPZ after resource creation, we define it as +optional
    29  	// in the API schema to permit resource admission.
    30  	// +optional
    31  	ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
    32  }
    33  
    34  // AzureManagedClusterStatus defines the observed state of AzureManagedCluster.
    35  type AzureManagedClusterStatus struct {
    36  	// Ready is true when the provider resource is ready.
    37  	// +optional
    38  	Ready bool `json:"ready,omitempty"`
    39  }
    40  
    41  // +kubebuilder:object:root=true
    42  // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedCluster belongs"
    43  // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready"
    44  // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedCluster"
    45  // +kubebuilder:resource:path=azuremanagedclusters,scope=Namespaced,categories=cluster-api,shortName=amc
    46  // +kubebuilder:storageversion
    47  // +kubebuilder:subresource:status
    48  
    49  // AzureManagedCluster is the Schema for the azuremanagedclusters API.
    50  type AzureManagedCluster struct {
    51  	metav1.TypeMeta   `json:",inline"`
    52  	metav1.ObjectMeta `json:"metadata,omitempty"`
    53  
    54  	Spec   AzureManagedClusterSpec   `json:"spec,omitempty"`
    55  	Status AzureManagedClusterStatus `json:"status,omitempty"`
    56  }
    57  
    58  // +kubebuilder:object:root=true
    59  
    60  // AzureManagedClusterList contains a list of AzureManagedClusters.
    61  type AzureManagedClusterList struct {
    62  	metav1.TypeMeta `json:",inline"`
    63  	metav1.ListMeta `json:"metadata,omitempty"`
    64  	Items           []AzureManagedCluster `json:"items"`
    65  }
    66  
    67  func init() {
    68  	SchemeBuilder.Register(&AzureManagedCluster{}, &AzureManagedClusterList{})
    69  }