Skip to content

Commit cb1fd06

Browse files
committed
Add Nstance Operator app and CRD charts
Signed-off-by: Ryan Djurovich <git@ryan0x44.com>
1 parent c476630 commit cb1fd06

33 files changed

Lines changed: 1881 additions & 0 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ __Provider-Specific Core (always installed for certain providers):__
6161
for persistent storage on AWS (_Apache 2.0_).
6262
- [Cluster API](https://cluster-api.sigs.k8s.io/) core controller and CRDs for
6363
declarative infrastructure-provider cluster lifecycle management (_Apache 2.0_).
64+
- [Nstance Operator](https://nstance.dev/) as the Cluster API infrastructure
65+
provider for Nstance-managed machines on AWS and Google Cloud (_Apache 2.0_).
6466

6567
## Usage
6668

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Podplane <https://podplane.dev>
2+
# Copyright The Podplane Authors
3+
# SPDX-License-Identifier: Apache-2.0
4+
---
5+
apiVersion: v2
6+
name: nstance-operator-crds
7+
description: Nstance Operator custom resource definitions
8+
type: application
9+
version: "1.0.0"
10+
appVersion: "1.0.0"
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Nstance <https://nstance.dev>
2+
# Copyright The Nstance Authors
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
apiVersion: apiextensions.k8s.io/v1
7+
kind: CustomResourceDefinition
8+
metadata:
9+
annotations:
10+
controller-gen.kubebuilder.io/version: v0.19.0
11+
helm.sh/resource-policy: keep
12+
labels:
13+
cluster.x-k8s.io/v1beta1: v1beta1
14+
cluster.x-k8s.io/v1beta2: v1beta1
15+
name: nstanceclusters.infrastructure.cluster.x-k8s.io
16+
spec:
17+
group: infrastructure.cluster.x-k8s.io
18+
names:
19+
categories:
20+
- cluster-api
21+
kind: NstanceCluster
22+
listKind: NstanceClusterList
23+
plural: nstanceclusters
24+
singular: nstancecluster
25+
scope: Namespaced
26+
versions:
27+
- additionalPrinterColumns:
28+
- description: Cluster infrastructure is provisioned
29+
jsonPath: .status.initialization.provisioned
30+
name: Provisioned
31+
type: boolean
32+
name: v1beta1
33+
schema:
34+
openAPIV3Schema:
35+
description: |-
36+
NstanceCluster is the Schema for the nstanceclusters API.
37+
It is a stub resource that satisfies the CAPI Cluster infrastructureRef contract.
38+
Nstance does not require cluster-level infrastructure provisioning.
39+
properties:
40+
apiVersion:
41+
description: |-
42+
APIVersion defines the versioned schema of this representation of an object.
43+
Servers should convert recognized schemas to the latest internal value, and
44+
may reject unrecognized values.
45+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
46+
type: string
47+
kind:
48+
description: |-
49+
Kind is a string value representing the REST resource this object represents.
50+
Servers may infer this from the endpoint the client submits requests to.
51+
Cannot be updated.
52+
In CamelCase.
53+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
54+
type: string
55+
metadata:
56+
type: object
57+
spec:
58+
description: |-
59+
NstanceClusterSpec defines the desired state of NstanceCluster.
60+
Nstance manages infrastructure at the pool/machine level, not the cluster
61+
level. NstanceCluster exists only to satisfy the CAPI contract requiring
62+
an infrastructure cluster ref.
63+
properties:
64+
controlPlaneEndpoint:
65+
description: |-
66+
ControlPlaneEndpoint represents the endpoint for the cluster's API server.
67+
Set to the management cluster's API server endpoint to satisfy the CAPI
68+
infrastructure contract. Nstance does not provision control planes.
69+
properties:
70+
host:
71+
description: Host is the hostname on which the API server is serving.
72+
minLength: 1
73+
type: string
74+
port:
75+
description: Port is the port on which the API server is serving.
76+
format: int32
77+
minimum: 1
78+
type: integer
79+
required:
80+
- host
81+
- port
82+
type: object
83+
type: object
84+
status:
85+
description: NstanceClusterStatus defines the observed state of NstanceCluster.
86+
properties:
87+
conditions:
88+
description: Conditions represent the current state of the NstanceCluster.
89+
items:
90+
description: Condition contains details for one aspect of the current
91+
state of this API Resource.
92+
properties:
93+
lastTransitionTime:
94+
description: |-
95+
lastTransitionTime is the last time the condition transitioned from one status to another.
96+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
97+
format: date-time
98+
type: string
99+
message:
100+
description: |-
101+
message is a human readable message indicating details about the transition.
102+
This may be an empty string.
103+
maxLength: 32768
104+
type: string
105+
observedGeneration:
106+
description: |-
107+
observedGeneration represents the .metadata.generation that the condition was set based upon.
108+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
109+
with respect to the current state of the instance.
110+
format: int64
111+
minimum: 0
112+
type: integer
113+
reason:
114+
description: |-
115+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
116+
Producers of specific condition types may define expected values and meanings for this field,
117+
and whether the values are considered a guaranteed API.
118+
The value should be a CamelCase string.
119+
This field may not be empty.
120+
maxLength: 1024
121+
minLength: 1
122+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
123+
type: string
124+
status:
125+
description: status of the condition, one of True, False, Unknown.
126+
enum:
127+
- "True"
128+
- "False"
129+
- Unknown
130+
type: string
131+
type:
132+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
133+
maxLength: 316
134+
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])$
135+
type: string
136+
required:
137+
- lastTransitionTime
138+
- message
139+
- reason
140+
- status
141+
- type
142+
type: object
143+
type: array
144+
x-kubernetes-list-map-keys:
145+
- type
146+
x-kubernetes-list-type: map
147+
initialization:
148+
description: Initialization provides observations of the NstanceCluster
149+
initialization process.
150+
properties:
151+
provisioned:
152+
description: |-
153+
Provisioned is true when cluster infrastructure is provisioned.
154+
Always true for Nstance since there is no cluster-level infrastructure.
155+
type: boolean
156+
type: object
157+
type: object
158+
type: object
159+
served: true
160+
storage: true
161+
subresources:
162+
status: {}
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Nstance <https://nstance.dev>
2+
# Copyright The Nstance Authors
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
apiVersion: apiextensions.k8s.io/v1
7+
kind: CustomResourceDefinition
8+
metadata:
9+
annotations:
10+
controller-gen.kubebuilder.io/version: v0.19.0
11+
helm.sh/resource-policy: keep
12+
labels:
13+
cluster.x-k8s.io/v1beta1: v1beta1
14+
cluster.x-k8s.io/v1beta2: v1beta1
15+
name: nstancemachinepools.infrastructure.cluster.x-k8s.io
16+
spec:
17+
group: infrastructure.cluster.x-k8s.io
18+
names:
19+
categories:
20+
- cluster-api
21+
kind: NstanceMachinePool
22+
listKind: NstanceMachinePoolList
23+
plural: nstancemachinepools
24+
singular: nstancemachinepool
25+
scope: Namespaced
26+
versions:
27+
- additionalPrinterColumns:
28+
- description: Nstance Group
29+
jsonPath: .spec.group
30+
name: Group
31+
type: string
32+
- description: Backed by static config
33+
jsonPath: .status.isStatic
34+
name: Static
35+
type: boolean
36+
- description: Machine pool is ready
37+
jsonPath: .status.ready
38+
name: Ready
39+
type: boolean
40+
name: v1beta1
41+
schema:
42+
openAPIV3Schema:
43+
description: NstanceMachinePool is the Schema for the nstancemachinepools
44+
API
45+
properties:
46+
apiVersion:
47+
description: |-
48+
APIVersion defines the versioned schema of this representation of an object.
49+
Servers should convert recognized schemas to the latest internal value, and
50+
may reject unrecognized values.
51+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
52+
type: string
53+
kind:
54+
description: |-
55+
Kind is a string value representing the REST resource this object represents.
56+
Servers may infer this from the endpoint the client submits requests to.
57+
Cannot be updated.
58+
In CamelCase.
59+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
60+
type: string
61+
metadata:
62+
type: object
63+
spec:
64+
description: NstanceMachinePoolSpec defines the desired state of NstanceMachinePool
65+
properties:
66+
group:
67+
description: |-
68+
Group is the Nstance Group key. This can match a static group in
69+
server config, or be a new key for a dynamic group.
70+
minLength: 1
71+
type: string
72+
instanceType:
73+
description: InstanceType is an optional override (must be allowed
74+
by the Group)
75+
type: string
76+
providerIDList:
77+
description: |-
78+
ProviderIDList is the list of provider IDs of running instances across all shards.
79+
Required by the CAPI InfraMachinePool contract (spec.providerIDList).
80+
items:
81+
type: string
82+
type: array
83+
x-kubernetes-list-type: atomic
84+
shards:
85+
description: |-
86+
Shards is the list of zone shards this group should be distributed across.
87+
Each shard will have a corresponding NstanceShardGroup created.
88+
Replicas from the MachinePool are distributed across these shards.
89+
items:
90+
type: string
91+
minItems: 1
92+
type: array
93+
subnetPool:
94+
description: |-
95+
SubnetPool specifies which subnet pool to use for new dynamic groups.
96+
This is a subnet pool ID that references server.subnet_pools map key.
97+
If not specified, uses the template's default.
98+
Must not be set for groups backed by static config (server will reject).
99+
type: string
100+
template:
101+
description: |-
102+
Template is the name of the Nstance template defined in server config.
103+
Required when creating a new dynamic group (no static group with this key).
104+
Must not be set for groups backed by static config (server will reject).
105+
type: string
106+
vars:
107+
additionalProperties:
108+
type: string
109+
description: Vars are additional vars merged with Group vars (enables
110+
node labels, etc.)
111+
type: object
112+
required:
113+
- group
114+
- shards
115+
type: object
116+
status:
117+
description: NstanceMachinePoolStatus defines the observed state of NstanceMachinePool
118+
properties:
119+
conditions:
120+
description: Conditions represent the current state of the NstanceMachinePool
121+
items:
122+
description: Condition contains details for one aspect of the current
123+
state of this API Resource.
124+
properties:
125+
lastTransitionTime:
126+
description: |-
127+
lastTransitionTime is the last time the condition transitioned from one status to another.
128+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
129+
format: date-time
130+
type: string
131+
message:
132+
description: |-
133+
message is a human readable message indicating details about the transition.
134+
This may be an empty string.
135+
maxLength: 32768
136+
type: string
137+
observedGeneration:
138+
description: |-
139+
observedGeneration represents the .metadata.generation that the condition was set based upon.
140+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
141+
with respect to the current state of the instance.
142+
format: int64
143+
minimum: 0
144+
type: integer
145+
reason:
146+
description: |-
147+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
148+
Producers of specific condition types may define expected values and meanings for this field,
149+
and whether the values are considered a guaranteed API.
150+
The value should be a CamelCase string.
151+
This field may not be empty.
152+
maxLength: 1024
153+
minLength: 1
154+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
155+
type: string
156+
status:
157+
description: status of the condition, one of True, False, Unknown.
158+
enum:
159+
- "True"
160+
- "False"
161+
- Unknown
162+
type: string
163+
type:
164+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
165+
maxLength: 316
166+
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])$
167+
type: string
168+
required:
169+
- lastTransitionTime
170+
- message
171+
- reason
172+
- status
173+
- type
174+
type: object
175+
type: array
176+
x-kubernetes-list-map-keys:
177+
- type
178+
x-kubernetes-list-type: map
179+
isStatic:
180+
description: |-
181+
IsStatic indicates this group is backed by static server config.
182+
When true, spec.template and spec.subnetPool cannot be modified.
183+
type: boolean
184+
observedGeneration:
185+
description: ObservedGeneration is the generation of the spec that
186+
was last observed
187+
format: int64
188+
type: integer
189+
observedOwnerGeneration:
190+
description: ObservedOwnerGeneration is the generation of the owner
191+
MachinePool that was last observed
192+
format: int64
193+
type: integer
194+
ready:
195+
description: Ready indicates whether the machine pool is ready
196+
type: boolean
197+
replicas:
198+
description: |-
199+
Replicas is the most recently observed number of running instances across all shards.
200+
Required by the CAPI InfraMachinePool contract (status.replicas).
201+
format: int32
202+
type: integer
203+
type: object
204+
required:
205+
- spec
206+
type: object
207+
served: true
208+
storage: true
209+
subresources:
210+
status: {}

0 commit comments

Comments
 (0)