Skip to content

Commit

Permalink
feat: operator 新增 kubelet 日志打印逻辑 --story=119827827 (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Sep 23, 2024
1 parent 8a57d1f commit 55b1ad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/operator/configs/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package configs

import (
"fmt"
"os"

"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -70,6 +71,10 @@ type Kubelet struct {
Name string `yaml:"name"`
}

func (k Kubelet) String() string {
return fmt.Sprintf("%s/%s", k.Namespace, k.Name)
}

// HTTP http 服务配置
type HTTP struct {
Port int `yaml:"port"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/operator/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ func (c *Operator) syncNodeEndpoints(ctx context.Context) error {
if err != nil {
return errors.Wrap(err, "synchronizing kubelet service object failed")
}
logger.Infof("sync kubelet service %s", configs.G().Kubelet)

err = k8sutils.CreateOrUpdateEndpoints(ctx, c.client.CoreV1().Endpoints(configs.G().Kubelet.Namespace), eps)
if err != nil {
return errors.Wrap(err, "synchronizing kubelet endpoints object failed")
}
logger.Infof("sync kubelet endpoints %s, address count (%d)", configs.G().Kubelet, len(addresses))

return nil
}
Expand Down

0 comments on commit 55b1ad3

Please sign in to comment.