mirror of
https://github.com/rancher/rke.git
synced 2025-09-19 18:30:38 +00:00
Add k8s services options based on k8s version
This commit is contained in:
@@ -114,6 +114,14 @@ func (c *Cluster) BuildKubeAPIProcess() v3.Process {
|
|||||||
if len(c.CloudProvider.Name) > 0 {
|
if len(c.CloudProvider.Name) > 0 {
|
||||||
CommandArgs["cloud-config"] = CloudConfigPath
|
CommandArgs["cloud-config"] = CloudConfigPath
|
||||||
}
|
}
|
||||||
|
// check if our version has specific options for this component
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
||||||
|
if ok && serviceOptions.KubeAPI != nil {
|
||||||
|
for k, v := range serviceOptions.KubeAPI {
|
||||||
|
CommandArgs[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"--etcd-cafile=" + etcdCAClientCert,
|
"--etcd-cafile=" + etcdCAClientCert,
|
||||||
"--etcd-certfile=" + etcdClientCert,
|
"--etcd-certfile=" + etcdClientCert,
|
||||||
@@ -196,6 +204,15 @@ func (c *Cluster) BuildKubeControllerProcess() v3.Process {
|
|||||||
if len(c.CloudProvider.Name) > 0 {
|
if len(c.CloudProvider.Name) > 0 {
|
||||||
CommandArgs["cloud-config"] = CloudConfigPath
|
CommandArgs["cloud-config"] = CloudConfigPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if our version has specific options for this component
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
||||||
|
if ok && serviceOptions.KubeController != nil {
|
||||||
|
for k, v := range serviceOptions.KubeController {
|
||||||
|
CommandArgs[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{}
|
args := []string{}
|
||||||
if c.Authorization.Mode == services.RBACAuthorizationMode {
|
if c.Authorization.Mode == services.RBACAuthorizationMode {
|
||||||
args = append(args, "--use-service-account-credentials=true")
|
args = append(args, "--use-service-account-credentials=true")
|
||||||
@@ -275,6 +292,15 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host) v3.Process {
|
|||||||
if len(c.CloudProvider.Name) > 0 {
|
if len(c.CloudProvider.Name) > 0 {
|
||||||
CommandArgs["cloud-config"] = CloudConfigPath
|
CommandArgs["cloud-config"] = CloudConfigPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if our version has specific options for this component
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
||||||
|
if ok && serviceOptions.Kubelet != nil {
|
||||||
|
for k, v := range serviceOptions.Kubelet {
|
||||||
|
CommandArgs[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VolumesFrom := []string{
|
VolumesFrom := []string{
|
||||||
services.SidekickContainerName,
|
services.SidekickContainerName,
|
||||||
}
|
}
|
||||||
@@ -340,6 +366,14 @@ func (c *Cluster) BuildKubeProxyProcess() v3.Process {
|
|||||||
"kubeconfig": pki.GetConfigPath(pki.KubeProxyCertName),
|
"kubeconfig": pki.GetConfigPath(pki.KubeProxyCertName),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if our version has specific options for this component
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
||||||
|
if ok && serviceOptions.Kubeproxy != nil {
|
||||||
|
for k, v := range serviceOptions.Kubeproxy {
|
||||||
|
CommandArgs[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VolumesFrom := []string{
|
VolumesFrom := []string{
|
||||||
services.SidekickContainerName,
|
services.SidekickContainerName,
|
||||||
}
|
}
|
||||||
@@ -415,6 +449,14 @@ func (c *Cluster) BuildSchedulerProcess() v3.Process {
|
|||||||
"kubeconfig": pki.GetConfigPath(pki.KubeSchedulerCertName),
|
"kubeconfig": pki.GetConfigPath(pki.KubeSchedulerCertName),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if our version has specific options for this component
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
||||||
|
if ok && serviceOptions.Scheduler != nil {
|
||||||
|
for k, v := range serviceOptions.Scheduler {
|
||||||
|
CommandArgs[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VolumesFrom := []string{
|
VolumesFrom := []string{
|
||||||
services.SidekickContainerName,
|
services.SidekickContainerName,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user