mirror of
https://github.com/rancher/rke.git
synced 2025-09-19 18:30:38 +00:00
some small fixes
add debugging to hosts.go add kubelet and kubeproxy defaults to cluster file add more service configuration remove hosts sudo
This commit is contained in:
@@ -17,15 +17,20 @@ services:
|
|||||||
kube-api:
|
kube-api:
|
||||||
version: v1.7.5_coreos.0
|
version: v1.7.5_coreos.0
|
||||||
image: quay.io/coreos/hyperkube
|
image: quay.io/coreos/hyperkube
|
||||||
|
service_cluster_ip_range: 10.233.0.0/18
|
||||||
kube-controller:
|
kube-controller:
|
||||||
version: v1.7.5_coreos.0
|
version: v1.7.5_coreos.0
|
||||||
image: quay.io/coreos/hyperkube
|
image: quay.io/coreos/hyperkube
|
||||||
|
cluster_cider: 10.233.64.0/18
|
||||||
|
service_cluster_ip_range: 10.233.0.0/18
|
||||||
scheduler:
|
scheduler:
|
||||||
version: v1.7.5_coreos.0
|
version: v1.7.5_coreos.0
|
||||||
image: quay.io/coreos/hyperkube
|
image: quay.io/coreos/hyperkube
|
||||||
kubelet:
|
kubelet:
|
||||||
version: v1.7.5_coreos.0
|
version: v1.7.5_coreos.0
|
||||||
image: quay.io/coreos/hyperkube
|
image: quay.io/coreos/hyperkube
|
||||||
|
cluster_domain: cluster.local
|
||||||
|
infra_container_image: gcr.io/google_containers/pause-amd64:3.0
|
||||||
kubeproxy:
|
kubeproxy:
|
||||||
version: v1.7.5_coreos.0
|
version: v1.7.5_coreos.0
|
||||||
image: quay.io/coreos/hyperkube
|
image: quay.io/coreos/hyperkube
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
package hosts
|
package hosts
|
||||||
|
|
||||||
import "github.com/docker/docker/client"
|
import (
|
||||||
|
"github.com/docker/docker/client"
|
||||||
|
"github.com/Sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
type Hosts struct {
|
type Hosts struct {
|
||||||
Hosts []Host `yaml:"hosts"`
|
Hosts []Host `yaml:"hosts"`
|
||||||
@@ -22,6 +25,7 @@ func DivideHosts(hosts []Host) ([]Host, []Host, []Host) {
|
|||||||
workerHosts := []Host{}
|
workerHosts := []Host{}
|
||||||
for _, host := range hosts {
|
for _, host := range hosts {
|
||||||
for _, role := range host.Role {
|
for _, role := range host.Role {
|
||||||
|
logrus.Debugf("Host: " + host.Hostname + " has role: " + role)
|
||||||
if role == "etcd" {
|
if role == "etcd" {
|
||||||
etcdHosts = append(etcdHosts, host)
|
etcdHosts = append(etcdHosts, host)
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,7 @@ import (
|
|||||||
type KubeAPI struct {
|
type KubeAPI struct {
|
||||||
Version string `yaml:"version"`
|
Version string `yaml:"version"`
|
||||||
Image string `yaml:"image"`
|
Image string `yaml:"image"`
|
||||||
|
ServiceClusterIPRange string `yaml:"service_cluster_ip_range"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func runKubeAPI(host hosts.Host, etcdHosts []hosts.Host, kubeAPIService KubeAPI) error {
|
func runKubeAPI(host hosts.Host, etcdHosts []hosts.Host, kubeAPIService KubeAPI) error {
|
||||||
@@ -57,7 +58,7 @@ func doRunKubeAPI(host hosts.Host, kubeAPIService KubeAPI, etcdConnString string
|
|||||||
"--insecure-port=8080",
|
"--insecure-port=8080",
|
||||||
"--cloud-provider=",
|
"--cloud-provider=",
|
||||||
"--allow_privileged=true",
|
"--allow_privileged=true",
|
||||||
"--service-cluster-ip-range=10.233.0.0/18",
|
"--service-cluster-ip-range=" + kubeAPIService.ServiceClusterIPRange,
|
||||||
"--admission-control=NamespaceLifecycle,LimitRanger,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds",
|
"--admission-control=NamespaceLifecycle,LimitRanger,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds",
|
||||||
"--runtime-config=batch/v2alpha1",
|
"--runtime-config=batch/v2alpha1",
|
||||||
"--runtime-config=authentication.k8s.io/v1beta1=true",
|
"--runtime-config=authentication.k8s.io/v1beta1=true",
|
||||||
|
@@ -13,6 +13,8 @@ import (
|
|||||||
type KubeController struct {
|
type KubeController struct {
|
||||||
Version string `yaml:"version"`
|
Version string `yaml:"version"`
|
||||||
Image string `yaml:"image"`
|
Image string `yaml:"image"`
|
||||||
|
ClusterCIDR string `yaml:"cluster_cider"`
|
||||||
|
ServiceClusterIPRange string `yaml:"service_cluster_ip_range"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func runKubeController(host hosts.Host, kubeControllerService KubeController) error {
|
func runKubeController(host hosts.Host, kubeControllerService KubeController) error {
|
||||||
@@ -60,8 +62,8 @@ func doRunKubeController(host hosts.Host, kubeControllerService KubeController)
|
|||||||
"--pod-eviction-timeout=5m0s",
|
"--pod-eviction-timeout=5m0s",
|
||||||
"--v=2",
|
"--v=2",
|
||||||
"--allocate-node-cidrs=true",
|
"--allocate-node-cidrs=true",
|
||||||
"--cluster-cidr=10.233.64.0/18",
|
"--cluster-cidr=" + kubeControllerService.ClusterCIDR,
|
||||||
"--service-cluster-ip-range=10.233.0.0/18"},
|
"--service-cluster-ip-range=" + kubeControllerService.ServiceClusterIPRange},
|
||||||
}
|
}
|
||||||
hostCfg := &container.HostConfig{
|
hostCfg := &container.HostConfig{
|
||||||
RestartPolicy: container.RestartPolicy{Name: "always"},
|
RestartPolicy: container.RestartPolicy{Name: "always"},
|
||||||
|
@@ -14,6 +14,8 @@ import (
|
|||||||
type Kubelet struct {
|
type Kubelet struct {
|
||||||
Version string `yaml:"version"`
|
Version string `yaml:"version"`
|
||||||
Image string `yaml:"image"`
|
Image string `yaml:"image"`
|
||||||
|
ClusterDomain string `yaml:"cluster_domain"`
|
||||||
|
InfraContainerImage string `yaml:"infra_container_image"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func runKubelet(host hosts.Host, masterHost hosts.Host, kubeletService Kubelet, isMaster bool) error {
|
func runKubelet(host hosts.Host, masterHost hosts.Host, kubeletService Kubelet, isMaster bool) error {
|
||||||
@@ -55,9 +57,9 @@ func doRunKubelet(host hosts.Host, masterHost hosts.Host, kubeletService Kubelet
|
|||||||
"kubelet",
|
"kubelet",
|
||||||
"--v=2",
|
"--v=2",
|
||||||
"--address=0.0.0.0",
|
"--address=0.0.0.0",
|
||||||
"--cluster-domain=cluster.local",
|
"--cluster-domain=" + kubeletService.ClusterDomain,
|
||||||
"--hostname-override=" + host.Hostname,
|
"--hostname-override=" + host.Hostname,
|
||||||
"--pod-infra-container-image=gcr.io/google_containers/pause-amd64:3.0",
|
"--pod-infra-container-image=" + kubeletService.InfraContainerImage,
|
||||||
"--cgroup-driver=cgroupfs",
|
"--cgroup-driver=cgroupfs",
|
||||||
"--cgroups-per-qos=True",
|
"--cgroups-per-qos=True",
|
||||||
"--enforce-node-allocatable=",
|
"--enforce-node-allocatable=",
|
||||||
|
Reference in New Issue
Block a user