mirror of https://github.com/kubernetes/kops.git
Add nvidia configuration to the api
This commit is contained in:
parent
d06394def8
commit
e9b0f28dff
|
|
@ -4238,6 +4238,19 @@ spec:
|
||||||
to false.
|
to false.
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
nvidia:
|
||||||
|
description: NvidiaConfiguration configures the Nvidia GPU runtime.
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
description: Enabled determines if kOps will install the Nvidia
|
||||||
|
GPU runtime and drivers. They will only be installed on intances
|
||||||
|
that has an Nvidia GPU.
|
||||||
|
type: boolean
|
||||||
|
package:
|
||||||
|
description: Package is the name of the nvidia driver package
|
||||||
|
that will be installed. Default is "nvidia-headless-460-server".
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
podCIDR:
|
podCIDR:
|
||||||
description: PodCIDR is the CIDR from which we allocate IPs for pods
|
description: PodCIDR is the CIDR from which we allocate IPs for pods
|
||||||
type: string
|
type: string
|
||||||
|
|
|
||||||
|
|
@ -208,12 +208,21 @@ type ClusterSpec struct {
|
||||||
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
|
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
|
||||||
// WarmPool defines the default warm pool settings for instance groups (AWS only).
|
// WarmPool defines the default warm pool settings for instance groups (AWS only).
|
||||||
WarmPool *WarmPoolSpec `json:"warmPool,omitempty"`
|
WarmPool *WarmPoolSpec `json:"warmPool,omitempty"`
|
||||||
|
|
||||||
// ServiceAccountIssuerDiscovery configures the OIDC Issuer for ServiceAccounts.
|
// ServiceAccountIssuerDiscovery configures the OIDC Issuer for ServiceAccounts.
|
||||||
ServiceAccountIssuerDiscovery *ServiceAccountIssuerDiscoveryConfig `json:"serviceAccountIssuerDiscovery,omitempty"`
|
ServiceAccountIssuerDiscovery *ServiceAccountIssuerDiscoveryConfig `json:"serviceAccountIssuerDiscovery,omitempty"`
|
||||||
|
|
||||||
// SnapshotController defines the CSI Snapshot Controller configuration.
|
// SnapshotController defines the CSI Snapshot Controller configuration.
|
||||||
SnapshotController *SnapshotControllerConfig `json:"snapshotController,omitempty"`
|
SnapshotController *SnapshotControllerConfig `json:"snapshotController,omitempty"`
|
||||||
|
// NvidiaConfiguration configures the Nvidia GPU runtime.
|
||||||
|
Nvidia *NvidiaConfig `json:"nvidia,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type NvidiaConfig struct {
|
||||||
|
// Package is the name of the nvidia driver package that will be installed.
|
||||||
|
// Default is "nvidia-headless-460-server".
|
||||||
|
DriverPackage string `json:"package,omitempty"`
|
||||||
|
// Enabled determines if kOps will install the Nvidia GPU runtime and drivers.
|
||||||
|
// They will only be installed on intances that has an Nvidia GPU.
|
||||||
|
Enabled *bool `json:"enabled,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.
|
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.
|
||||||
|
|
|
||||||
|
|
@ -206,12 +206,21 @@ type ClusterSpec struct {
|
||||||
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
|
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
|
||||||
// WarmPool defines the default warm pool settings for instance groups (AWS only).
|
// WarmPool defines the default warm pool settings for instance groups (AWS only).
|
||||||
WarmPool *WarmPoolSpec `json:"warmPool,omitempty"`
|
WarmPool *WarmPoolSpec `json:"warmPool,omitempty"`
|
||||||
|
|
||||||
// ServiceAccountIssuerDiscovery configures the OIDC Issuer for ServiceAccounts.
|
// ServiceAccountIssuerDiscovery configures the OIDC Issuer for ServiceAccounts.
|
||||||
ServiceAccountIssuerDiscovery *ServiceAccountIssuerDiscoveryConfig `json:"serviceAccountIssuerDiscovery,omitempty"`
|
ServiceAccountIssuerDiscovery *ServiceAccountIssuerDiscoveryConfig `json:"serviceAccountIssuerDiscovery,omitempty"`
|
||||||
|
|
||||||
// SnapshotController defines the CSI Snapshot Controller configuration.
|
// SnapshotController defines the CSI Snapshot Controller configuration.
|
||||||
SnapshotController *SnapshotControllerConfig `json:"snapshotController,omitempty"`
|
SnapshotController *SnapshotControllerConfig `json:"snapshotController,omitempty"`
|
||||||
|
// NvidiaConfiguration configures the Nvidia GPU runtime.
|
||||||
|
Nvidia *NvidiaConfig `json:"nvidia,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type NvidiaConfig struct {
|
||||||
|
// Package is the name of the nvidia driver package that will be installed.
|
||||||
|
// Default is "nvidia-headless-460-server".
|
||||||
|
DriverPackage string `json:"package,omitempty"`
|
||||||
|
// Enabled determines if kOps will install the Nvidia GPU runtime and drivers.
|
||||||
|
// They will only be installed on intances that has an Nvidia GPU.
|
||||||
|
Enabled *bool `json:"enabled,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.
|
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.
|
||||||
|
|
|
||||||
|
|
@ -883,6 +883,16 @@ func RegisterConversions(s *runtime.Scheme) error {
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*NvidiaConfig)(nil), (*kops.NvidiaConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig(a.(*NvidiaConfig), b.(*kops.NvidiaConfig), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*kops.NvidiaConfig)(nil), (*NvidiaConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig(a.(*kops.NvidiaConfig), b.(*NvidiaConfig), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := s.AddGeneratedConversionFunc((*OpenstackBlockStorageConfig)(nil), (*kops.OpenstackBlockStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
if err := s.AddGeneratedConversionFunc((*OpenstackBlockStorageConfig)(nil), (*kops.OpenstackBlockStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
return Convert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStorageConfig(a.(*OpenstackBlockStorageConfig), b.(*kops.OpenstackBlockStorageConfig), scope)
|
return Convert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStorageConfig(a.(*OpenstackBlockStorageConfig), b.(*kops.OpenstackBlockStorageConfig), scope)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|
@ -2690,6 +2700,15 @@ func autoConvert_v1alpha2_ClusterSpec_To_kops_ClusterSpec(in *ClusterSpec, out *
|
||||||
} else {
|
} else {
|
||||||
out.SnapshotController = nil
|
out.SnapshotController = nil
|
||||||
}
|
}
|
||||||
|
if in.Nvidia != nil {
|
||||||
|
in, out := &in.Nvidia, &out.Nvidia
|
||||||
|
*out = new(kops.NvidiaConfig)
|
||||||
|
if err := Convert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig(*in, *out, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Nvidia = nil
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3102,6 +3121,15 @@ func autoConvert_kops_ClusterSpec_To_v1alpha2_ClusterSpec(in *kops.ClusterSpec,
|
||||||
} else {
|
} else {
|
||||||
out.SnapshotController = nil
|
out.SnapshotController = nil
|
||||||
}
|
}
|
||||||
|
if in.Nvidia != nil {
|
||||||
|
in, out := &in.Nvidia, &out.Nvidia
|
||||||
|
*out = new(NvidiaConfig)
|
||||||
|
if err := Convert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig(*in, *out, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Nvidia = nil
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6122,6 +6150,28 @@ func Convert_kops_NodeTerminationHandlerConfig_To_v1alpha2_NodeTerminationHandle
|
||||||
return autoConvert_kops_NodeTerminationHandlerConfig_To_v1alpha2_NodeTerminationHandlerConfig(in, out, s)
|
return autoConvert_kops_NodeTerminationHandlerConfig_To_v1alpha2_NodeTerminationHandlerConfig(in, out, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig(in *NvidiaConfig, out *kops.NvidiaConfig, s conversion.Scope) error {
|
||||||
|
out.DriverPackage = in.DriverPackage
|
||||||
|
out.Enabled = in.Enabled
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig is an autogenerated conversion function.
|
||||||
|
func Convert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig(in *NvidiaConfig, out *kops.NvidiaConfig, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1alpha2_NvidiaConfig_To_kops_NvidiaConfig(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig(in *kops.NvidiaConfig, out *NvidiaConfig, s conversion.Scope) error {
|
||||||
|
out.DriverPackage = in.DriverPackage
|
||||||
|
out.Enabled = in.Enabled
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig is an autogenerated conversion function.
|
||||||
|
func Convert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig(in *kops.NvidiaConfig, out *NvidiaConfig, s conversion.Scope) error {
|
||||||
|
return autoConvert_kops_NvidiaConfig_To_v1alpha2_NvidiaConfig(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
func autoConvert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStorageConfig(in *OpenstackBlockStorageConfig, out *kops.OpenstackBlockStorageConfig, s conversion.Scope) error {
|
func autoConvert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStorageConfig(in *OpenstackBlockStorageConfig, out *kops.OpenstackBlockStorageConfig, s conversion.Scope) error {
|
||||||
out.Version = in.Version
|
out.Version = in.Version
|
||||||
out.IgnoreAZ = in.IgnoreAZ
|
out.IgnoreAZ = in.IgnoreAZ
|
||||||
|
|
|
||||||
|
|
@ -1185,6 +1185,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||||
*out = new(SnapshotControllerConfig)
|
*out = new(SnapshotControllerConfig)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
|
if in.Nvidia != nil {
|
||||||
|
in, out := &in.Nvidia, &out.Nvidia
|
||||||
|
*out = new(NvidiaConfig)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4131,6 +4136,27 @@ func (in *NodeTerminationHandlerConfig) DeepCopy() *NodeTerminationHandlerConfig
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *NvidiaConfig) DeepCopyInto(out *NvidiaConfig) {
|
||||||
|
*out = *in
|
||||||
|
if in.Enabled != nil {
|
||||||
|
in, out := &in.Enabled, &out.Enabled
|
||||||
|
*out = new(bool)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NvidiaConfig.
|
||||||
|
func (in *NvidiaConfig) DeepCopy() *NvidiaConfig {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(NvidiaConfig)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *OpenstackBlockStorageConfig) DeepCopyInto(out *OpenstackBlockStorageConfig) {
|
func (in *OpenstackBlockStorageConfig) DeepCopyInto(out *OpenstackBlockStorageConfig) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|
|
||||||
|
|
@ -1269,6 +1269,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||||
*out = new(SnapshotControllerConfig)
|
*out = new(SnapshotControllerConfig)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
|
if in.Nvidia != nil {
|
||||||
|
in, out := &in.Nvidia, &out.Nvidia
|
||||||
|
*out = new(NvidiaConfig)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4313,6 +4318,27 @@ func (in *NodeTerminationHandlerConfig) DeepCopy() *NodeTerminationHandlerConfig
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *NvidiaConfig) DeepCopyInto(out *NvidiaConfig) {
|
||||||
|
*out = *in
|
||||||
|
if in.Enabled != nil {
|
||||||
|
in, out := &in.Enabled, &out.Enabled
|
||||||
|
*out = new(bool)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NvidiaConfig.
|
||||||
|
func (in *NvidiaConfig) DeepCopy() *NvidiaConfig {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(NvidiaConfig)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *OpenstackBlockStorageConfig) DeepCopyInto(out *OpenstackBlockStorageConfig) {
|
func (in *OpenstackBlockStorageConfig) DeepCopyInto(out *OpenstackBlockStorageConfig) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ type Config struct {
|
||||||
|
|
||||||
// APIServerConfig is additional configuration for nodes running an APIServer.
|
// APIServerConfig is additional configuration for nodes running an APIServer.
|
||||||
APIServerConfig *APIServerConfig `json:",omitempty"`
|
APIServerConfig *APIServerConfig `json:",omitempty"`
|
||||||
|
// Nvidia contains the configuration for nvidia
|
||||||
|
Nvidia *kops.NvidiaConfig `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// BootConfig is the configuration for the nodeup binary that might be too big to fit in userdata.
|
// BootConfig is the configuration for the nodeup binary that might be too big to fit in userdata.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue