mirror of
https://github.com/rancher/rke.git
synced 2025-09-19 10:26:20 +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:
|
||||
version: v1.7.5_coreos.0
|
||||
image: quay.io/coreos/hyperkube
|
||||
service_cluster_ip_range: 10.233.0.0/18
|
||||
kube-controller:
|
||||
version: v1.7.5_coreos.0
|
||||
image: quay.io/coreos/hyperkube
|
||||
cluster_cider: 10.233.64.0/18
|
||||
service_cluster_ip_range: 10.233.0.0/18
|
||||
scheduler:
|
||||
version: v1.7.5_coreos.0
|
||||
image: quay.io/coreos/hyperkube
|
||||
kubelet:
|
||||
version: v1.7.5_coreos.0
|
||||
image: quay.io/coreos/hyperkube
|
||||
cluster_domain: cluster.local
|
||||
infra_container_image: gcr.io/google_containers/pause-amd64:3.0
|
||||
kubeproxy:
|
||||
version: v1.7.5_coreos.0
|
||||
image: quay.io/coreos/hyperkube
|
||||
|
@@ -1,6 +1,9 @@
|
||||
package hosts
|
||||
|
||||
import "github.com/docker/docker/client"
|
||||
import (
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Hosts struct {
|
||||
Hosts []Host `yaml:"hosts"`
|
||||
@@ -22,6 +25,7 @@ func DivideHosts(hosts []Host) ([]Host, []Host, []Host) {
|
||||
workerHosts := []Host{}
|
||||
for _, host := range hosts {
|
||||
for _, role := range host.Role {
|
||||
logrus.Debugf("Host: " + host.Hostname + " has role: " + role)
|
||||
if role == "etcd" {
|
||||
etcdHosts = append(etcdHosts, host)
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import (
|
||||
type KubeAPI struct {
|
||||
Version string `yaml:"version"`
|
||||
Image string `yaml:"image"`
|
||||
ServiceClusterIPRange string `yaml:"service_cluster_ip_range"`
|
||||
}
|
||||
|
||||
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",
|
||||
"--cloud-provider=",
|
||||
"--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",
|
||||
"--runtime-config=batch/v2alpha1",
|
||||
"--runtime-config=authentication.k8s.io/v1beta1=true",
|
||||
|
@@ -13,6 +13,8 @@ import (
|
||||
type KubeController struct {
|
||||
Version string `yaml:"version"`
|
||||
Image string `yaml:"image"`
|
||||
ClusterCIDR string `yaml:"cluster_cider"`
|
||||
ServiceClusterIPRange string `yaml:"service_cluster_ip_range"`
|
||||
}
|
||||
|
||||
func runKubeController(host hosts.Host, kubeControllerService KubeController) error {
|
||||
@@ -60,8 +62,8 @@ func doRunKubeController(host hosts.Host, kubeControllerService KubeController)
|
||||
"--pod-eviction-timeout=5m0s",
|
||||
"--v=2",
|
||||
"--allocate-node-cidrs=true",
|
||||
"--cluster-cidr=10.233.64.0/18",
|
||||
"--service-cluster-ip-range=10.233.0.0/18"},
|
||||
"--cluster-cidr=" + kubeControllerService.ClusterCIDR,
|
||||
"--service-cluster-ip-range=" + kubeControllerService.ServiceClusterIPRange},
|
||||
}
|
||||
hostCfg := &container.HostConfig{
|
||||
RestartPolicy: container.RestartPolicy{Name: "always"},
|
||||
|
@@ -14,6 +14,8 @@ import (
|
||||
type Kubelet struct {
|
||||
Version string `yaml:"version"`
|
||||
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 {
|
||||
@@ -55,9 +57,9 @@ func doRunKubelet(host hosts.Host, masterHost hosts.Host, kubeletService Kubelet
|
||||
"kubelet",
|
||||
"--v=2",
|
||||
"--address=0.0.0.0",
|
||||
"--cluster-domain=cluster.local",
|
||||
"--cluster-domain=" + kubeletService.ClusterDomain,
|
||||
"--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",
|
||||
"--cgroups-per-qos=True",
|
||||
"--enforce-node-allocatable=",
|
||||
|
Reference in New Issue
Block a user