Allow ServiceCIDR to be configured via 'service-cluster-ip-range' flag.

pull/3463/head
Chris Eason 2018-12-16 13:12:08 -05:00
parent 5d910e8937
commit c7e69fd257
2 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,7 @@ const (
featureGates = "feature-gates"
apiServerName = "apiserver-name"
dnsDomain = "dns-domain"
serviceCIDR = "service-cluster-ip-range"
mountString = "mount-string"
disableDriverMounts = "disable-driver-mounts"
cacheImages = "cache-images"
@ -234,7 +235,7 @@ func runStart(cmd *cobra.Command, args []string) {
ContainerRuntime: viper.GetString(containerRuntime),
CRISocket: viper.GetString(criSocket),
NetworkPlugin: viper.GetString(networkPlugin),
ServiceCIDR: pkgutil.DefaultServiceCIDR,
ServiceCIDR: viper.GetString(serviceCIDR),
ExtraOptions: extraOptions,
ShouldLoadCachedImages: shouldCacheImages,
}
@ -473,6 +474,7 @@ func init() {
startCmd.Flags().StringArrayVar(&apiServerNames, "apiserver-names", nil, "A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine")
startCmd.Flags().IPSliceVar(&apiServerIPs, "apiserver-ips", nil, "A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine")
startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the kubernetes cluster")
startCmd.Flags().String(serviceCIDR, pkgutil.DefaultServiceCIDR, "The CIDR to be used for service cluster IPs.")
startCmd.Flags().StringSliceVar(&insecureRegistry, "insecure-registry", nil, "Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.")
startCmd.Flags().StringSliceVar(&registryMirror, "registry-mirror", nil, "Registry mirrors to pass to the Docker daemon")
startCmd.Flags().String(containerRuntime, "", "The container runtime to be used")

View File

@ -438,6 +438,10 @@ func generateConfig(k8s config.KubernetesConfig) (string, error) {
NoTaintMaster: false, // That does not work with k8s 1.12+
}
if k8s.ServiceCIDR != "" {
opts.ServiceCIDR = k8s.ServiceCIDR
}
if version.GTE(semver.MustParse("1.10.0-alpha.0")) {
opts.NoTaintMaster = true
}