1 Star 0 Fork 0

litian/rke

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
services.go 827 Bytes
一键复制 编辑 原始数据 按行查看 历史
galal-hussein 提交于 2017-11-15 03:12 . Add HA
package services
import (
"fmt"
"net"
)
const (
ETCDRole = "etcd"
ControlRole = "controlplane"
WorkerRole = "worker"
KubeAPIContainerName = "kube-api"
KubeletContainerName = "kubelet"
KubeproxyContainerName = "kube-proxy"
KubeControllerContainerName = "kube-controller"
SchedulerContainerName = "scheduler"
EtcdContainerName = "etcd"
NginxProxyContainerName = "nginx-proxy"
)
func GetKubernetesServiceIP(serviceClusterRange string) (net.IP, error) {
ip, ipnet, err := net.ParseCIDR(serviceClusterRange)
if err != nil {
return nil, fmt.Errorf("Failed to get kubernetes service IP from Kube API option [service_cluster_ip_range]: %v", err)
}
ip = ip.Mask(ipnet.Mask)
for j := len(ip) - 1; j >= 0; j-- {
ip[j]++
if ip[j] > 0 {
break
}
}
return ip, nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/litian33/rke.git
git@gitee.com:litian33/rke.git
litian33
rke
rke
v0.0.4-dev

搜索帮助