Skip to content

Commit bd2ca7d

Browse files
Merge pull request GoogleCloudPlatform#2347 from hankfreund/samples
Update Attached samples to use CRD instead of Facade.
2 parents e29dd60 + 1172cbd commit bd2ca7d

File tree

4 files changed

+207
-63
lines changed

4 files changed

+207
-63
lines changed

experiments/compositions/samples/AttachedAKS/01-composition.yaml

+96-24
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,103 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: composition.google.com/v1alpha1
16-
kind: Facade
15+
apiVersion: apiextensions.k8s.io/v1
16+
kind: CustomResourceDefinition
1717
metadata:
18-
name: attachedaks
19-
namespace: default
18+
name: attachedakses.idp.mycompany.com
2019
spec:
21-
facadeKind: AttachedAKS
22-
openAPIV3Schema:
23-
description: AttachedAKS defines the parameters for attaching ASK cluster to GCP.
24-
properties:
25-
adminUsers:
26-
items:
27-
type: string
28-
type: array
29-
attachedPlatformVersion:
30-
type: string
31-
azureRegion:
32-
type: string
33-
gcpProjectNumber:
34-
type: string
35-
gcpRegion:
36-
type: string
37-
kubernetesVersion:
38-
type: string
39-
type: object
20+
conversion:
21+
strategy: None
22+
group: idp.mycompany.com
23+
names:
24+
categories:
25+
- facade
26+
- facades
27+
kind: AttachedAKS
28+
listKind: AttachedAKSList
29+
plural: attachedakses
30+
singular: attachedaks
31+
scope: Namespaced
32+
versions:
33+
- name: v1
34+
schema:
35+
openAPIV3Schema:
36+
description: TODO
37+
properties:
38+
apiVersion:
39+
type: string
40+
kind:
41+
type: string
42+
metadata:
43+
type: object
44+
spec:
45+
description: AttachedAKS defines the parameters for attaching ASK cluster
46+
to GCP.
47+
properties:
48+
adminUsers:
49+
items:
50+
type: string
51+
type: array
52+
attachedPlatformVersion:
53+
type: string
54+
azureRegion:
55+
type: string
56+
gcpProjectNumber:
57+
type: string
58+
gcpRegion:
59+
type: string
60+
kubernetesVersion:
61+
type: string
62+
type: object
63+
status:
64+
properties:
65+
conditions:
66+
items:
67+
properties:
68+
lastTransitionTime:
69+
format: date-time
70+
type: string
71+
message:
72+
description: human readable message
73+
maxLength: 1024
74+
type: string
75+
observedGeneration:
76+
format: int64
77+
minimum: 0
78+
type: integer
79+
reason:
80+
maxLength: 256
81+
minLength: 1
82+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
83+
type: string
84+
status:
85+
description: status of the condition, one of True, False, Unknown.
86+
enum:
87+
- "True"
88+
- "False"
89+
- Unknown
90+
type: string
91+
type:
92+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
93+
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
94+
maxLength: 316
95+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
96+
type: string
97+
required:
98+
- lastTransitionTime
99+
- message
100+
- reason
101+
- status
102+
- type
103+
type: object
104+
type: array
105+
type: object
106+
x-kubernetes-preserve-unknown-fields: true
107+
type: object
108+
served: true
109+
storage: true
110+
subresources:
111+
status: {}
40112
---
41113
apiVersion: composition.google.com/v1alpha1
42114
kind: GetterConfiguration
@@ -61,7 +133,7 @@ kind: Composition
61133
metadata:
62134
name: compo-aks-1
63135
spec:
64-
inputAPIGroup: attachedakses.facade.compositions.google.com
136+
inputAPIGroup: attachedakses.idp.mycompany.com
65137
expanders:
66138
- type: jinja2
67139
version: v0.0.1

experiments/compositions/samples/AttachedAKS/03-attached-1.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: facade.compositions.google.com/v1
15+
apiVersion: idp.mycompany.com/v1
1616
kind: AttachedAKS
1717
metadata:
1818
name: test-composition-aks-1

experiments/compositions/samples/AttachedEKS/01-composition.yaml

