diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedmachinepools.yaml index 95cffa8a92..028cd8da8b 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedmachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedmachinepools.yaml @@ -51,6 +51,30 @@ spec: GCP resources managed by the GCP provider, in addition to the ones added by default. type: object + diskSizeGB: + description: DiskSizeGB is size of the disk attached to each node, + specified in GB. + format: int64 + type: integer + diskType: + description: DiskType is type of the disk attached to each node. + enum: + - pd-standard + - pd-ssd + - pd-balanced + type: string + imageType: + description: ImageType is image type to use for this nodepool. + type: string + instanceMetadata: + additionalProperties: + type: string + description: InstanceMetadata is metadata key/value pairs assigned + to instances in the cluster. + type: object + instanceType: + description: InstanceType is name of Compute Engine machine type. + type: string kubernetesLabels: additionalProperties: type: string @@ -82,12 +106,79 @@ spec: - value type: object type: array + maxPodsPerNode: + description: MaxPodsPerNode is constraint enforced on the max num + of pods per node. + format: int64 + type: integer + nodeLocations: + description: NodeLocations is the list of zones in which the NodePool's + nodes should be located. + items: + type: string + type: array + nodeNetwork: + description: NodeNetwork specifies the node network configuration + options. + properties: + createPodRange: + description: CreatePodRange specifies whether to create a new + range for pod IPs in this node pool. + type: boolean + podRangeCidrBlock: + description: PodRangeCidrBlock is the IP address range for pod + IPs in this node pool. + type: string + podRangeName: + description: PodRangeName is ID of the secondary range for pod + IPs. + type: string + tags: + description: Tags is list of instance tags applied to all nodes. + Tags are used to identify valid sources or targets for network + firewalls. + items: + type: string + type: array + type: object nodePoolName: description: NodePoolName specifies the name of the GKE node pool corresponding to this MachinePool. If you don't specify a name then a default name will be created based on the namespace and name of the managed machine pool. type: string + nodeSecurity: + description: NodeSecurity specifies the node security options. + properties: + enableIntegrityMonitoring: + description: EnableIntegrityMonitoring defines whether the instance + has integrity monitoring enabled. + type: boolean + enableSecureBoot: + description: EnableSecureBoot defines whether the instance has + Secure Boot enabled. + type: boolean + sandboxType: + description: SandboxType is type of the sandbox to use for the + node. + type: string + serviceAccount: + description: ServiceAccount specifies the identity details for + node pool. + properties: + email: + description: Email is the Google Cloud Platform Service Account + to be used by the node VMs. + type: string + scopes: + description: Scopes is a set of Google API scopes to be made + available on all of the node VMs under the "default" service + account. + items: + type: string + type: array + type: object + type: object providerIDList: description: ProviderIDList are the provider IDs of instances in the managed instance group corresponding to the nodegroup represented diff --git a/exp/api/v1beta1/gcpmanagedmachinepool_types.go b/exp/api/v1beta1/gcpmanagedmachinepool_types.go index b8a2aea0a1..7c0b1a61ac 100644 --- a/exp/api/v1beta1/gcpmanagedmachinepool_types.go +++ b/exp/api/v1beta1/gcpmanagedmachinepool_types.go @@ -37,6 +37,39 @@ type GCPManagedMachinePoolSpec struct { // Scaling specifies scaling for the node pool // +optional Scaling *NodePoolAutoScaling `json:"scaling,omitempty"` + // NodeLocations is the list of zones in which the NodePool's + // nodes should be located. + // +optional + NodeLocations []string `json:"nodeLocations,omitempty"` + // ImageType is image type to use for this nodepool. + // +optional + ImageType string `json:"imageType,omitempty"` + // InstanceType is name of Compute Engine machine type. + // +optional + InstanceType string `json:"instanceType,omitempty"` + // DiskType is type of the disk attached to each node. + // +kubebuilder:validation:Enum=pd-standard;pd-ssd;pd-balanced + // +optional + DiskType string `json:"diskType,omitempty"` + // DiskSizeGB is size of the disk attached to each node, + // specified in GB. + // +optional + DiskSizeGB int64 `json:"diskSizeGB,omitempty"` + // MaxPodsPerNode is constraint enforced on the max num of + // pods per node. + // +optional + MaxPodsPerNode int64 `json:"maxPodsPerNode,omitempty"` + // NodeNetwork specifies the node network configuration + // options. + // +optional + NodeNetwork NodeNetworkConfig `json:"nodeNetwork,omitempty"` + // NodeSecurity specifies the node security options. + // +optional + NodeSecurity NodeSecurityConfig `json:"nodeSecurity,omitempty"` + // InstanceMetadata is metadata key/value pairs assigned to + // instances in the cluster. + // +optional + InstanceMetadata map[string]string `json:"instanceMetadata"` // KubernetesLabels specifies the labels to apply to the nodes of the node pool. // +optional KubernetesLabels infrav1.Labels `json:"kubernetesLabels,omitempty"` @@ -54,6 +87,57 @@ type GCPManagedMachinePoolSpec struct { ProviderIDList []string `json:"providerIDList,omitempty"` } +// NodeNetworkConfig encapsulates node network configurations. +type NodeNetworkConfig struct { + // Tags is list of instance tags applied to all nodes. Tags + // are used to identify valid sources or targets for network + // firewalls. + // +optional + Tags []string `json:"tags,omitempty"` + // CreatePodRange specifies whether to create a new range for + // pod IPs in this node pool. + // +optional + CreatePodRange bool `json:"createPodRange,omitempty"` + // PodRangeName is ID of the secondary range for pod IPs. + // +optional + PodRangeName string `json:"podRangeName,omitempty"` + // PodRangeCidrBlock is the IP address range for pod IPs in + // this node pool. + // +optional + PodRangeCidrBlock string `json:"podRangeCidrBlock"` +} + +// NodeSecurityConfig encapsulates node security configurations. +type NodeSecurityConfig struct { + // ServiceAccount specifies the identity details for node + // pool. + // +optional + ServiceAccount ServiceAccountConfig `json:"serviceAccount,omitempty"` + // SandboxType is type of the sandbox to use for the node. + // +optional + SandboxType string `json:"sandboxType,omitempty"` + // EnableSecureBoot defines whether the instance has Secure + // Boot enabled. + // +optional + EnableSecureBoot bool `json:"enableSecureBoot,omitempty"` + // EnableIntegrityMonitoring defines whether the instance has + // integrity monitoring enabled. + // +optional + EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"` +} + +// ServiceAccountConfig encapsulates service account options. +type ServiceAccountConfig struct { + // Email is the Google Cloud Platform Service Account to be + // used by the node VMs. + // +optional + Email string `json:"email,omitempty"` + // Scopes is a set of Google API scopes to be made available + // on all of the node VMs under the "default" service account. + // +optional + Scopes []string `json:"scopes,omitempty"` +} + // GCPManagedMachinePoolStatus defines the observed state of GCPManagedMachinePool. type GCPManagedMachinePoolStatus struct { Ready bool `json:"ready"` diff --git a/exp/api/v1beta1/zz_generated.deepcopy.go b/exp/api/v1beta1/zz_generated.deepcopy.go index 1e0e020beb..14a7b5b0cb 100644 --- a/exp/api/v1beta1/zz_generated.deepcopy.go +++ b/exp/api/v1beta1/zz_generated.deepcopy.go @@ -319,6 +319,20 @@ func (in *GCPManagedMachinePoolSpec) DeepCopyInto(out *GCPManagedMachinePoolSpec *out = new(NodePoolAutoScaling) (*in).DeepCopyInto(*out) } + if in.NodeLocations != nil { + in, out := &in.NodeLocations, &out.NodeLocations + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.NodeNetwork.DeepCopyInto(&out.NodeNetwork) + in.NodeSecurity.DeepCopyInto(&out.NodeSecurity) + if in.InstanceMetadata != nil { + in, out := &in.InstanceMetadata, &out.InstanceMetadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.KubernetesLabels != nil { in, out := &in.KubernetesLabels, &out.KubernetesLabels *out = make(apiv1beta1.Labels, len(*in)) @@ -377,6 +391,26 @@ func (in *GCPManagedMachinePoolStatus) DeepCopy() *GCPManagedMachinePoolStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeNetworkConfig) DeepCopyInto(out *NodeNetworkConfig) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeNetworkConfig. +func (in *NodeNetworkConfig) DeepCopy() *NodeNetworkConfig { + if in == nil { + return nil + } + out := new(NodeNetworkConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePoolAutoScaling) DeepCopyInto(out *NodePoolAutoScaling) { *out = *in @@ -402,6 +436,42 @@ func (in *NodePoolAutoScaling) DeepCopy() *NodePoolAutoScaling { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSecurityConfig) DeepCopyInto(out *NodeSecurityConfig) { + *out = *in + in.ServiceAccount.DeepCopyInto(&out.ServiceAccount) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSecurityConfig. +func (in *NodeSecurityConfig) DeepCopy() *NodeSecurityConfig { + if in == nil { + return nil + } + out := new(NodeSecurityConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceAccountConfig) DeepCopyInto(out *ServiceAccountConfig) { + *out = *in + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountConfig. +func (in *ServiceAccountConfig) DeepCopy() *ServiceAccountConfig { + if in == nil { + return nil + } + out := new(ServiceAccountConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Taint) DeepCopyInto(out *Taint) { *out = *in