Permalink
Browse files

Merge remote-tracking branch 'origin/master' into release-1.12. Delet…

…ing CHANGELOG-1.11.md
  • Loading branch information...
dougm committed Sep 11, 2018
2 parents f49b273 + 45c5ddd commit 0cafd04160ff4e5c16bb38d0e4ecae805c84d41c
Showing with 2,338 additions and 486 deletions.
  1. +0 −5 api/openapi-spec/swagger.json
  2. +0 −5 api/swagger-spec/autoscaling_v2beta2.json
  3. +17 −9 cmd/kube-controller-manager/app/autoscaling.go
  4. +0 −4 cmd/kubeadm/app/apis/kubeadm/v1alpha3/bootstraptokenstring.go
  5. +77 −1 cmd/kubeadm/app/apis/kubeadm/v1alpha3/doc.go
  6. +1 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha3/types.go
  7. +8 −0 cmd/kubeadm/app/cmd/options/generic.go
  8. +1 −1 cmd/kubeadm/app/cmd/phases/BUILD
  9. +49 −0 cmd/kubeadm/app/cmd/phases/kubelet.go
  10. +60 −10 cmd/kubeadm/app/cmd/phases/preflight.go
  11. +2 −4 cmd/kubeadm/app/cmd/reset.go
  12. +1 −1 cmd/kubeadm/app/cmd/upgrade/upgrade.go
  13. +11 −0 cmd/kubeadm/app/phases/controlplane/manifests.go
  14. +24 −0 cmd/kubeadm/app/phases/controlplane/manifests_test.go
  15. +2 −0 docs/.generated_docs
  16. +3 −0 docs/admin/kubeadm_alpha_phase_kubelet_config_annotate-cri.md
  17. +3 −3 docs/api-reference/autoscaling/v2beta2/definitions.html
  18. +3 −0 docs/man/man1/kubeadm-alpha-phase-kubelet-config-annotate-cri.1
  19. +15 −13 pkg/cloudprovider/README.md
  20. +2 −0 pkg/cloudprovider/plugins.go
  21. +0 −1 pkg/controller/daemon/BUILD
  22. +5 −47 pkg/controller/daemon/daemon_controller.go
  23. +34 −20 pkg/controller/daemon/daemon_controller_test.go
  24. +0 −1 pkg/controller/daemon/util/BUILD
  25. +42 −40 pkg/controller/daemon/util/daemonset_util.go
  26. +1 −1 pkg/controller/daemon/util/daemonset_util_test.go
  27. +30 −37 pkg/controller/nodelifecycle/node_lifecycle_controller.go
  28. +1 −1 pkg/controller/nodelifecycle/node_lifecycle_controller_test.go
  29. +2 −1 pkg/controller/podautoscaler/BUILD
  30. +26 −3 pkg/controller/podautoscaler/horizontal.go
  31. +84 −40 pkg/controller/podautoscaler/horizontal_test.go
  32. +5 −3 pkg/controller/podautoscaler/legacy_horizontal_test.go
  33. +13 −1 pkg/controller/podautoscaler/legacy_replica_calculator_test.go
  34. +18 −18 pkg/controller/podautoscaler/replica_calculator.go
  35. +25 −13 pkg/controller/podautoscaler/replica_calculator_test.go
  36. +0 −12 pkg/features/kube_features.go
  37. +11 −1 pkg/kubelet/preemption/preemption_test.go
  38. +3 −0 pkg/kubelet/status/status_manager.go
  39. +6 −7 pkg/kubelet/types/pod_update.go
  40. +2 −0 pkg/volume/csi/BUILD
  41. +9 −20 pkg/volume/csi/csi_attacher_test.go
  42. +1 −1 pkg/volume/csi/csi_mounter.go
  43. +7 −5 pkg/volume/csi/csi_mounter_test.go
  44. +20 −6 pkg/volume/csi/csi_plugin.go
  45. +6 −4 pkg/volume/csi/csi_plugin_test.go
  46. +6 −0 pkg/volume/csi/csi_util.go
  47. +1 −0 pkg/volume/csi/nodeinfomanager/BUILD
  48. +4 −0 pkg/volume/csi/nodeinfomanager/nodeinfomanager.go
  49. +3 −7 pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go
  50. +1 −1 plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go
  51. +1 −1 plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
  52. +6 −0 staging/src/k8s.io/api/autoscaling/v2beta2/generated.proto
  53. +12 −7 staging/src/k8s.io/api/autoscaling/v2beta2/types.go
  54. +12 −0 staging/src/k8s.io/metrics/Godeps/Godeps.json
  55. +1 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/register.go
  56. +16 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/types.go
  57. +203 −39 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.pb.go
  58. +12 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
  59. +1 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/register.go
  60. +16 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/types.go
  61. +32 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.conversion.go
  62. +25 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/zz_generated.deepcopy.go
  63. +32 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2/zz_generated.conversion.go
  64. +25 −0 staging/src/k8s.io/metrics/pkg/apis/custom_metrics/zz_generated.deepcopy.go
  65. +25 −2 staging/src/k8s.io/metrics/pkg/client/custom_metrics/BUILD
  66. +122 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/converter.go
  67. +145 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/discovery.go
  68. +138 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/multi_client.go
  69. +1 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/BUILD
  70. +6 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/scheme/register.go
  71. +65 −0 staging/src/k8s.io/metrics/pkg/client/custom_metrics/util_test.go
  72. +85 −72 staging/src/k8s.io/metrics/pkg/client/custom_metrics/{client.go → versioned_client.go}
  73. +2 −0 test/e2e/instrumentation/monitoring/BUILD
  74. +8 −2 test/e2e/instrumentation/monitoring/custom_metrics_stackdriver.go
  75. +1 −0 test/e2e/storage/drivers/BUILD
  76. +5 −1 test/e2e/storage/drivers/in_tree.go
  77. +4 −4 test/e2e/storage/regional_pd.go
  78. +3 −0 test/e2e_node/BUILD
  79. +5 −2 test/e2e_node/critical_pod_test.go
  80. +3 −0 test/e2e_node/image_list.go
  81. +108 −0 test/e2e_node/node_perf_test.go
  82. +35 −0 test/e2e_node/perf/workloads/BUILD
  83. +7 −0 test/e2e_node/perf/workloads/OWNERS
  84. +120 −0 test/e2e_node/perf/workloads/npb_ep.go
  85. +92 −0 test/e2e_node/perf/workloads/npb_is.go
  86. +119 −0 test/e2e_node/perf/workloads/tf_wide_deep.go
  87. +45 −0 test/e2e_node/perf/workloads/utils.go
  88. +53 −0 test/e2e_node/perf/workloads/workloads.go
  89. +102 −6 test/integration/daemonset/daemonset_test.go

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -28,6 +28,7 @@ import (
"k8s.io/client-go/scale"
"k8s.io/kubernetes/pkg/controller/podautoscaler"
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
resourceclient "k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1"
"k8s.io/metrics/pkg/client/custom_metrics"
"k8s.io/metrics/pkg/client/external_metrics"
@@ -48,9 +49,19 @@ func startHPAController(ctx ControllerContext) (http.Handler, bool, error) {
func startHPAControllerWithRESTClient(ctx ControllerContext) (http.Handler, bool, error) {
clientConfig := ctx.ClientBuilder.ConfigOrDie("horizontal-pod-autoscaler")
hpaClient := ctx.ClientBuilder.ClientOrDie("horizontal-pod-autoscaler")
apiVersionsGetter := custom_metrics.NewAvailableAPIsGetter(hpaClient.Discovery())
// invalidate the discovery information roughly once per resync interval our API
// information is *at most* two resync intervals old.
go custom_metrics.PeriodicallyInvalidate(
apiVersionsGetter,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerSyncPeriod.Duration,
ctx.Stop)
metricsClient := metrics.NewRESTMetricsClient(
resourceclient.NewForConfigOrDie(clientConfig),
custom_metrics.NewForConfigOrDie(clientConfig),
custom_metrics.NewForConfig(clientConfig, ctx.RESTMapper, apiVersionsGetter),
external_metrics.NewForConfigOrDie(clientConfig),
)
return startHPAControllerWithMetricsClient(ctx, metricsClient)
@@ -80,22 +91,19 @@ func startHPAControllerWithMetricsClient(ctx ControllerContext, metricsClient me
return nil, false, err
}
replicaCalc := podautoscaler.NewReplicaCalculator(
metricsClient,
hpaClient.CoreV1(),
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerTolerance,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerCPUInitializationPeriod.Duration,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerInitialReadinessDelay.Duration,
)
go podautoscaler.NewHorizontalController(
hpaClient.CoreV1(),
scaleClient,
hpaClient.AutoscalingV1(),
ctx.RESTMapper,
replicaCalc,
metricsClient,
ctx.InformerFactory.Autoscaling().V1().HorizontalPodAutoscalers(),
ctx.InformerFactory.Core().V1().Pods(),
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerSyncPeriod.Duration,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerDownscaleStabilizationWindow.Duration,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerTolerance,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerCPUInitializationPeriod.Duration,
ctx.ComponentConfig.HPAController.HorizontalPodAutoscalerInitialReadinessDelay.Duration,
).Run(ctx.Stop)
return nil, true, nil
}
@@ -14,10 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha2 holds the external kubeadm API types of version v1alpha2
// Note: This file should be kept in sync with the similar one for the internal API
// TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future
// (probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now.
package v1alpha3
import (
@@ -14,7 +14,83 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha2 is the package that contains the libraries that drive the kubeadm binary.
// Package v1alpha3 is the API (config file) for driving the kubeadm binary.
// Some of these options are also available as command line flags, but
// the preferred way to configure kubeadm is to pass a YAML file in with the
// --config option.
//
// A fully populated example of the schema:
// apiVersion: kubeadm.k8s.io/v1alpha3
// kind: InitConfiguration
// etcd:
// # one of local or external
// local:
// image: "k8s.gcr.io/etcd-amd64:3.2.18"
// dataDir: "/var/lib/etcd"
// extraArgs:
// listen-client-urls: "http://10.100.0.1:2379"
// serverCertSANs:
// - "ec2-10-100-0-1.compute-1.amazonaws.com"
// peerCertSANs:
// - "10.100.0.1"
// external:
// endpoints:
// - "10.100.0.1:2379"
// - "10.100.0.2:2379"
// caFile: "/etcd/kubernetes/pki/etcd/etcd-ca.crt"
// certFile: "/etcd/kubernetes/pki/etcd/etcd.crt"
// certKey: "/etcd/kubernetes/pki/etcd/etcd.key"
// networking:
// serviceSubnet: "10.96.0.0/12"
// podSubnet: "10.100.0.1/24"
// dnsDomain: "cluster.local"
// kubernetesVersion: "v1.12.0"
// ControlPlaneEndpoint: "10.100.0.1:6443"
// apiServerExtraArgs:
// authorization-mode: "Node,RBAC"
// controlManagerExtraArgs:
// node-cidr-mask-size: 20
// schedulerExtraArgs:
// address: "10.100.0.1"
// apiServerCertSANs:
// - "10.100.1.1"
// - "ec2-10-100-0-1.compute-1.amazonaws.com"
// certificateDirectory: "/etc/kubernetes/pki"
// imageRepository: "k8s.gcr.io"
// unifiedControlPlaneImage: "k8s.gcr.io/controlplane:v1.12.0"
// auditPolicyConfiguration:
// # https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#audit-policy
// path: "/var/log/audit/audit.json"
// logDir: "/var/log/audit"
// logMaxAge: 7 # in days
// featureGates:
// selfhosting: false
// clusterName: "example-cluster"
// bootstrapTokens:
// - token: "9a08jv.c0izixklcxtmnze7"
// description: "kubeadm bootstrap token"
// ttl: "24h"
// usages:
// - "authentication"
// - "signing"
// groups:
// - "system:bootstrappers:kubeadm:default-node-token"
// nodeRegistration:
// name: "ec2-10-100-0-1"
// criSocket: "/var/run/dockershim.sock"
// taints:
// - key: "kubeadmNode"
// value: "master"
// effect: "NoSchedule"
// kubeletExtraArgs:
// cgroupDriver: "cgroupfs"
// apiEndpoint:
// advertiseAddress: "10.100.0.1"
// bindPort: 6443
//
// TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future
// (probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now.
//
// +k8s:defaulter-gen=TypeMeta
// +groupName=kubeadm.k8s.io
// +k8s:deepcopy-gen=package
@@ -234,9 +234,7 @@ type LocalEtcd struct {
// ExternalEtcd describes an external etcd cluster
type ExternalEtcd struct {
// Endpoints of etcd members. Useful for using external etcd.
// If not provided, kubeadm will run etcd in a static pod.
// Endpoints of etcd members. Required for ExternalEtcd.
Endpoints []string `json:"endpoints"`
// CAFile is an SSL Certificate Authority file used to secure etcd communication.
CAFile string `json:"caFile"`
@@ -27,3 +27,11 @@ func AddKubeConfigFlag(fs *pflag.FlagSet, kubeConfigFile *string) {
func AddConfigFlag(fs *pflag.FlagSet, cfgPath *string) {
fs.StringVar(cfgPath, "config", *cfgPath, "Path to kubeadm config file (WARNING: Usage of a configuration file is experimental)")
}
// AddIgnorePreflightErrorsFlag adds the --ignore-preflight-errors flag to the given flagset
func AddIgnorePreflightErrorsFlag(fs *pflag.FlagSet, ignorePreflightErrors *[]string) {
fs.StringSliceVar(
ignorePreflightErrors, "ignore-preflight-errors", *ignorePreflightErrors,
"A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.",
)
}
@@ -38,6 +38,7 @@ go_library(
"//cmd/kubeadm/app/phases/kubeconfig:go_default_library",
"//cmd/kubeadm/app/phases/kubelet:go_default_library",
"//cmd/kubeadm/app/phases/markmaster:go_default_library",
"//cmd/kubeadm/app/phases/patchnode:go_default_library",
"//cmd/kubeadm/app/phases/selfhosting:go_default_library",
"//cmd/kubeadm/app/phases/upgrade:go_default_library",
"//cmd/kubeadm/app/phases/uploadconfig:go_default_library",
@@ -49,7 +50,6 @@ go_library(
"//pkg/util/normalizer:go_default_library",
"//pkg/util/version:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/flag:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/tools/bootstrap/token/api:go_default_library",
@@ -27,6 +27,7 @@ import (
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
kubeletphase "k8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet"
patchnodephase "k8s.io/kubernetes/cmd/kubeadm/app/phases/patchnode"
"k8s.io/kubernetes/cmd/kubeadm/app/preflight"
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
configutil "k8s.io/kubernetes/cmd/kubeadm/app/util/config"
@@ -61,6 +62,14 @@ var (
kubeadm alpha phase kubelet config upload --config kubeadm.yaml
`)
kubeletConfigAnnotateCRILongDesc = normalizer.LongDesc(`
Adds an annotation to the current node with the CRI socket specified in the kubeadm InitConfiguration object.
` + cmdutil.AlphaDisclaimer)
kubeletConfigAnnotateCRIExample = normalizer.Examples(`
kubeadm alpha phase kubelet config annotate-cri --config kubeadm.yaml
`)
kubeletConfigDownloadLongDesc = normalizer.LongDesc(`
Downloads the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster,
where X is the minor version of the kubelet. Either kubeadm autodetects the kubelet version by exec-ing
@@ -177,6 +186,7 @@ func NewCmdKubeletConfig() *cobra.Command {
}
cmd.AddCommand(NewCmdKubeletConfigUpload())
cmd.AddCommand(NewCmdKubeletAnnotateCRI())
cmd.AddCommand(NewCmdKubeletConfigDownload())
cmd.AddCommand(NewCmdKubeletConfigWriteToDisk())
cmd.AddCommand(NewCmdKubeletConfigEnableDynamic())
@@ -222,6 +232,45 @@ func NewCmdKubeletConfigUpload() *cobra.Command {
return cmd
}
// NewCmdKubeletAnnotateCRI calls cobra.Command for annotating the node with the given crisocket
func NewCmdKubeletAnnotateCRI() *cobra.Command {
cfg := &kubeadmapiv1alpha3.InitConfiguration{}
var cfgPath string
kubeConfigFile := constants.GetAdminKubeConfigPath()
cmd := &cobra.Command{
Use: "annotate-cri",
Short: "annotates the node with the given crisocket",
Long: kubeletConfigAnnotateCRILongDesc,
Example: kubeletConfigAnnotateCRIExample,
Run: func(cmd *cobra.Command, args []string) {
if len(cfgPath) == 0 {
kubeadmutil.CheckErr(fmt.Errorf("The --config argument is required"))
}
// KubernetesVersion is not used, but we set it explicitly to avoid the lookup
// of the version from the internet when executing ConfigFileAndDefaultsToInternalConfig
err := SetKubernetesVersion(nil, cfg)
kubeadmutil.CheckErr(err)
// This call returns the ready-to-use configuration based on the configuration file
internalcfg, err := configutil.ConfigFileAndDefaultsToInternalConfig(cfgPath, cfg)
kubeadmutil.CheckErr(err)
kubeConfigFile = cmdutil.FindExistingKubeConfig(kubeConfigFile)
client, err := kubeconfigutil.ClientSetFromFile(kubeConfigFile)
kubeadmutil.CheckErr(err)
err = patchnodephase.AnnotateCRISocket(client, internalcfg.NodeRegistration.Name, internalcfg.NodeRegistration.CRISocket)
kubeadmutil.CheckErr(err)
},
}
options.AddKubeConfigFlag(cmd.Flags(), &kubeConfigFile)
options.AddConfigFlag(cmd.Flags(), &cfgPath)
return cmd
}
// NewCmdKubeletConfigDownload calls cobra.Command for downloading the kubelet configuration from the kubelet-config-1.X ConfigMap in the cluster
func NewCmdKubeletConfigDownload() *cobra.Command {
var kubeletVersionStr string
Oops, something went wrong.

0 comments on commit 0cafd04

Please sign in to comment.