diff --git a/go.mod b/go.mod index dc70fbc52d..9ca25e4f5d 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/google/go-containerregistry v0.0.0-20190617215043-876b8855d23c github.com/pkg/errors v0.9.1 github.com/rancher/helm-controller v0.7.3 - github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd + github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905 github.com/rancher/wrangler v0.6.1 github.com/sirupsen/logrus v1.6.0 github.com/urfave/cli v1.22.2 diff --git a/go.sum b/go.sum index 3c716b0639..01b278049e 100644 --- a/go.sum +++ b/go.sum @@ -695,8 +695,8 @@ github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373 h1:BePi97poJ github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373/go.mod h1:Vz8oLnHgttpo/aZrTpjbcpZEDzzElqNau2zmorToY0E= github.com/rancher/helm-controller v0.7.3 h1:WTQHcNF2vl9w6Xd1eBtXDe0JUsYMFFstqX9ghGhI5Ac= github.com/rancher/helm-controller v0.7.3/go.mod h1:ZylsxIMGNADRPRNW+NiBWhrwwks9vnKLQiCHYWb6Bi0= -github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd h1:BxaXJ6VOlfeKWvKsCrrbOG8TpHgvat9yxvkETfryxGY= -github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk= +github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905 h1:5dVEwMzgk7/iTzhPXRdG50AsE8mwvtC210Exjfbr9rw= +github.com/rancher/k3s v1.19.2-0.20200919010936-46fe57d7e905/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk= github.com/rancher/kine v0.4.0 h1:1IhWy3TzjExG8xnj46eyUEWdzqNAD1WrgL4eEBKm6Uc= github.com/rancher/kine v0.4.0/go.mod h1:IImtCJ68AIkE+VY/kUI0NkyJL5q5WzO8QvMsSXqbrpA= github.com/rancher/kubernetes v1.19.0-k3s1 h1:TPFj4qlQgZ2E9xE/ScFLtBQoymxPNCXAYHJpSZYRW3o= diff --git a/pkg/podexecutor/staticpod.go b/pkg/podexecutor/staticpod.go index 796a62ab48..78fdb358fa 100644 --- a/pkg/podexecutor/staticpod.go +++ b/pkg/podexecutor/staticpod.go @@ -39,6 +39,7 @@ type StaticPodConfig struct { Images images.Images CloudProvider *CloudProviderConfig CISMode bool + DataDir string } type CloudProviderConfig struct { @@ -101,7 +102,6 @@ func (s *StaticPodConfig) APIServer(ctx context.Context, etcdReady <-chan struct args = append(args[:i], args[i+1:]...) } } - after(etcdReady, func() error { return staticpod.Run(s.ManifestsDir, staticpod.Args{ Command: "kube-apiserver", @@ -109,6 +109,7 @@ func (s *StaticPodConfig) APIServer(ctx context.Context, etcdReady <-chan struct Image: s.Images.KubeAPIServer, Dirs: ssldirs, CPUMillis: 250, + Files: []string{etcdNameFile(s.DataDir)}, }) }) return auth, http.NotFoundHandler(), err @@ -127,6 +128,7 @@ func (s *StaticPodConfig) Scheduler(apiReady <-chan struct{}, args []string) err HealthPort: 10251, HealthProto: "HTTP", CPUMillis: 100, + Files: []string{etcdNameFile(s.DataDir)}, }) }) } @@ -149,6 +151,7 @@ func (s *StaticPodConfig) ControllerManager(apiReady <-chan struct{}, args []str "--cloud-provider="+s.CloudProvider.Name, "--cloud-config="+s.CloudProvider.Path) } + if err := images.Pull(s.ImagesDir, "kube-controller-manager", s.Images.KubeControllManager); err != nil { return err } @@ -163,6 +166,7 @@ func (s *StaticPodConfig) ControllerManager(apiReady <-chan struct{}, args []str HealthPort: 10252, HealthProto: "HTTP", CPUMillis: 200, + Files: []string{etcdNameFile(s.DataDir)}, }) }) } @@ -277,3 +281,7 @@ func chownr(path string, uid, gid int) error { return err }) } + +func etcdNameFile(dataDir string) string { + return filepath.Join(dataDir, "server", "db", "etcd", "name") +} \ No newline at end of file diff --git a/pkg/rke2/rke2.go b/pkg/rke2/rke2.go index 347491217a..9ba5779338 100644 --- a/pkg/rke2/rke2.go +++ b/pkg/rke2/rke2.go @@ -114,6 +114,7 @@ func setup(clx *cli.Context, cfg Config) error { ManifestsDir: agentManifestsDir, CISMode: cisMode, CloudProvider: cpConfig, + DataDir: dataDir, } executor.Set(&sp)