-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce machineConfigServer and nodePool versions
In order to have fine grained control over the versioning of nodePools, machines and nodes we want to decouple the machine config server, the ign endpoint and the user data secret giving the ignition endpoint from the controlPlane lifecycle. This will let us have nodePools coexisting at different versions and orchestrate rolling upgrades from an authoritative source of truth. To that end this PR introduces a new CRD machineConfigServer and introduce the concept of versioning for nodePools. A nodePool always target a release version and generates the appropiate mcs for it to get the right ignition config.
- Loading branch information
Showing
17 changed files
with
1,049 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MachineConfigServer{}, &MachineConfigServerList{}) | ||
} | ||
|
||
// MachineConfigServerSpec defines the desired state of MachineConfigServer | ||
type MachineConfigServerSpec struct { | ||
|
||
// Release specifies the release image to use for this MachineConfigServer | ||
ReleaseImage string `json:"releaseImage"` | ||
} | ||
|
||
// MachineConfigServerStatus defines the observed state of MachineConfigServer | ||
type MachineConfigServerStatus struct { | ||
// Version is the semantic version of the release used by the mcs. | ||
// For a mcs a given version represents the ignition config served by | ||
// the ignition endpoint referenced in the userdata secret. | ||
// +kubebuilder:validation:Optional | ||
Version string `json:"version,omitempty"` | ||
|
||
// +kubebuilder:validation:Optional | ||
Host string `json:"host,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=machineconfigservers,shortName=mcs;mcss,scope=Namespaced | ||
// +kubebuilder:storageversion | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="Version" | ||
// +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".status.host",description="Host" | ||
// MachineConfigServer is the Schema for the MachineConfigServers API | ||
type MachineConfigServer struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MachineConfigServerSpec `json:"spec,omitempty"` | ||
Status MachineConfigServerStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// MachineConfigServerList contains a list of MachineConfigServer | ||
type MachineConfigServerList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MachineConfigServer `json:"items"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
cmd/install/assets/hypershift-operator/hypershift.openshift.io_machineconfigservers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.5.0 | ||
creationTimestamp: null | ||
name: machineconfigservers.hypershift.openshift.io | ||
spec: | ||
group: hypershift.openshift.io | ||
names: | ||
kind: MachineConfigServer | ||
listKind: MachineConfigServerList | ||
plural: machineconfigservers | ||
shortNames: | ||
- mcs | ||
- mcss | ||
singular: machineconfigserver | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- description: Version | ||
jsonPath: .status.version | ||
name: Version | ||
type: string | ||
- description: Host | ||
jsonPath: .status.host | ||
name: Host | ||
type: string | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: MachineConfigServer is the Schema for the MachineConfigServers API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: MachineConfigServerSpec defines the desired state of MachineConfigServer | ||
properties: | ||
releaseImage: | ||
description: Release specifies the release image to use for this MachineConfigServer | ||
type: string | ||
required: | ||
- releaseImage | ||
type: object | ||
status: | ||
description: MachineConfigServerStatus defines the observed state of MachineConfigServer | ||
properties: | ||
host: | ||
type: string | ||
version: | ||
description: Version is the semantic version of the release used by the mcs. For a mcs a given version represents the ignition config served by the ignition endpoint referenced in the userdata secret. | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.