mirror of
https://github.com/rancher/rke.git
synced 2025-09-19 01:44:28 +00:00
Merge pull request #514 from moelsayed/fix_511
Use kubernetes major version for service options
This commit is contained in:
@@ -122,8 +122,8 @@ func (c *Cluster) BuildKubeAPIProcess(prefixPath string) v3.Process {
|
|||||||
CommandArgs["cloud-config"] = CloudConfigPath
|
CommandArgs["cloud-config"] = CloudConfigPath
|
||||||
}
|
}
|
||||||
// check if our version has specific options for this component
|
// check if our version has specific options for this component
|
||||||
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
serviceOptions := GetKubernetesServicesOptions(c.Version)
|
||||||
if ok && serviceOptions.KubeAPI != nil {
|
if serviceOptions.KubeAPI != nil {
|
||||||
for k, v := range serviceOptions.KubeAPI {
|
for k, v := range serviceOptions.KubeAPI {
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
@@ -213,8 +213,8 @@ func (c *Cluster) BuildKubeControllerProcess(prefixPath string) v3.Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if our version has specific options for this component
|
// check if our version has specific options for this component
|
||||||
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
serviceOptions := GetKubernetesServicesOptions(c.Version)
|
||||||
if ok && serviceOptions.KubeController != nil {
|
if serviceOptions.KubeController != nil {
|
||||||
for k, v := range serviceOptions.KubeController {
|
for k, v := range serviceOptions.KubeController {
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
@@ -302,8 +302,8 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, prefixPath string) v3.Pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if our version has specific options for this component
|
// check if our version has specific options for this component
|
||||||
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
serviceOptions := GetKubernetesServicesOptions(c.Version)
|
||||||
if ok && serviceOptions.Kubelet != nil {
|
if serviceOptions.Kubelet != nil {
|
||||||
for k, v := range serviceOptions.Kubelet {
|
for k, v := range serviceOptions.Kubelet {
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
@@ -375,8 +375,8 @@ func (c *Cluster) BuildKubeProxyProcess(prefixPath string) v3.Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if our version has specific options for this component
|
// check if our version has specific options for this component
|
||||||
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
serviceOptions := GetKubernetesServicesOptions(c.Version)
|
||||||
if ok && serviceOptions.Kubeproxy != nil {
|
if serviceOptions.Kubeproxy != nil {
|
||||||
for k, v := range serviceOptions.Kubeproxy {
|
for k, v := range serviceOptions.Kubeproxy {
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
@@ -458,8 +458,8 @@ func (c *Cluster) BuildSchedulerProcess(prefixPath string) v3.Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if our version has specific options for this component
|
// check if our version has specific options for this component
|
||||||
serviceOptions, ok := v3.K8sVersionServiceOptions[c.Version]
|
serviceOptions := GetKubernetesServicesOptions(c.Version)
|
||||||
if ok && serviceOptions.Scheduler != nil {
|
if serviceOptions.Scheduler != nil {
|
||||||
for k, v := range serviceOptions.Scheduler {
|
for k, v := range serviceOptions.Scheduler {
|
||||||
CommandArgs[k] = v
|
CommandArgs[k] = v
|
||||||
}
|
}
|
||||||
@@ -609,3 +609,13 @@ func (c *Cluster) getPrefixPath(osType string) string {
|
|||||||
}
|
}
|
||||||
return prefixPath
|
return prefixPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetKubernetesServicesOptions(version string) v3.KubernetesServicesOptions {
|
||||||
|
splitVersion := strings.Split(version, ".")
|
||||||
|
majorVersion := strings.Join(splitVersion[:2], ".")
|
||||||
|
serviceOptions, ok := v3.K8sVersionServiceOptions[majorVersion]
|
||||||
|
if ok {
|
||||||
|
return serviceOptions
|
||||||
|
}
|
||||||
|
return v3.KubernetesServicesOptions{}
|
||||||
|
}
|
||||||
|
@@ -24,4 +24,4 @@ github.com/coreos/go-semver e214231b295a8ea9479f11b70b35d5acf3556d9
|
|||||||
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
||||||
|
|
||||||
github.com/rancher/norman ff60298f31f081b06d198815b4c178a578664f7d
|
github.com/rancher/norman ff60298f31f081b06d198815b4c178a578664f7d
|
||||||
github.com/rancher/types 32ed9ccfe5b3ffd6acff15e354c0dd713f5b88d7
|
github.com/rancher/types 681245a6f5e7b007ae58f0eb3e9f956d93930368
|
||||||
|
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go
generated
vendored
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/cluster_types.go
generated
vendored
@@ -28,6 +28,9 @@ const (
|
|||||||
ClusterConditionconditionDefautlProjectCreated condition.Cond = "DefaultProjectCreated"
|
ClusterConditionconditionDefautlProjectCreated condition.Cond = "DefaultProjectCreated"
|
||||||
// ClusterConditionDefaultNamespaceAssigned true when cluster's default namespace has been initially assigned
|
// ClusterConditionDefaultNamespaceAssigned true when cluster's default namespace has been initially assigned
|
||||||
ClusterConditionDefaultNamespaceAssigned condition.Cond = "DefaultNamespaceAssigned"
|
ClusterConditionDefaultNamespaceAssigned condition.Cond = "DefaultNamespaceAssigned"
|
||||||
|
// ClusterConditionSystemNamespacesAssigned true when cluster's system namespaces has been initially assigned to
|
||||||
|
// a system project
|
||||||
|
ClusterConditionSystemNamespacesAssigned condition.Cond = "SystemNamespacesAssigned"
|
||||||
ClusterConditionAddonDeploy condition.Cond = "AddonDeploy"
|
ClusterConditionAddonDeploy condition.Cond = "AddonDeploy"
|
||||||
ClusterConditionSystemAccountCreated condition.Cond = "SystemAccountCreated"
|
ClusterConditionSystemAccountCreated condition.Cond = "SystemAccountCreated"
|
||||||
ClusterConditionAgentDeployed condition.Cond = "AgentDeployed"
|
ClusterConditionAgentDeployed condition.Cond = "AgentDeployed"
|
||||||
|
4
vendor/github.com/rancher/types/apis/management.cattle.io/v3/k8s_defaults.go
generated
vendored
4
vendor/github.com/rancher/types/apis/management.cattle.io/v3/k8s_defaults.go
generated
vendored
@@ -4,6 +4,8 @@ const (
|
|||||||
K8sV18 = "v1.8.10-rancher1-1"
|
K8sV18 = "v1.8.10-rancher1-1"
|
||||||
K8sV19 = "v1.9.5-rancher1-1"
|
K8sV19 = "v1.9.5-rancher1-1"
|
||||||
K8sV110 = "v1.10.0-rancher1-1"
|
K8sV110 = "v1.10.0-rancher1-1"
|
||||||
|
|
||||||
|
MajorK8sV110 = "v1.10"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -16,7 +18,7 @@ var (
|
|||||||
|
|
||||||
// K8sVersionServiceOptions - service options per k8s version
|
// K8sVersionServiceOptions - service options per k8s version
|
||||||
K8sVersionServiceOptions = map[string]KubernetesServicesOptions{
|
K8sVersionServiceOptions = map[string]KubernetesServicesOptions{
|
||||||
K8sV110: v110ServiceOptions,
|
MajorK8sV110: v110ServiceOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
// K8SVersionToSystemImages16 - images map for 1.6. Keeping it sepate in case we have to diverge
|
// K8SVersionToSystemImages16 - images map for 1.6. Keeping it sepate in case we have to diverge
|
||||||
|
Reference in New Issue
Block a user