Skip to content

Commit 8b4b954

Browse files
mogliangqliang
andauthored
add AzureStackHCIClusterTemplate for clusterclass (#275)
Co-authored-by: qliang <[email protected]>
1 parent 8d31cd6 commit 8b4b954

File tree

3 files changed

+345
-0
lines changed

3 files changed

+345
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
Portions Copyright © Microsoft Corporation.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package v1beta1
19+
20+
import (
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
)
23+
24+
// AzureStackHCIClusterTemplateSpec defines the desired state of AzureStackHCIClusterTemplate
25+
type AzureStackHCIClusterTemplateSpec struct {
26+
Template AzureStackHCIClusterTemplateResource `json:"template"`
27+
}
28+
29+
// +kubebuilder:object:root=true
30+
31+
// AzureStackHCIClusterTemplate is the Schema for the azurestackhciclustertemplates API
32+
type AzureStackHCIClusterTemplate struct {
33+
metav1.TypeMeta `json:",inline"`
34+
metav1.ObjectMeta `json:"metadata,omitempty"`
35+
36+
Spec AzureStackHCIClusterTemplateSpec `json:"spec,omitempty"`
37+
}
38+
39+
// +kubebuilder:object:root=true
40+
41+
// AzureStackHCIClusterTemplateList contains a list of AzureStackHCIClusterTemplate
42+
type AzureStackHCIClusterTemplateList struct {
43+
metav1.TypeMeta `json:",inline"`
44+
metav1.ListMeta `json:"metadata,omitempty"`
45+
Items []AzureStackHCIClusterTemplate `json:"items"`
46+
}
47+
48+
func init() {
49+
SchemeBuilder.Register(&AzureStackHCIClusterTemplate{}, &AzureStackHCIClusterTemplateList{})
50+
}
51+
52+
// AzureStackHCIClusterTemplateResource describes the data needed to create an AzureStackHCICluster from a template
53+
type AzureStackHCIClusterTemplateResource struct {
54+
Spec AzureStackHCIClusterSpec `json:"spec"`
55+
}

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.11.4
7+
name: azurestackhciclustertemplates.infrastructure.cluster.x-k8s.io
8+
spec:
9+
group: infrastructure.cluster.x-k8s.io
10+
names:
11+
kind: AzureStackHCIClusterTemplate
12+
listKind: AzureStackHCIClusterTemplateList
13+
plural: azurestackhciclustertemplates
14+
singular: azurestackhciclustertemplate
15+
scope: Namespaced
16+
versions:
17+
- name: v1beta1
18+
schema:
19+
openAPIV3Schema:
20+
description: AzureStackHCIClusterTemplate is the Schema for the azurestackhciclustertemplates
21+
API
22+
properties:
23+
apiVersion:
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
27+
type: string
28+
kind:
29+
description: 'Kind is a string value representing the REST resource this
30+
object represents. Servers may infer this from the endpoint the client
31+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
32+
type: string
33+
metadata:
34+
type: object
35+
spec:
36+
description: AzureStackHCIClusterTemplateSpec defines the desired state
37+
of AzureStackHCIClusterTemplate
38+
properties:
39+
template:
40+
description: AzureStackHCIClusterTemplateResource describes the data
41+
needed to create an AzureStackHCICluster from a template
42+
properties:
43+
spec:
44+
description: AzureStackHCIClusterSpec defines the desired state
45+
of AzureStackHCICluster
46+
properties:
47+
azureStackHCILoadBalancer:
48+
description: AzureStackHCILoadBalancer is used to declare
49+
the AzureStackHCILoadBalancerSpec if a LoadBalancer is desired
50+
for the AzureStackHCICluster.
51+
properties:
52+
image:
53+
description: 'Image defines information about the image
54+
to use for VM creation. There are three ways to specify
55+
an image: by ID, by publisher, or by Shared Image Gallery.
56+
If specifying an image by ID, only the ID field needs
57+
to be set. If specifying an image by publisher, the
58+
Publisher, Offer, SKU, and Version fields must be set.
59+
If specifying an image from a Shared Image Gallery,
60+
the SubscriptionID, ResourceGroup, Gallery, Name, and
61+
Version fields must be set.'
62+
properties:
63+
gallery:
64+
type: string
65+
id:
66+
type: string
67+
name:
68+
type: string
69+
offer:
70+
type: string
71+
osType:
72+
description: OSType describes the OS type of a disk.
73+
type: string
74+
publisher:
75+
type: string
76+
resourceGroup:
77+
type: string
78+
sku:
79+
type: string
80+
subscriptionID:
81+
type: string
82+
version:
83+
type: string
84+
required:
85+
- osType
86+
type: object
87+
replicas:
88+
default: 1
89+
description: Number of desired loadbalancer machines.
90+
Defaults to 1. This is a pointer to distinguish between
91+
explicit zero and not specified.
92+
format: int32
93+
type: integer
94+
sshPublicKey:
95+
type: string
96+
storageContainer:
97+
type: string
98+
vmSize:
99+
type: string
100+
required:
101+
- image
102+
- sshPublicKey
103+
- vmSize
104+
type: object
105+
controlPlaneEndpoint:
106+
description: ControlPlaneEndpoint represents the endpoint
107+
used to communicate with the control plane.
108+
properties:
109+
host:
110+
description: The hostname on which the API server is serving.
111+
type: string
112+
port:
113+
description: The port on which the API server is serving.
114+
format: int32
115+
type: integer
116+
required:
117+
- host
118+
- port
119+
type: object
120+
location:
121+
type: string
122+
management:
123+
description: Management is true when the cluster is a Management
124+
Cluster.
125+
type: boolean
126+
networkSpec:
127+
description: NetworkSpec encapsulates all things related to
128+
Azure network.
129+
properties:
130+
subnets:
131+
description: Subnets is the configuration for the control-plane
132+
subnet and the node subnet.
133+
items:
134+
description: SubnetSpec configures an Azure subnet.
135+
properties:
136+
cidrBlock:
137+
description: CidrBlock is the CIDR block to be used
138+
when the provider creates a managed Vnet.
139+
type: string
140+
id:
141+
description: ID defines a unique identifier to reference
142+
this resource.
143+
type: string
144+
name:
145+
description: Name defines a name for the subnet
146+
resource.
147+
type: string
148+
vnetId:
149+
description: VnetID defines the ID of the virtual
150+
network this subnet should be built in.
151+
type: string
152+
required:
153+
- name
154+
- vnetId
155+
type: object
156+
type: array
157+
vnet:
158+
description: Vnet is the configuration for the Azure virtual
159+
network.
160+
properties:
161+
cidrBlock:
162+
description: CidrBlock is the CIDR block to be used
163+
when the provider creates a managed virtual network.
164+
type: string
165+
group:
166+
description: Group is the resource group the vnet
167+
should use.
168+
type: string
169+
id:
170+
description: ID is the identifier of the virtual network
171+
this provider should use to create resources.
172+
type: string
173+
name:
174+
description: Name defines a name for the virtual network
175+
resource.
176+
type: string
177+
required:
178+
- name
179+
type: object
180+
type: object
181+
resourceGroup:
182+
type: string
183+
version:
184+
description: Version indicates the desired Kubernetes version
185+
of the cluster.
186+
type: string
187+
required:
188+
- location
189+
- resourceGroup
190+
- version
191+
type: object
192+
required:
193+
- spec
194+
type: object
195+
required:
196+
- template
197+
type: object
198+
type: object
199+
served: true
200+
storage: true

0 commit comments

Comments
 (0)