func init() { runtimeConfig = make(util.ConfigurationMap) flag.Var(&address, "address", "The IP address on to serve on (set to 0.0.0.0 for all interfaces)") flag.Var(&etcdServerList, "etcd_servers", "List of etcd servers to watch (http://ip:port), comma separated. Mutually exclusive with -etcd_config") flag.Var(&corsAllowedOriginList, "cors_allowed_origins", "List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled.") flag.Var(&portalNet, "portal_net", "A CIDR notation IP range from which to assign portal IPs. This must not overlap with any IP ranges assigned to nodes for pods.") flag.Var(&runtimeConfig, "runtime_config", "A set of key=value pairs that describe runtime configuration that may be passed to the apiserver.") client.BindKubeletClientConfigFlags(flag.CommandLine, &kubeletConfig) }
// AddFlags adds flags for a specific LocalkubeServer func AddFlags(s *localkube.LocalkubeServer) { flag.BoolVar(&s.Containerized, "containerized", s.Containerized, "If kubelet should run in containerized mode") flag.BoolVar(&s.EnableDNS, "enable-dns", s.EnableDNS, "If dns should be enabled") flag.StringVar(&s.DNSDomain, "dns-domain", s.DNSDomain, "The cluster dns domain") flag.IPVar(&s.DNSIP, "dns-ip", s.DNSIP, "The cluster dns IP") flag.StringVar(&s.LocalkubeDirectory, "localkube-directory", s.LocalkubeDirectory, "The directory localkube will store files in") flag.IPNetVar(&s.ServiceClusterIPRange, "service-cluster-ip-range", s.ServiceClusterIPRange, "The service-cluster-ip-range for the apiserver") flag.IPVar(&s.APIServerAddress, "apiserver-address", s.APIServerAddress, "The address the apiserver will listen securely on") flag.IntVar(&s.APIServerPort, "apiserver-port", s.APIServerPort, "The port the apiserver will listen securely on") flag.IPVar(&s.APIServerInsecureAddress, "apiserver-insecure-address", s.APIServerInsecureAddress, "The address the apiserver will listen insecurely on") flag.IntVar(&s.APIServerInsecurePort, "apiserver-insecure-port", s.APIServerInsecurePort, "The port the apiserver will listen insecurely on") flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates") flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.") flag.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.") flag.IPVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node.") flag.StringVar(&s.ContainerRuntime, "container-runtime", "", "The container runtime to be used") flag.StringVar(&s.NetworkPlugin, "network-plugin", "", "The name of the network plugin") // These two come from vendor/ packages that use flags. We should hide them flag.CommandLine.MarkHidden("google-json-key") flag.CommandLine.MarkHidden("log-flush-frequency") // Parse them flag.Parse() }
func initFlags() { flag.IntVarP(&options.Port, "port", "p", 80, "The port to listen on") flag.StringVarP(&options.StaticDir, "www", "w", ".", "Directory to serve static files from") flag.StringVar(&options.StaticPrefix, "www-prefix", "/", "Prefix to serve static files on") flag.DurationVar(&options.StaticCacheMaxAge, "max-age", 0, "Set the Cache-Control header for static content with the max-age set to this value, e.g. 24h. Must confirm to http://golang.org/pkg/time/#ParseDuration") flag.StringVarP(&options.DefaultPage, "default-page", "d", "", "Default page to send if page not found") flag.VarP(&options.Services, "service", "s", "The Kubernetes services to proxy to in the form \"<prefix>=<serviceUrl>\"") flag.VarP(&options.Configs, "config-file", "c", "The configuration files to create in the form \"<template>=<output>\"") flag.Var(&options.CACerts, "ca-cert", "CA certs used to verify proxied server certificates") flag.StringVar(&options.TlsCertFile, "tls-cert", "", "Certificate file to use to serve using TLS") flag.StringVar(&options.TlsKeyFile, "tls-key", "", "Certificate file to use to serve using TLS") flag.BoolVar(&options.SkipCertValidation, "skip-cert-validation", false, "Skip remote certificate validation - dangerous!") flag.BoolVarP(&options.AccessLogging, "access-logging", "l", false, "Enable access logging") flag.BoolVar(&options.CompressHandler, "compress", false, "Enable gzip/deflate response compression") flag.BoolVar(&options.FailOnUnknownServices, "fail-on-unknown-services", false, "Fail on unknown services in DNS") flag.BoolVar(&options.ServeWww, "serve-www", true, "Whether to serve static content") flag.Parse() }
func VersionVar(p *versionValue, name string, value versionValue, usage string) { *p = value flag.Var(p, name, usage) }
func VersionVar(p *versionValue, name string, value versionValue, usage string) { *p = value flag.Var(p, name, usage) // "--version" will be treated as "--version=true" flag.Lookup(name).NoOptDefVal = "true" }
// QuantityFlag is a helper that makes a quantity flag (using standard flag package). // Will panic if defaultValue is not a valid quantity. func QuantityFlag(flagName, defaultValue, description string) *Quantity { q := MustParse(defaultValue) flag.Var(NewQuantityFlagValue(&q), flagName, description) return &q }
func init() { client.BindClientConfigFlags(flag.CommandLine, clientConfig) flag.Var(&etcdServerList, "etcd_servers", "List of etcd servers to watch (http://ip:port), comma separated (optional). Mutually exclusive with -etcd_config") flag.Var(&bindAddress, "bind_address", "The IP address for the proxy server to serve on (set to 0.0.0.0 for all interfaces)") }
func init() { flag.Var(&address, "address", "The IP address to serve on (set to 0.0.0.0 for all interfaces)") client.BindClientConfigFlags(flag.CommandLine, clientConfig) }
func init() { flag.Var(&address, "address", "The IP address to serve on (set to 0.0.0.0 for all interfaces)") flag.Var(&machineList, "machines", "List of machines to schedule onto, comma separated.") client.BindClientConfigFlags(flag.CommandLine, clientConfig) }
func init() { // Tie the command-line flag to the intervalFlag variable and // set a usage message. flag.Var(&intervalFlag, "deltaT", "comma-separated list of intervals to use between events") }
func init() { flag.Var(&etcdServerList, "etcd_servers", "List of etcd servers to watch (http://ip:port), comma separated. Mutually exclusive with -etcd_config") flag.Var(&address, "address", "The IP address for the info server to serve on (set to 0.0.0.0 for all interfaces)") flag.Var(&apiServerList, "api_servers", "List of Kubernetes API servers for publishing events, and reading pods and services. (ip:port), comma separated.") flag.Var(&clusterDNS, "cluster_dns", "IP address for a cluster DNS server. If set, kubelet will configure all containers to use this for DNS resolution in addition to the host's DNS servers") }