+109-37
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,116 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: composition.google.com/v1alpha1
16-
kind: Facade
15+
apiVersion: apiextensions.k8s.io/v1
16+
kind: CustomResourceDefinition
1717
metadata:
18-
name: attachedeks
19-
namespace: default
18+
name: attachedekses.idp.mycompany.com
2019
spec:
21-
facadeKind: AttachedEKS
22-
openAPIV3Schema:
23-
description: AttachedEKS defines the parameters for attaching EKS cluster to GCP.
24-
properties:
25-
adminUsers:
26-
items:
27-
type: string
28-
type: array
29-
attachedPlatformVersion:
30-
type: string
31-
awsAvailabilityZones:
32-
items:
33-
properties:
34-
privateSubnet:
35-
type: string
36-
publicSubnet:
37-
type: string
38-
zoneNameSuffix:
39-
type: string
40-
type: object
41-
type: array
42-
awsRegion:
43-
type: string
44-
awsAccessIdentity:
45-
type: string
46-
gcpProjectNumber:
47-
type: string
48-
gcpRegion:
49-
type: string
50-
kubernetesVersion:
51-
type: string
52-
type: object
20+
conversion:
21+
strategy: None
22+
group: idp.mycompany.com
23+
names:
24+
categories:
25+
- facade
26+
- facades
27+
kind: AttachedEKS
28+
listKind: AttachedEKSList
29+
plural: attachedekses
30+
singular: attachedeks
31+
scope: Namespaced
32+
versions:
33+
- name: v1
34+
schema:
35+
openAPIV3Schema:
36+
description: TODO
37+
properties:
38+
apiVersion:
39+
type: string
40+
kind:
41+
type: string
42+
metadata:
43+
type: object
44+
spec:
45+
description: AttachedEKS defines the parameters for attaching EKS cluster
46+
to GCP.
47+
properties:
48+
adminUsers:
49+
items:
50+
type: string
51+
type: array
52+
attachedPlatformVersion:
53+
type: string
54+
awsAccessIdentity:
55+
type: string
56+
awsAvailabilityZones:
57+
items:
58+
properties:
59+
privateSubnet:
60+
type: string
61+
publicSubnet:
62+
type: string
63+
zoneNameSuffix:
64+
type: string
65+
type: object
66+
type: array
67+
awsRegion:
68+
type: string
69+
gcpProjectNumber:
70+
type: string
71+
gcpRegion:
72+
type: string
73+
kubernetesVersion:
74+
type: string
75+
type: object
76+
status:
77+
properties:
78+
conditions:
79+
items:
80+
properties:
81+
lastTransitionTime:
82+
format: date-time
83+
type: string
84+
message:
85+
description: human readable message
86+
maxLength: 1024
87+
type: string
88+
observedGeneration:
89+
format: int64
90+
minimum: 0
91+
type: integer
92+
reason:
93+
maxLength: 256
94+
minLength: 1
95+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
96+
type: string
97+
status:
98+
description: status of the condition, one of True, False, Unknown.
99+
enum:
100+
- "True"
101+
- "False"
102+
- Unknown
103+
type: string
104+
type:
105+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
106+
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
107+
maxLength: 316
108+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
109+
type: string
110+
required:
111+
- lastTransitionTime
112+
- message
113+
- reason
114+
- status
115+
- type
116+
type: object
117+
type: array
118+
type: object
119+
x-kubernetes-preserve-unknown-fields: true
120+
type: object
121+
served: true
122+
storage: true
123+
subresources:
124+
status: {}
53125
---
54126
apiVersion: composition.google.com/v1alpha1
55127
kind: GetterConfiguration
@@ -93,7 +165,7 @@ metadata:
93165
name: compo-eks-1
94166
namespace: default
95167
spec:
96-
inputAPIGroup: attachedekses.facade.compositions.google.com
168+
inputAPIGroup: attachedekses.idp.mycompany.com
97169
expanders:
98170
- type: jinja2
99171
version: v0.0.1

experiments/compositions/samples/AttachedEKS/03-attached-1.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
apiVersion: facade.compositions.google.com/v1
15+
apiVersion: idp.mycompany.com/v1
1616
kind: AttachedEKS
1717
metadata:
1818
name: test-composition-eks-1

0 commit comments

Comments
 (0)