Agent can now poll osupgrade resources from cluster

This commit is contained in:
2026-04-02 00:07:32 +08:00
parent 145b0a4662
commit e7b8e406a8
7 changed files with 32 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ func NewCmdAgent(flags *genericclioptions.ConfigFlags) *cobra.Command {
rendered := templates.DefaultMonoKSConfig(vals)
cfg = &rendered
klog.InfoS("starting init", "node", cfg.Spec.NodeName, "envFile", envFile)
klog.InfoS("starting agent", "node", cfg.Spec.NodeName, "envFile", envFile)
clients, err := kube.NewClients(flags)
if err != nil {

View File

@@ -14,7 +14,7 @@ func NewCmdVersion() *cobra.Command {
Short: "Print the version information",
RunE: func(cmd *cobra.Command, _ []string) error {
_, err := fmt.Fprintln(cmd.OutOrStdout(), buildInfo.Version)
_, err := fmt.Fprintln(cmd.OutOrStdout(), fmt.Sprintf("%s %s(%s)", buildInfo.Version, buildInfo.GitRevision, buildInfo.Timestamp))
return err
},
}

View File

@@ -300,7 +300,7 @@ func applyControlAgentDaemonSet(ctx context.Context, kubeClient kubernetes.Inter
Name: "agent",
Image: controlAgentImage,
ImagePullPolicy: corev1.PullNever,
Args: []string{"agent"},
Args: []string{"agent", "--env-file", "$(CLUSTER_ENV_FILE)"},
Env: []corev1.EnvVar{
{
Name: "NODE_NAME",

View File

@@ -45,7 +45,7 @@ func defaultTemplateValues() TemplateValues {
return TemplateValues{
Hostname: "monok8s-master-1",
NodeName: "monok8s-master-1",
KubernetesVersion: buildinfo.Version,
KubernetesVersion: buildinfo.KubeVersion,
ClusterName: "monok8s",
ClusterDomain: "cluster.local",
PodSubnet: "10.244.0.0/16",