Merge pull request #16001 from hakman/clluster-packages

Add support for installing additional packages at cluster level
This commit is contained in:
Kubernetes Prow Robot 2023-10-06 11:33:05 +02:00 committed by GitHub
commit 8a63ba4def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 3 deletions

View File

@ -5611,6 +5611,11 @@ spec:
to false.
type: boolean
type: object
packages:
description: Packages specifies additional packages to be installed.
items:
type: string
type: array
podCIDR:
description: PodCIDR is the CIDR from which we allocate IPs for pods
type: string

View File

@ -114,6 +114,8 @@ type ClusterSpec struct {
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDNS,omitempty"`
NTP *NTPConfig `json:"ntp,omitempty"`
// Packages specifies additional packages to be installed.
Packages []string `json:"packages,omitempty"`
// NodeProblemDetector determines the node problem detector configuration.
NodeProblemDetector *NodeProblemDetectorConfig `json:"nodeProblemDetector,omitempty"`

View File

@ -186,6 +186,8 @@ type ClusterSpec struct {
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDns,omitempty"`
NTP *NTPConfig `json:"ntp,omitempty"`
// Packages specifies additional packages to be installed.
Packages []string `json:"packages,omitempty"`
// NodeTerminationHandler determines the cluster autoscaler configuration.
// +k8s:conversion-gen=false

View File

@ -2593,6 +2593,7 @@ func autoConvert_v1alpha2_ClusterSpec_To_kops_ClusterSpec(in *ClusterSpec, out *
} else {
out.NTP = nil
}
out.Packages = in.Packages
// INFO: in.NodeTerminationHandler opted out of conversion generation
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
@ -2932,6 +2933,7 @@ func autoConvert_kops_ClusterSpec_To_v1alpha2_ClusterSpec(in *kops.ClusterSpec,
} else {
out.NTP = nil
}
out.Packages = in.Packages
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
*out = new(NodeProblemDetectorConfig)

View File

@ -1239,6 +1239,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = new(NTPConfig)
(*in).DeepCopyInto(*out)
}
if in.Packages != nil {
in, out := &in.Packages, &out.Packages
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.NodeTerminationHandler != nil {
in, out := &in.NodeTerminationHandler, &out.NodeTerminationHandler
*out = new(NodeTerminationHandlerSpec)

View File

@ -111,6 +111,8 @@ type ClusterSpec struct {
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDNS,omitempty"`
NTP *NTPConfig `json:"ntp,omitempty"`
// Packages specifies additional packages to be installed.
Packages []string `json:"packages,omitempty"`
// NodeProblemDetector determines the node problem detector configuration.
NodeProblemDetector *NodeProblemDetectorConfig `json:"nodeProblemDetector,omitempty"`

View File

@ -2823,6 +2823,7 @@ func autoConvert_v1alpha3_ClusterSpec_To_kops_ClusterSpec(in *ClusterSpec, out *
} else {
out.NTP = nil
}
out.Packages = in.Packages
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
*out = new(kops.NodeProblemDetectorConfig)
@ -3156,6 +3157,7 @@ func autoConvert_kops_ClusterSpec_To_v1alpha3_ClusterSpec(in *kops.ClusterSpec,
} else {
out.NTP = nil
}
out.Packages = in.Packages
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
*out = new(NodeProblemDetectorConfig)

View File

@ -1164,6 +1164,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = new(NTPConfig)
(*in).DeepCopyInto(*out)
}
if in.Packages != nil {
in, out := &in.Packages, &out.Packages
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
*out = new(NodeProblemDetectorConfig)

View File

@ -1261,6 +1261,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = new(NTPConfig)
(*in).DeepCopyInto(*out)
}
if in.Packages != nil {
in, out := &in.Packages, &out.Packages
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.NodeProblemDetector != nil {
in, out := &in.NodeProblemDetector, &out.NodeProblemDetector
*out = new(NodeProblemDetectorConfig)

View File

@ -1531,9 +1531,8 @@ func (n *nodeUpConfigBuilder) BuildConfig(ig *kops.InstanceGroup, apiserverAddit
}
}
if ig.Spec.Packages != nil {
config.Packages = ig.Spec.Packages
}
config.Packages = append(config.Packages, cluster.Spec.Packages...)
config.Packages = append(config.Packages, ig.Spec.Packages...)
return config, bootConfig, nil
}