Skip to content

Commit

Permalink
Merge pull request #2256 from will4j/feature/post-cluster-scripts
Browse files Browse the repository at this point in the history
feat: add phase PostClusterInstall
  • Loading branch information
ks-ci-bot committed May 27, 2024
2 parents ebc211d + 1e36c20 commit 0fa204f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cmd/kk/apis/kubekey/v1alpha2/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ type CustomScripts struct {

// System defines the system config for each node in cluster.
type System struct {
NtpServers []string `yaml:"ntpServers" json:"ntpServers,omitempty"`
Timezone string `yaml:"timezone" json:"timezone,omitempty"`
Rpms []string `yaml:"rpms" json:"rpms,omitempty"`
Debs []string `yaml:"debs" json:"debs,omitempty"`
PreInstall []CustomScripts `yaml:"preInstall" json:"preInstall,omitempty"`
PostInstall []CustomScripts `yaml:"postInstall" json:"postInstall,omitempty"`
SkipConfigureOS bool `yaml:"skipConfigureOS" json:"skipConfigureOS,omitempty"`
NtpServers []string `yaml:"ntpServers" json:"ntpServers,omitempty"`
Timezone string `yaml:"timezone" json:"timezone,omitempty"`
Rpms []string `yaml:"rpms" json:"rpms,omitempty"`
Debs []string `yaml:"debs" json:"debs,omitempty"`
PreInstall []CustomScripts `yaml:"preInstall" json:"preInstall,omitempty"`
PostClusterInstall []CustomScripts `yaml:"postClusterInstall" json:"postClusterInstall,omitempty"`
PostInstall []CustomScripts `yaml:"postInstall" json:"postInstall,omitempty"`
SkipConfigureOS bool `yaml:"skipConfigureOS" json:"skipConfigureOS,omitempty"`
}

// RegistryConfig defines the configuration information of the image's repository.
Expand Down
3 changes: 3 additions & 0 deletions cmd/kk/pkg/pipelines/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func NewCreateClusterPipeline(runtime *common.KubeRuntime) error {
&kubernetes.SecurityEnhancementModule{Skip: !runtime.Arg.SecurityEnhancement},
&kubernetes.SaveKubeConfigModule{},
&plugins.DeployPluginsModule{},
&customscripts.CustomScriptsModule{Phase: "PostClusterInstall", Scripts: runtime.Cluster.System.PostClusterInstall},
&addons.AddonsModule{},
&storage.DeployLocalVolumeModule{Skip: skipLocalStorage},
&kubesphere.DeployModule{Skip: !runtime.Cluster.KubeSphere.Enabled},
Expand Down Expand Up @@ -166,6 +167,7 @@ func NewK3sCreateClusterPipeline(runtime *common.KubeRuntime) error {
&filesystem.ChownModule{},
&certs.AutoRenewCertsModule{Skip: !runtime.Cluster.Kubernetes.EnableAutoRenewCerts()},
&k3s.SaveKubeConfigModule{},
&customscripts.CustomScriptsModule{Phase: "PostClusterInstall", Scripts: runtime.Cluster.System.PostClusterInstall},
&addons.AddonsModule{},
&storage.DeployLocalVolumeModule{Skip: skipLocalStorage},
&kubesphere.DeployModule{Skip: !runtime.Cluster.KubeSphere.Enabled},
Expand Down Expand Up @@ -240,6 +242,7 @@ func NewK8eCreateClusterPipeline(runtime *common.KubeRuntime) error {
&filesystem.ChownModule{},
&certs.AutoRenewCertsModule{Skip: !runtime.Cluster.Kubernetes.EnableAutoRenewCerts()},
&k8e.SaveKubeConfigModule{},
&customscripts.CustomScriptsModule{Phase: "PostClusterInstall", Scripts: runtime.Cluster.System.PostClusterInstall},
&addons.AddonsModule{},
&storage.DeployLocalVolumeModule{Skip: skipLocalStorage},
&kubesphere.DeployModule{Skip: !runtime.Cluster.KubeSphere.Enabled},
Expand Down

0 comments on commit 0fa204f

Please sign in to comment.