mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Clean up API
Move SystemReserved and KubeReserved into KubeletConfiguration struct Convert int64 to int32 for some external type fields so they match internal ones tLS* to tls* for JSON field names Fix dependency on removed options.AutoDetectCloudProvider Change floats in KubeletConfiguration API to ints
This commit is contained in:
parent
9393bd0fa6
commit
e52718bbc6
@ -44,8 +44,6 @@ type KubeletServer struct {
|
|||||||
ChaosChance float64
|
ChaosChance float64
|
||||||
// Crash immediately, rather than eating panics.
|
// Crash immediately, rather than eating panics.
|
||||||
ReallyCrashForTesting bool
|
ReallyCrashForTesting bool
|
||||||
SystemReserved utilconfig.ConfigurationMap
|
|
||||||
KubeReserved utilconfig.ConfigurationMap
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKubeletServer will create a new KubeletServer with default values.
|
// NewKubeletServer will create a new KubeletServer with default values.
|
||||||
@ -55,8 +53,6 @@ func NewKubeletServer() *KubeletServer {
|
|||||||
return &KubeletServer{
|
return &KubeletServer{
|
||||||
AuthPath: util.NewStringFlag("/var/lib/kubelet/kubernetes_auth"), // deprecated
|
AuthPath: util.NewStringFlag("/var/lib/kubelet/kubernetes_auth"), // deprecated
|
||||||
KubeConfig: util.NewStringFlag("/var/lib/kubelet/kubeconfig"),
|
KubeConfig: util.NewStringFlag("/var/lib/kubelet/kubeconfig"),
|
||||||
SystemReserved: make(utilconfig.ConfigurationMap),
|
|
||||||
KubeReserved: make(utilconfig.ConfigurationMap),
|
|
||||||
KubeletConfiguration: config,
|
KubeletConfiguration: config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,8 +67,8 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.StringVar(&s.ManifestURLHeader, "manifest-url-header", s.ManifestURLHeader, "HTTP header to use when accessing the manifest URL, with the key separated from the value with a ':', as in 'key:value'")
|
fs.StringVar(&s.ManifestURLHeader, "manifest-url-header", s.ManifestURLHeader, "HTTP header to use when accessing the manifest URL, with the key separated from the value with a ':', as in 'key:value'")
|
||||||
fs.BoolVar(&s.EnableServer, "enable-server", s.EnableServer, "Enable the Kubelet's server")
|
fs.BoolVar(&s.EnableServer, "enable-server", s.EnableServer, "Enable the Kubelet's server")
|
||||||
fs.Var(componentconfig.IPVar{Val: &s.Address}, "address", "The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces)")
|
fs.Var(componentconfig.IPVar{Val: &s.Address}, "address", "The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces)")
|
||||||
fs.IntVar(&s.Port, "port", s.Port, "The port for the Kubelet to serve on.")
|
fs.Int32Var(&s.Port, "port", s.Port, "The port for the Kubelet to serve on.")
|
||||||
fs.IntVar(&s.ReadOnlyPort, "read-only-port", s.ReadOnlyPort, "The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable)")
|
fs.Int32Var(&s.ReadOnlyPort, "read-only-port", s.ReadOnlyPort, "The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable)")
|
||||||
fs.StringVar(&s.TLSCertFile, "tls-cert-file", s.TLSCertFile, ""+
|
fs.StringVar(&s.TLSCertFile, "tls-cert-file", s.TLSCertFile, ""+
|
||||||
"File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). "+
|
"File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). "+
|
||||||
"If --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key "+
|
"If --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key "+
|
||||||
@ -89,9 +85,9 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.StringSliceVar(&s.HostNetworkSources, "host-network-sources", s.HostNetworkSources, "Comma-separated list of sources from which the Kubelet allows pods to use of host network. [default=\"*\"]")
|
fs.StringSliceVar(&s.HostNetworkSources, "host-network-sources", s.HostNetworkSources, "Comma-separated list of sources from which the Kubelet allows pods to use of host network. [default=\"*\"]")
|
||||||
fs.StringSliceVar(&s.HostPIDSources, "host-pid-sources", s.HostPIDSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace. [default=\"*\"]")
|
fs.StringSliceVar(&s.HostPIDSources, "host-pid-sources", s.HostPIDSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace. [default=\"*\"]")
|
||||||
fs.StringSliceVar(&s.HostIPCSources, "host-ipc-sources", s.HostIPCSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace. [default=\"*\"]")
|
fs.StringSliceVar(&s.HostIPCSources, "host-ipc-sources", s.HostIPCSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace. [default=\"*\"]")
|
||||||
fs.Float64Var(&s.RegistryPullQPS, "registry-qps", s.RegistryPullQPS, "If > 0, limit registry pull QPS to this value. If 0, unlimited. [default=5.0]")
|
fs.Int32Var(&s.RegistryPullQPS, "registry-qps", s.RegistryPullQPS, "If > 0, limit registry pull QPS to this value. If 0, unlimited. [default=5.0]")
|
||||||
fs.Int32Var(&s.RegistryBurst, "registry-burst", s.RegistryBurst, "Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0")
|
fs.Int32Var(&s.RegistryBurst, "registry-burst", s.RegistryBurst, "Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0")
|
||||||
fs.Float32Var(&s.EventRecordQPS, "event-qps", s.EventRecordQPS, "If > 0, limit event creations per second to this value. If 0, unlimited.")
|
fs.Int32Var(&s.EventRecordQPS, "event-qps", s.EventRecordQPS, "If > 0, limit event creations per second to this value. If 0, unlimited.")
|
||||||
fs.Int32Var(&s.EventBurst, "event-burst", s.EventBurst, "Maximum size of a bursty event records, temporarily allows event records to burst to this number, while still not exceeding event-qps. Only used if --event-qps > 0")
|
fs.Int32Var(&s.EventBurst, "event-burst", s.EventBurst, "Maximum size of a bursty event records, temporarily allows event records to burst to this number, while still not exceeding event-qps. Only used if --event-qps > 0")
|
||||||
fs.BoolVar(&s.RunOnce, "runonce", s.RunOnce, "If true, exit after spawning pods from local manifests or remote urls. Exclusive with --api-servers, and --enable-server")
|
fs.BoolVar(&s.RunOnce, "runonce", s.RunOnce, "If true, exit after spawning pods from local manifests or remote urls. Exclusive with --api-servers, and --enable-server")
|
||||||
fs.BoolVar(&s.EnableDebuggingHandlers, "enable-debugging-handlers", s.EnableDebuggingHandlers, "Enables server endpoints for log collection and local running of containers and commands")
|
fs.BoolVar(&s.EnableDebuggingHandlers, "enable-debugging-handlers", s.EnableDebuggingHandlers, "Enables server endpoints for log collection and local running of containers and commands")
|
||||||
@ -104,7 +100,7 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.Var(&s.AuthPath, "auth-path", "Path to .kubernetes_auth file, specifying how to authenticate to API server.")
|
fs.Var(&s.AuthPath, "auth-path", "Path to .kubernetes_auth file, specifying how to authenticate to API server.")
|
||||||
fs.MarkDeprecated("auth-path", "will be removed in a future version")
|
fs.MarkDeprecated("auth-path", "will be removed in a future version")
|
||||||
fs.Var(&s.KubeConfig, "kubeconfig", "Path to a kubeconfig file, specifying how to authenticate to API server (the master location is set by the api-servers flag).")
|
fs.Var(&s.KubeConfig, "kubeconfig", "Path to a kubeconfig file, specifying how to authenticate to API server (the master location is set by the api-servers flag).")
|
||||||
fs.IntVar(&s.CAdvisorPort, "cadvisor-port", s.CAdvisorPort, "The port of the localhost cAdvisor endpoint")
|
fs.Int32Var(&s.CAdvisorPort, "cadvisor-port", s.CAdvisorPort, "The port of the localhost cAdvisor endpoint")
|
||||||
fs.Int32Var(&s.HealthzPort, "healthz-port", s.HealthzPort, "The port of the localhost healthz endpoint")
|
fs.Int32Var(&s.HealthzPort, "healthz-port", s.HealthzPort, "The port of the localhost healthz endpoint")
|
||||||
fs.Var(componentconfig.IPVar{Val: &s.HealthzBindAddress}, "healthz-bind-address", "The IP address for the healthz server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)")
|
fs.Var(componentconfig.IPVar{Val: &s.HealthzBindAddress}, "healthz-bind-address", "The IP address for the healthz server to serve on, defaulting to 127.0.0.1 (set to 0.0.0.0 for all interfaces)")
|
||||||
fs.Int32Var(&s.OOMScoreAdj, "oom-score-adj", s.OOMScoreAdj, "The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000]")
|
fs.Int32Var(&s.OOMScoreAdj, "oom-score-adj", s.OOMScoreAdj, "The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000]")
|
||||||
@ -169,7 +165,7 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.Var(&s.KubeReserved, "kube-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs that describe resources reserved for kubernetes system components. Currently only cpu and memory are supported. See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail. [default=none]")
|
fs.Var(&s.KubeReserved, "kube-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs that describe resources reserved for kubernetes system components. Currently only cpu and memory are supported. See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail. [default=none]")
|
||||||
fs.BoolVar(&s.RegisterSchedulable, "register-schedulable", s.RegisterSchedulable, "Register the node as schedulable. No-op if register-node is false. [default=true]")
|
fs.BoolVar(&s.RegisterSchedulable, "register-schedulable", s.RegisterSchedulable, "Register the node as schedulable. No-op if register-node is false. [default=true]")
|
||||||
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "Content type of requests sent to apiserver.")
|
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "Content type of requests sent to apiserver.")
|
||||||
fs.Float32Var(&s.KubeAPIQPS, "kube-api-qps", s.KubeAPIQPS, "QPS to use while talking with kubernetes apiserver")
|
fs.Int32Var(&s.KubeAPIQPS, "kube-api-qps", s.KubeAPIQPS, "QPS to use while talking with kubernetes apiserver")
|
||||||
fs.Int32Var(&s.KubeAPIBurst, "kube-api-burst", s.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
|
fs.Int32Var(&s.KubeAPIBurst, "kube-api-burst", s.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
|
||||||
fs.BoolVar(&s.SerializeImagePulls, "serialize-image-pulls", s.SerializeImagePulls, "Pull images one at a time. We recommend *not* changing the default value on nodes that run docker daemon with version < 1.9 or an Aufs storage backend. Issue #10959 has more details. [default=true]")
|
fs.BoolVar(&s.SerializeImagePulls, "serialize-image-pulls", s.SerializeImagePulls, "Pull images one at a time. We recommend *not* changing the default value on nodes that run docker daemon with version < 1.9 or an Aufs storage backend. Issue #10959 has more details. [default=true]")
|
||||||
fs.BoolVar(&s.ExperimentalFlannelOverlay, "experimental-flannel-overlay", s.ExperimentalFlannelOverlay, "Experimental support for starting the kubelet with the default overlay network (flannel). Assumes flanneld is already running in client mode. [default=false]")
|
fs.BoolVar(&s.ExperimentalFlannelOverlay, "experimental-flannel-overlay", s.ExperimentalFlannelOverlay, "Experimental support for starting the kubelet with the default overlay network (flannel). Assumes flanneld is already running in client mode. [default=false]")
|
||||||
|
@ -39,6 +39,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/resource"
|
"k8s.io/kubernetes/pkg/api/resource"
|
||||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||||
|
kubeExternal "k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1"
|
||||||
"k8s.io/kubernetes/pkg/capabilities"
|
"k8s.io/kubernetes/pkg/capabilities"
|
||||||
"k8s.io/kubernetes/pkg/client/chaosclient"
|
"k8s.io/kubernetes/pkg/client/chaosclient"
|
||||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||||
@ -221,7 +222,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) {
|
|||||||
EnableDebuggingHandlers: s.EnableDebuggingHandlers,
|
EnableDebuggingHandlers: s.EnableDebuggingHandlers,
|
||||||
EnableServer: s.EnableServer,
|
EnableServer: s.EnableServer,
|
||||||
EventBurst: int(s.EventBurst),
|
EventBurst: int(s.EventBurst),
|
||||||
EventRecordQPS: s.EventRecordQPS,
|
EventRecordQPS: float32(s.EventRecordQPS),
|
||||||
FileCheckFrequency: s.FileCheckFrequency.Duration,
|
FileCheckFrequency: s.FileCheckFrequency.Duration,
|
||||||
HostnameOverride: s.HostnameOverride,
|
HostnameOverride: s.HostnameOverride,
|
||||||
HostNetworkSources: hostNetworkSources,
|
HostNetworkSources: hostNetworkSources,
|
||||||
@ -255,7 +256,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) {
|
|||||||
RegisterNode: s.RegisterNode,
|
RegisterNode: s.RegisterNode,
|
||||||
RegisterSchedulable: s.RegisterSchedulable,
|
RegisterSchedulable: s.RegisterSchedulable,
|
||||||
RegistryBurst: int(s.RegistryBurst),
|
RegistryBurst: int(s.RegistryBurst),
|
||||||
RegistryPullQPS: s.RegistryPullQPS,
|
RegistryPullQPS: float64(s.RegistryPullQPS),
|
||||||
ResolverConfig: s.ResolverConfig,
|
ResolverConfig: s.ResolverConfig,
|
||||||
Reservation: *reservation,
|
Reservation: *reservation,
|
||||||
KubeletCgroups: s.KubeletCgroups,
|
KubeletCgroups: s.KubeletCgroups,
|
||||||
@ -331,7 +332,7 @@ func run(s *options.KubeletServer, kcfg *KubeletConfig) (err error) {
|
|||||||
|
|
||||||
// make a separate client for events
|
// make a separate client for events
|
||||||
eventClientConfig := *clientConfig
|
eventClientConfig := *clientConfig
|
||||||
eventClientConfig.QPS = s.EventRecordQPS
|
eventClientConfig.QPS = float32(s.EventRecordQPS)
|
||||||
eventClientConfig.Burst = int(s.EventBurst)
|
eventClientConfig.Burst = int(s.EventBurst)
|
||||||
kcfg.EventClient, err = clientset.NewForConfig(&eventClientConfig)
|
kcfg.EventClient, err = clientset.NewForConfig(&eventClientConfig)
|
||||||
}
|
}
|
||||||
@ -339,7 +340,7 @@ func run(s *options.KubeletServer, kcfg *KubeletConfig) (err error) {
|
|||||||
glog.Warningf("No API client: %v", err)
|
glog.Warningf("No API client: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.CloudProvider == options.AutoDetectCloudProvider {
|
if s.CloudProvider == kubeExternal.AutoDetectCloudProvider {
|
||||||
kcfg.AutoDetectCloudProvider = true
|
kcfg.AutoDetectCloudProvider = true
|
||||||
} else {
|
} else {
|
||||||
cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile)
|
cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile)
|
||||||
@ -506,7 +507,7 @@ func CreateAPIServerClientConfig(s *options.KubeletServer) (*restclient.Config,
|
|||||||
|
|
||||||
clientConfig.ContentType = s.ContentType
|
clientConfig.ContentType = s.ContentType
|
||||||
// Override kubeconfig qps/burst settings from flags
|
// Override kubeconfig qps/burst settings from flags
|
||||||
clientConfig.QPS = s.KubeAPIQPS
|
clientConfig.QPS = float32(s.KubeAPIQPS)
|
||||||
clientConfig.Burst = int(s.KubeAPIBurst)
|
clientConfig.Burst = int(s.KubeAPIBurst)
|
||||||
|
|
||||||
addChaosToClientConfig(s, clientConfig)
|
addChaosToClientConfig(s, clientConfig)
|
||||||
|
@ -190,7 +190,7 @@ func (s *KubeletExecutorServer) runKubelet(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make a separate client for events
|
// make a separate client for events
|
||||||
eventClientConfig.QPS = s.EventRecordQPS
|
eventClientConfig.QPS = float32(s.EventRecordQPS)
|
||||||
eventClientConfig.Burst = int(s.EventBurst)
|
eventClientConfig.Burst = int(s.EventBurst)
|
||||||
kcfg.EventClient, err = clientset.NewForConfig(eventClientConfig)
|
kcfg.EventClient, err = clientset.NewForConfig(eventClientConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,10 @@ limitations under the License.
|
|||||||
|
|
||||||
package componentconfig
|
package componentconfig
|
||||||
|
|
||||||
import "k8s.io/kubernetes/pkg/api/unversioned"
|
import (
|
||||||
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
|
utilconfig "k8s.io/kubernetes/pkg/util/config"
|
||||||
|
)
|
||||||
|
|
||||||
type KubeProxyConfiguration struct {
|
type KubeProxyConfiguration struct {
|
||||||
unversioned.TypeMeta
|
unversioned.TypeMeta
|
||||||
@ -125,19 +128,19 @@ type KubeletConfiguration struct {
|
|||||||
// for all interfaces)
|
// for all interfaces)
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
// port is the port for the Kubelet to serve on.
|
// port is the port for the Kubelet to serve on.
|
||||||
Port int `json:"port"`
|
Port int32 `json:"port"`
|
||||||
// readOnlyPort is the read-only port for the Kubelet to serve on with
|
// readOnlyPort is the read-only port for the Kubelet to serve on with
|
||||||
// no authentication/authorization (set to 0 to disable)
|
// no authentication/authorization (set to 0 to disable)
|
||||||
ReadOnlyPort int `json:"readOnlyPort"`
|
ReadOnlyPort int32 `json:"readOnlyPort"`
|
||||||
// tLSCertFile is the file containing x509 Certificate for HTTPS. (CA cert,
|
// tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert,
|
||||||
// if any, concatenated after server cert). If tlsCertFile and
|
// if any, concatenated after server cert). If tlsCertFile and
|
||||||
// tlsPrivateKeyFile are not provided, a self-signed certificate
|
// tlsPrivateKeyFile are not provided, a self-signed certificate
|
||||||
// and key are generated for the public address and saved to the directory
|
// and key are generated for the public address and saved to the directory
|
||||||
// passed to certDir.
|
// passed to certDir.
|
||||||
TLSCertFile string `json:"tLSCertFile"`
|
TLSCertFile string `json:"tlsCertFile"`
|
||||||
// tLSPrivateKeyFile is the ile containing x509 private key matching
|
// tlsPrivateKeyFile is the ile containing x509 private key matching
|
||||||
// tlsCertFile.
|
// tlsCertFile.
|
||||||
TLSPrivateKeyFile string `json:"tLSPrivateKeyFile"`
|
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile"`
|
||||||
// certDirectory is the directory where the TLS certs are located (by
|
// certDirectory is the directory where the TLS certs are located (by
|
||||||
// default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile
|
// default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile
|
||||||
// are provided, this flag will be ignored.
|
// are provided, this flag will be ignored.
|
||||||
@ -170,14 +173,14 @@ type KubeletConfiguration struct {
|
|||||||
HostIPCSources []string `json:"hostIPCSources"`
|
HostIPCSources []string `json:"hostIPCSources"`
|
||||||
// registryPullQPS is the limit of registry pulls per second. If 0,
|
// registryPullQPS is the limit of registry pulls per second. If 0,
|
||||||
// unlimited. Set to 0 for no limit. Defaults to 5.0.
|
// unlimited. Set to 0 for no limit. Defaults to 5.0.
|
||||||
RegistryPullQPS float64 `json:"registryPullQPS"`
|
RegistryPullQPS int32 `json:"registryPullQPS"`
|
||||||
// registryBurst is the maximum size of a bursty pulls, temporarily allows
|
// registryBurst is the maximum size of a bursty pulls, temporarily allows
|
||||||
// pulls to burst to this number, while still not exceeding registryQps.
|
// pulls to burst to this number, while still not exceeding registryQps.
|
||||||
// Only used if registryQps > 0.
|
// Only used if registryQPS > 0.
|
||||||
RegistryBurst int32 `json:"registryBurst"`
|
RegistryBurst int32 `json:"registryBurst"`
|
||||||
// eventRecordQPS is the maximum event creations per second. If 0, there
|
// eventRecordQPS is the maximum event creations per second. If 0, there
|
||||||
// is no limit enforced.
|
// is no limit enforced.
|
||||||
EventRecordQPS float32 `json:"eventRecordQPS"`
|
EventRecordQPS int32 `json:"eventRecordQPS"`
|
||||||
// eventBurst is the maximum size of a bursty event records, temporarily
|
// eventBurst is the maximum size of a bursty event records, temporarily
|
||||||
// allows event records to burst to this number, while still not exceeding
|
// allows event records to burst to this number, while still not exceeding
|
||||||
// event-qps. Only used if eventQps > 0
|
// event-qps. Only used if eventQps > 0
|
||||||
@ -195,7 +198,7 @@ type KubeletConfiguration struct {
|
|||||||
// to retain globally. Each container takes up some disk space.
|
// to retain globally. Each container takes up some disk space.
|
||||||
MaxContainerCount int32 `json:"maxContainerCount"`
|
MaxContainerCount int32 `json:"maxContainerCount"`
|
||||||
// cAdvisorPort is the port of the localhost cAdvisor endpoint
|
// cAdvisorPort is the port of the localhost cAdvisor endpoint
|
||||||
CAdvisorPort int `json:"cAdvisorPort"`
|
CAdvisorPort int32 `json:"cAdvisorPort"`
|
||||||
// healthzPort is the port of the localhost healthz endpoint
|
// healthzPort is the port of the localhost healthz endpoint
|
||||||
HealthzPort int32 `json:"healthzPort"`
|
HealthzPort int32 `json:"healthzPort"`
|
||||||
// healthzBindAddress is the IP address for the healthz server to serve
|
// healthzBindAddress is the IP address for the healthz server to serve
|
||||||
@ -331,7 +334,7 @@ type KubeletConfiguration struct {
|
|||||||
// contentType is contentType of requests sent to apiserver.
|
// contentType is contentType of requests sent to apiserver.
|
||||||
ContentType string `json:"contentType"`
|
ContentType string `json:"contentType"`
|
||||||
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver
|
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver
|
||||||
KubeAPIQPS float32 `json:"kubeAPIQPS"`
|
KubeAPIQPS int32 `json:"kubeAPIQPS"`
|
||||||
// kubeAPIBurst is the burst to allow while talking with kubernetes
|
// kubeAPIBurst is the burst to allow while talking with kubernetes
|
||||||
// apiserver
|
// apiserver
|
||||||
KubeAPIBurst int32 `json:"kubeAPIBurst"`
|
KubeAPIBurst int32 `json:"kubeAPIBurst"`
|
||||||
@ -372,6 +375,16 @@ type KubeletConfiguration struct {
|
|||||||
// manage attachment/detachment of volumes scheduled to this node, and
|
// manage attachment/detachment of volumes scheduled to this node, and
|
||||||
// disables kubelet from executing any attach/detach operations
|
// disables kubelet from executing any attach/detach operations
|
||||||
EnableControllerAttachDetach bool `json:"enableControllerAttachDetach"`
|
EnableControllerAttachDetach bool `json:"enableControllerAttachDetach"`
|
||||||
|
// A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs
|
||||||
|
// that describe resources reserved for non-kubernetes components.
|
||||||
|
// Currently only cpu and memory are supported. [default=none]
|
||||||
|
// See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail.
|
||||||
|
SystemReserved utilconfig.ConfigurationMap `json:"systemReserved"`
|
||||||
|
// A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs
|
||||||
|
// that describe resources reserved for kubernetes system components.
|
||||||
|
// Currently only cpu and memory are supported. [default=none]
|
||||||
|
// See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail.
|
||||||
|
KubeReserved utilconfig.ConfigurationMap `json:"kubeReserved"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KubeSchedulerConfiguration struct {
|
type KubeSchedulerConfiguration struct {
|
||||||
|
@ -41,6 +41,8 @@ const (
|
|||||||
|
|
||||||
// From pkg/kubelet/rkt/rkt.go to avoid circular import
|
// From pkg/kubelet/rkt/rkt.go to avoid circular import
|
||||||
defaultRktAPIServiceEndpoint = "localhost:15441"
|
defaultRktAPIServiceEndpoint = "localhost:15441"
|
||||||
|
|
||||||
|
AutoDetectCloudProvider = "auto-detect"
|
||||||
)
|
)
|
||||||
|
|
||||||
var zeroDuration = unversioned.Duration{}
|
var zeroDuration = unversioned.Duration{}
|
||||||
@ -138,7 +140,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
obj.Address = "0.0.0.0"
|
obj.Address = "0.0.0.0"
|
||||||
}
|
}
|
||||||
if obj.CloudProvider == "" {
|
if obj.CloudProvider == "" {
|
||||||
obj.CloudProvider = "auto-detect"
|
obj.CloudProvider = AutoDetectCloudProvider
|
||||||
}
|
}
|
||||||
if obj.CAdvisorPort == 0 {
|
if obj.CAdvisorPort == 0 {
|
||||||
obj.CAdvisorPort = 4194
|
obj.CAdvisorPort = 4194
|
||||||
@ -170,8 +172,9 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
if obj.EventBurst == 0 {
|
if obj.EventBurst == 0 {
|
||||||
obj.EventBurst = 10
|
obj.EventBurst = 10
|
||||||
}
|
}
|
||||||
if obj.EventRecordQPS == 0 {
|
if obj.EventRecordQPS == nil {
|
||||||
obj.EventRecordQPS = 5.0
|
temp := int32(5)
|
||||||
|
obj.EventRecordQPS = &temp
|
||||||
}
|
}
|
||||||
if obj.EnableControllerAttachDetach == nil {
|
if obj.EnableControllerAttachDetach == nil {
|
||||||
obj.EnableControllerAttachDetach = boolVar(true)
|
obj.EnableControllerAttachDetach = boolVar(true)
|
||||||
@ -271,7 +274,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
obj.RegistryBurst = 10
|
obj.RegistryBurst = 10
|
||||||
}
|
}
|
||||||
if obj.RegistryPullQPS == nil {
|
if obj.RegistryPullQPS == nil {
|
||||||
temp := float64(5)
|
temp := int32(5)
|
||||||
obj.RegistryPullQPS = &temp
|
obj.RegistryPullQPS = &temp
|
||||||
}
|
}
|
||||||
if obj.ResolverConfig == "" {
|
if obj.ResolverConfig == "" {
|
||||||
@ -301,8 +304,9 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
if obj.ContentType == "" {
|
if obj.ContentType == "" {
|
||||||
obj.ContentType = "application/vnd.kubernetes.protobuf"
|
obj.ContentType = "application/vnd.kubernetes.protobuf"
|
||||||
}
|
}
|
||||||
if obj.KubeAPIQPS == 0 {
|
if obj.KubeAPIQPS == nil {
|
||||||
obj.KubeAPIQPS = 5
|
temp := int32(5)
|
||||||
|
obj.KubeAPIQPS = &temp
|
||||||
}
|
}
|
||||||
if obj.KubeAPIBurst == 0 {
|
if obj.KubeAPIBurst == 0 {
|
||||||
obj.KubeAPIBurst = 10
|
obj.KubeAPIBurst = 10
|
||||||
@ -314,11 +318,18 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
obj.HairpinMode = PromiscuousBridge
|
obj.HairpinMode = PromiscuousBridge
|
||||||
}
|
}
|
||||||
if obj.EvictionHard == nil {
|
if obj.EvictionHard == nil {
|
||||||
obj.EvictionHard = &"memory.available<100Mi"
|
temp := "memory.available<100Mi"
|
||||||
|
obj.EvictionHard = &temp
|
||||||
}
|
}
|
||||||
if obj.EvictionPressureTransitionPeriod == zeroDuration {
|
if obj.EvictionPressureTransitionPeriod == zeroDuration {
|
||||||
obj.EvictionPressureTransitionPeriod = unversioned.Duration{Duration: 5 * time.Minute}
|
obj.EvictionPressureTransitionPeriod = unversioned.Duration{Duration: 5 * time.Minute}
|
||||||
}
|
}
|
||||||
|
if obj.SystemReserved == nil {
|
||||||
|
obj.SystemReserved = make(map[string]string)
|
||||||
|
}
|
||||||
|
if obj.KubeReserved == nil {
|
||||||
|
obj.KubeReserved = make(map[string]string)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func boolVar(b bool) *bool {
|
func boolVar(b bool) *bool {
|
||||||
|
@ -186,15 +186,15 @@ type KubeletConfiguration struct {
|
|||||||
// readOnlyPort is the read-only port for the Kubelet to serve on with
|
// readOnlyPort is the read-only port for the Kubelet to serve on with
|
||||||
// no authentication/authorization (set to 0 to disable)
|
// no authentication/authorization (set to 0 to disable)
|
||||||
ReadOnlyPort int32 `json:"readOnlyPort"`
|
ReadOnlyPort int32 `json:"readOnlyPort"`
|
||||||
// tLSCertFile is the file containing x509 Certificate for HTTPS. (CA cert,
|
// tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert,
|
||||||
// if any, concatenated after server cert). If tlsCertFile and
|
// if any, concatenated after server cert). If tlsCertFile and
|
||||||
// tlsPrivateKeyFile are not provided, a self-signed certificate
|
// tlsPrivateKeyFile are not provided, a self-signed certificate
|
||||||
// and key are generated for the public address and saved to the directory
|
// and key are generated for the public address and saved to the directory
|
||||||
// passed to certDir.
|
// passed to certDir.
|
||||||
TLSCertFile string `json:"tLSCertFile"`
|
TLSCertFile string `json:"tlsCertFile"`
|
||||||
// tLSPrivateKeyFile is the ile containing x509 private key matching
|
// tlsPrivateKeyFile is the ile containing x509 private key matching
|
||||||
// tlsCertFile.
|
// tlsCertFile.
|
||||||
TLSPrivateKeyFile string `json:"tLSPrivateKeyFile"`
|
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile"`
|
||||||
// certDirectory is the directory where the TLS certs are located (by
|
// certDirectory is the directory where the TLS certs are located (by
|
||||||
// default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile
|
// default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile
|
||||||
// are provided, this flag will be ignored.
|
// are provided, this flag will be ignored.
|
||||||
@ -227,18 +227,18 @@ type KubeletConfiguration struct {
|
|||||||
HostIPCSources []string `json:"hostIPCSources"`
|
HostIPCSources []string `json:"hostIPCSources"`
|
||||||
// registryPullQPS is the limit of registry pulls per second. If 0,
|
// registryPullQPS is the limit of registry pulls per second. If 0,
|
||||||
// unlimited. Set to 0 for no limit. Defaults to 5.0.
|
// unlimited. Set to 0 for no limit. Defaults to 5.0.
|
||||||
RegistryPullQPS *float64 `json:"registryPullQPS"`
|
RegistryPullQPS *int32 `json:"registryPullQPS"`
|
||||||
// registryBurst is the maximum size of a bursty pulls, temporarily allows
|
// registryBurst is the maximum size of a bursty pulls, temporarily allows
|
||||||
// pulls to burst to this number, while still not exceeding registryQps.
|
// pulls to burst to this number, while still not exceeding registryQps.
|
||||||
// Only used if registryQps > 0.
|
// Only used if registryQPS > 0.
|
||||||
RegistryBurst int64 `json:"registryBurst"`
|
RegistryBurst int32 `json:"registryBurst"`
|
||||||
// eventRecordQPS is the maximum event creations per second. If 0, there
|
// eventRecordQPS is the maximum event creations per second. If 0, there
|
||||||
// is no limit enforced.
|
// is no limit enforced.
|
||||||
EventRecordQPS float32 `json:"eventRecordQPS"`
|
EventRecordQPS *int32 `json:"eventRecordQPS"`
|
||||||
// eventBurst is the maximum size of a bursty event records, temporarily
|
// eventBurst is the maximum size of a bursty event records, temporarily
|
||||||
// allows event records to burst to this number, while still not exceeding
|
// allows event records to burst to this number, while still not exceeding
|
||||||
// event-qps. Only used if eventQps > 0
|
// event-qps. Only used if eventQps > 0
|
||||||
EventBurst int64 `json:"eventBurst"`
|
EventBurst int32 `json:"eventBurst"`
|
||||||
// enableDebuggingHandlers enables server endpoints for log collection
|
// enableDebuggingHandlers enables server endpoints for log collection
|
||||||
// and local running of containers and commands
|
// and local running of containers and commands
|
||||||
EnableDebuggingHandlers *bool `json:"enableDebuggingHandlers"`
|
EnableDebuggingHandlers *bool `json:"enableDebuggingHandlers"`
|
||||||
@ -247,7 +247,7 @@ type KubeletConfiguration struct {
|
|||||||
MinimumGCAge unversioned.Duration `json:"minimumGCAge"`
|
MinimumGCAge unversioned.Duration `json:"minimumGCAge"`
|
||||||
// maxPerPodContainerCount is the maximum number of old instances to
|
// maxPerPodContainerCount is the maximum number of old instances to
|
||||||
// retain per container. Each container takes up some disk space.
|
// retain per container. Each container takes up some disk space.
|
||||||
MaxPerPodContainerCount int64 `json:"maxPerPodContainerCount"`
|
MaxPerPodContainerCount int32 `json:"maxPerPodContainerCount"`
|
||||||
// maxContainerCount is the maximum number of old instances of containers
|
// maxContainerCount is the maximum number of old instances of containers
|
||||||
// to retain globally. Each container takes up some disk space.
|
// to retain globally. Each container takes up some disk space.
|
||||||
MaxContainerCount *int32 `json:"maxContainerCount"`
|
MaxContainerCount *int32 `json:"maxContainerCount"`
|
||||||
@ -295,7 +295,7 @@ type KubeletConfiguration struct {
|
|||||||
// lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to
|
// lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to
|
||||||
// maintain. When disk space falls below this threshold, new pods would
|
// maintain. When disk space falls below this threshold, new pods would
|
||||||
// be rejected.
|
// be rejected.
|
||||||
LowDiskSpaceThresholdMB int64 `json:"lowDiskSpaceThresholdMB"`
|
LowDiskSpaceThresholdMB int32 `json:"lowDiskSpaceThresholdMB"`
|
||||||
// How frequently to calculate and cache volume disk usage for all pods
|
// How frequently to calculate and cache volume disk usage for all pods
|
||||||
VolumeStatsAggPeriod unversioned.Duration `json:"volumeStatsAggPeriod"`
|
VolumeStatsAggPeriod unversioned.Duration `json:"volumeStatsAggPeriod"`
|
||||||
// networkPluginName is the name of the network plugin to be invoked for
|
// networkPluginName is the name of the network plugin to be invoked for
|
||||||
@ -389,7 +389,7 @@ type KubeletConfiguration struct {
|
|||||||
// contentType is contentType of requests sent to apiserver.
|
// contentType is contentType of requests sent to apiserver.
|
||||||
ContentType string `json:"contentType"`
|
ContentType string `json:"contentType"`
|
||||||
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver
|
// kubeAPIQPS is the QPS to use while talking with kubernetes apiserver
|
||||||
KubeAPIQPS float32 `json:"kubeAPIQPS"`
|
KubeAPIQPS *int32 `json:"kubeAPIQPS"`
|
||||||
// kubeAPIBurst is the burst to allow while talking with kubernetes
|
// kubeAPIBurst is the burst to allow while talking with kubernetes
|
||||||
// apiserver
|
// apiserver
|
||||||
KubeAPIBurst int32 `json:"kubeAPIBurst"`
|
KubeAPIBurst int32 `json:"kubeAPIBurst"`
|
||||||
@ -415,7 +415,7 @@ type KubeletConfiguration struct {
|
|||||||
// enable gathering custom metrics.
|
// enable gathering custom metrics.
|
||||||
EnableCustomMetrics bool `json:"enableCustomMetrics"`
|
EnableCustomMetrics bool `json:"enableCustomMetrics"`
|
||||||
// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'.
|
// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'.
|
||||||
EvictionHard string `json:"evictionHard"`
|
EvictionHard *string `json:"evictionHard"`
|
||||||
// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'.
|
// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'.
|
||||||
EvictionSoft string `json:"evictionSoft"`
|
EvictionSoft string `json:"evictionSoft"`
|
||||||
// Comma-delimeted list of grace periods for each soft eviction signal. For example, 'memory.available=30s'.
|
// Comma-delimeted list of grace periods for each soft eviction signal. For example, 'memory.available=30s'.
|
||||||
@ -430,4 +430,14 @@ type KubeletConfiguration struct {
|
|||||||
// manage attachment/detachment of volumes scheduled to this node, and
|
// manage attachment/detachment of volumes scheduled to this node, and
|
||||||
// disables kubelet from executing any attach/detach operations
|
// disables kubelet from executing any attach/detach operations
|
||||||
EnableControllerAttachDetach *bool `json:"enableControllerAttachDetach"`
|
EnableControllerAttachDetach *bool `json:"enableControllerAttachDetach"`
|
||||||
|
// A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs
|
||||||
|
// that describe resources reserved for non-kubernetes components.
|
||||||
|
// Currently only cpu and memory are supported. [default=none]
|
||||||
|
// See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail.
|
||||||
|
SystemReserved map[string]string `json:"systemReserved"`
|
||||||
|
// A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs
|
||||||
|
// that describe resources reserved for kubernetes system components.
|
||||||
|
// Currently only cpu and memory are supported. [default=none]
|
||||||
|
// See http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md for more detail.
|
||||||
|
KubeReserved map[string]string `json:"kubeReserved"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user