Skip to content

Commit

Permalink
Add support for installing additional packages at cluster level
Browse files Browse the repository at this point in the history
  • Loading branch information
hakman committed Oct 6, 2023
1 parent fcb3a85 commit 271f3e4
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 3 deletions.
5 changes: 5 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions upup/pkg/fi/cloudup/apply_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 271f3e4

Please sign in to comment.