Merge pull request #1321 from aaron-prindle/dns-domain

Added --dns-domain flag to localkube
pull/1327/head
Aaron Prindle 2017-04-03 11:51:19 -07:00 committed by GitHub
commit 343714bb3b
3 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,7 @@ const (
keepContext = "keep-context"
featureGates = "feature-gates"
apiServerName = "apiserver-name"
dnsDomain = "dns-domain"
)
var (
@ -131,6 +132,7 @@ func runStart(cmd *cobra.Command, args []string) {
KubernetesVersion: viper.GetString(kubernetesVersion),
NodeIP: ip,
APIServerName: viper.GetString(apiServerName),
DNSDomain: viper.GetString(dnsDomain),
FeatureGates: viper.GetString(featureGates),
ContainerRuntime: viper.GetString(containerRuntime),
NetworkPlugin: viper.GetString(networkPlugin),
@ -217,6 +219,7 @@ func init() {
startCmd.Flags().StringArrayVar(&dockerEnv, "docker-env", nil, "Environment variables to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().StringArrayVar(&dockerOpt, "docker-opt", nil, "Specify arbitrary flags to pass to the Docker daemon. (format: key=value)")
startCmd.Flags().String(apiServerName, constants.APIServerName, "The apiserver name which is used in the generated certificate for localkube/kubernetes. This can be used if you want to make the apiserver available from outside the machine")
startCmd.Flags().String(dnsDomain, "", "The cluster dns domain name used in the kubernetes cluster")
startCmd.Flags().StringSliceVar(&insecureRegistry, "insecure-registry", nil, "Insecure Docker registries to pass to the Docker daemon")
startCmd.Flags().StringSliceVar(&registryMirror, "registry-mirror", nil, "Registry mirrors to pass to the Docker daemon")
startCmd.Flags().String(kubernetesVersion, constants.DefaultKubernetesVersion, "The kubernetes version that the minikube VM will use (ex: v1.2.3) \n OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64)")

View File

@ -122,6 +122,10 @@ func GenLocalkubeStartCmd(kubernetesConfig KubernetesConfig) (string, error) {
flagVals = append(flagVals, "--apiserver-name="+kubernetesConfig.APIServerName)
}
if kubernetesConfig.DNSDomain != "" {
flagVals = append(flagVals, "--dns-domain="+kubernetesConfig.DNSDomain)
}
for _, e := range kubernetesConfig.ExtraOptions {
flagVals = append(flagVals, fmt.Sprintf("--extra-config=%s", e.String()))
}

View File

@ -40,6 +40,7 @@ type KubernetesConfig struct {
KubernetesVersion string
NodeIP string
APIServerName string
DNSDomain string
ContainerRuntime string
NetworkPlugin string
FeatureGates string