Skip to content
Snippets Groups Projects
Commit 621d0cc5 authored by kaiyou's avatar kaiyou
Browse files

Write config files in standard locations

parent 543d9787
No related branches found
No related tags found
No related merge requests found
...@@ -96,7 +96,7 @@ func (s *ClusterServices) startK8sMaster(net *ClusterNetworking, ca *pki.Cluster ...@@ -96,7 +96,7 @@ func (s *ClusterServices) startK8sMaster(net *ClusterNetworking, ca *pki.Cluster
ClientCert: certs.ControllersAPI.CertPath(), ClientCert: certs.ControllersAPI.CertPath(),
ClientKey: certs.ControllersAPI.KeyPath(), ClientKey: certs.ControllersAPI.KeyPath(),
} }
cmConfigPath := "/cm.yaml" cmConfigPath := "/etc/k8s/controller-manager.yaml"
WriteConfig(cmConfig, cmConfigPath) WriteConfig(cmConfig, cmConfigPath)
cm, err := wrappers.ControllerManager(s.ctx, []string{ cm, err := wrappers.ControllerManager(s.ctx, []string{
"--kubeconfig", cmConfigPath, "--kubeconfig", cmConfigPath,
...@@ -114,7 +114,7 @@ func (s *ClusterServices) startK8sMaster(net *ClusterNetworking, ca *pki.Cluster ...@@ -114,7 +114,7 @@ func (s *ClusterServices) startK8sMaster(net *ClusterNetworking, ca *pki.Cluster
ClientCert: certs.SchedulerAPI.CertPath(), ClientCert: certs.SchedulerAPI.CertPath(),
ClientKey: certs.SchedulerAPI.KeyPath(), ClientKey: certs.SchedulerAPI.KeyPath(),
} }
schedulerConfigPath := "/scheduler.yaml" schedulerConfigPath := "/etc/k8s/scheduler.yaml"
WriteConfig(schedulerConfig, schedulerConfigPath) WriteConfig(schedulerConfig, schedulerConfigPath)
scheduler, err := wrappers.Scheduler(s.ctx, []string{ scheduler, err := wrappers.Scheduler(s.ctx, []string{
"--kubeconfig", schedulerConfigPath, "--kubeconfig", schedulerConfigPath,
...@@ -133,7 +133,7 @@ func (s *ClusterServices) startK8sNode(master net.IP, ca *pki.ClusterCA, certs * ...@@ -133,7 +133,7 @@ func (s *ClusterServices) startK8sNode(master net.IP, ca *pki.ClusterCA, certs *
RootDir: "/containerd", RootDir: "/containerd",
Socket: "/containerd.sock", Socket: "/containerd.sock",
} }
containerdConfigPath := "/containerd.toml" containerdConfigPath := "/etc/containerd/config.toml"
WriteConfig(containerdConfig, containerdConfigPath) WriteConfig(containerdConfig, containerdConfigPath)
containerd, err := wrappers.Containerd(s.ctx, []string{ containerd, err := wrappers.Containerd(s.ctx, []string{
"--config", containerdConfigPath, "--config", containerdConfigPath,
...@@ -148,14 +148,14 @@ func (s *ClusterServices) startK8sNode(master net.IP, ca *pki.ClusterCA, certs * ...@@ -148,14 +148,14 @@ func (s *ClusterServices) startK8sNode(master net.IP, ca *pki.ClusterCA, certs *
ClientCert: certs.API.CertPath(), ClientCert: certs.API.CertPath(),
ClientKey: certs.API.KeyPath(), ClientKey: certs.API.KeyPath(),
} }
kubeletKubeConfigPath := "/kubelet-kubeconfig.yaml" kubeletKubeConfigPath := "/etc/k8s/kubelet-kubeconfig.yaml"
WriteConfig(kubeletKubeConfig, kubeletKubeConfigPath) WriteConfig(kubeletKubeConfig, kubeletKubeConfigPath)
kubeletConfig := KubeletConfig{ kubeletConfig := KubeletConfig{
CACert: ca.Kubelet.CertPath(), CACert: ca.Kubelet.CertPath(),
TLSCert: certs.TLS.CertPath(), TLSCert: certs.TLS.CertPath(),
TLSKey: certs.TLS.KeyPath(), TLSKey: certs.TLS.KeyPath(),
} }
kubeletConfigPath := "/kubelet.yaml" kubeletConfigPath := "/etc/k8s/kubelet.yaml"
WriteConfig(kubeletConfig, kubeletConfigPath) WriteConfig(kubeletConfig, kubeletConfigPath)
kubelet, err := wrappers.Kubelet(s.ctx, []string{ kubelet, err := wrappers.Kubelet(s.ctx, []string{
"--kubeconfig", kubeletKubeConfigPath, "--kubeconfig", kubeletKubeConfigPath,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment