Skip to content

Commit

Permalink
Merge pull request #13802 from spowelljr/removeHousekeeping
Browse files Browse the repository at this point in the history
 Add `--disable-metrics` flag
  • Loading branch information
spowelljr authored Mar 16, 2022
2 parents 71dbdfd + 76d97af commit 535d0b6
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 25 deletions.
7 changes: 5 additions & 2 deletions cmd/minikube/cmd/start_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const (
certExpiration = "cert-expiration"
binaryMirror = "binary-mirror"
disableOptimizations = "disable-optimizations"
disableMetrics = "disable-metrics"
)

var (
Expand Down Expand Up @@ -192,7 +193,8 @@ func initMinikubeFlags() {
startCmd.Flags().Int(extraDisks, 0, "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit and kvm2 drivers)")
startCmd.Flags().Duration(certExpiration, constants.DefaultCertExpiration, "Duration until minikube certificate expiration, defaults to three years (26280h).")
startCmd.Flags().String(binaryMirror, "", "Location to fetch kubectl, kubelet, & kubeadm binaries from.")
startCmd.Flags().Bool(disableOptimizations, false, "If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.")
startCmd.Flags().Bool(disableOptimizations, false, "If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.")
startCmd.Flags().Bool(disableMetrics, false, "If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.")
}

// initKubernetesFlags inits the commandline flags for Kubernetes related options
Expand Down Expand Up @@ -386,7 +388,7 @@ func getExtraOptions() config.ExtraOptionSlice {
if detect.IsCloudShell() {
options = append(options, "kubelet.cgroups-per-qos=false", "kubelet.enforce-node-allocatable=\"\"")
}
if !viper.GetBool(disableOptimizations) {
if viper.GetBool(disableMetrics) {
options = append(options, "kubelet.housekeeping-interval=5m")
}
for _, eo := range options {
Expand Down Expand Up @@ -517,6 +519,7 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, rtime str
MountUID: viper.GetString(mountUID),
BinaryMirror: viper.GetString(binaryMirror),
DisableOptimizations: viper.GetBool(disableOptimizations),
DisableMetrics: viper.GetBool(disableMetrics),
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: k8sVersion,
ClusterName: ClusterFlagValue(),
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type ClusterConfig struct {
MountUID string
BinaryMirror string // Mirror location for kube binaries (kubectl, kubelet, & kubeadm)
DisableOptimizations bool
DisableMetrics bool
}

// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
Expand Down
3 changes: 2 additions & 1 deletion site/content/en/docs/commands/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ minikube start [flags]
--cri-socket string The cri socket path to be used.
--delete-on-failure If set, delete the current cluster if start fails and try again. Defaults to false.
--disable-driver-mounts Disables the filesystem mounts provided by the hypervisors
--disable-optimizations If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.
--disable-metrics If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.
--disable-optimizations If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.
--disk-size string Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g). (default "20000mb")
--dns-domain string The cluster dns domain name used in the Kubernetes cluster (default "cluster.local")
--dns-proxy Enable proxy for NAT DNS requests (virtualbox driver only)
Expand Down
5 changes: 0 additions & 5 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,6 @@ func validateExtraConfig(ctx context.Context, t *testing.T, profile string) {
if !strings.Contains(afterCfg.Config.KubernetesConfig.ExtraOptions.String(), expectedExtraOptions) {
t.Errorf("expected ExtraOptions to contain %s but got %s", expectedExtraOptions, afterCfg.Config.KubernetesConfig.ExtraOptions.String())
}

expectedExtraOptions = "kubelet.housekeeping-interval=5m"
if !strings.Contains(afterCfg.Config.KubernetesConfig.ExtraOptions.String(), expectedExtraOptions) {
t.Errorf("expected ExtraOptions to contain %s but got %s", expectedExtraOptions, afterCfg.Config.KubernetesConfig.ExtraOptions.String())
}
}

// imageID returns a docker image id for image `image` and current architecture
Expand Down
4 changes: 2 additions & 2 deletions test/integration/guest_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ func TestGuestEnvironment(t *testing.T) {
defer CleanupWithLogs(t, profile, cancel)

t.Run("Setup", func(t *testing.T) {
args := append([]string{"start", "-p", profile, "--install-addons=false", "--memory=2048", "--wait=false", "--disable-optimizations=true"}, StartArgs()...)
args := append([]string{"start", "-p", profile, "--install-addons=false", "--memory=2048", "--wait=false", "--disable-metrics=true"}, StartArgs()...)
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
if err != nil {
t.Errorf("failed to start minikube: args %q: %v", rr.Command(), err)
}

if strings.Contains(rr.Stderr.String(), "kubelet.housekeeping-interval=5m") {
t.Error("--disable-optimizations=true is not working, optimizations found")
t.Error("--disable-metrics=true is not working, housekeeping interval not increased")
}
})

Expand Down
5 changes: 4 additions & 1 deletion translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@
"If present, writes to the provided file instead of stdout.": "Falls gesetzt, wird in die angegebene Datei geschrieben anstatt auf stdout.",
"If set, automatically updates drivers to the latest version. Defaults to true.": "Falls gesetzt, werden alle Treiber automatisch auf die aktuellste Version geupdated. Default: true",
"If set, delete the current cluster if start fails and try again. Defaults to false.": "Falls gesetzt, lösche den Cluster wenn der Start fehlschlägt und versuche erneut zu starten. Default: false",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.": "",
"If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.": "",
"If set, download tarball of preloaded images if available to improve start time. Defaults to true.": "Falls gesetzt, lade einen tarball von vorbereiteten Images herunter, falls vorhanden, um die Startzeit zu verbessern. Default: true",
"If set, force the container runtime to use systemd as cgroup manager. Defaults to false.": "Fall gesetzt, zwinge die Container Runtime systemd als cgroup Manager zu verwenden. Default: false",
"If set, install addons. Defaults to true.": "Falls gesetzt, werden Addons installiert. Default: true",
Expand Down Expand Up @@ -1000,7 +1001,9 @@
"{{.name}} was successfully configured": "{{.name}} wurde erfolgreich konfiguriert",
"{{.name}}\" profile does not exist": "Profil \"{{.name}}\" existiert nicht",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity)": "{{.n}} hat fast keinen Plattenplatz mehr. Dies kann dazu führen, dass Deployments fehlschlagen! ({{.p}}% der Kapazität)",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity)": "{{.n}} hat keinen Plattenplatz mehr! (/var ist bei {{.p}}% seiner Kapazität)",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.ociBin}} rmi {{.images}}": "",
"{{.ocibin}} is taking an unsually long time to respond, consider restarting {{.ocibin}}": "{{.ocibin}} benötigt unnötig lange zum Antworten, erwäge {{.ocibin}} neuzustarten",
"{{.path}} is version {{.client_version}}, which may have incompatibilites with Kubernetes {{.cluster_version}}.": "{{.path}} ist Version {{.client_version}}, welche inkompatibel ist mit Kubernetes {{.cluster_version}}",
Expand Down
7 changes: 4 additions & 3 deletions translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@
"If present, writes to the provided file instead of stdout.": "",
"If set, automatically updates drivers to the latest version. Defaults to true.": "",
"If set, delete the current cluster if start fails and try again. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.": "",
"If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.": "",
"If set, download tarball of preloaded images if available to improve start time. Defaults to true.": "",
"If set, force the container runtime to use systemd as cgroup manager. Defaults to false.": "",
"If set, install addons. Defaults to true.": "",
Expand Down Expand Up @@ -1000,8 +1001,8 @@
"{{.name}} has no available configuration options": "",
"{{.name}} is already running": "",
"{{.name}} was successfully configured": "",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity)": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity)": "",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.ociBin}} rmi {{.images}}": "",
"{{.ocibin}} is taking an unsually long time to respond, consider restarting {{.ocibin}}": "",
"{{.path}} is version {{.client_version}}, which may have incompatibilites with Kubernetes {{.cluster_version}}.": "",
Expand Down
4 changes: 4 additions & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@
"If present, writes to the provided file instead of stdout.": "S'il est présent, écrit dans le fichier fourni au lieu de la sortie standard.",
"If set, automatically updates drivers to the latest version. Defaults to true.": "Si défini, met automatiquement à jour les pilotes vers la dernière version. La valeur par défaut est true.",
"If set, delete the current cluster if start fails and try again. Defaults to false.": "Si défini, supprime le cluster actuel si le démarrage échoue et réessaye. La valeur par défaut est false.",
"If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.": "S'il est défini, désactive les optimisations définies pour Kubernetes local. Y compris la diminution des répliques CoreDNS de 2 à 1 et l'augmentation de l'intervalle de maintenance kubeadm de 10 s à 5 m. La valeur par défaut est false.",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.": "",
"If set, download tarball of preloaded images if available to improve start time. Defaults to true.": "Si défini, télécharge l'archive tar des images préchargées si disponibles pour améliorer le temps de démarrage. La valeur par défaut est true.",
"If set, force the container runtime to use systemd as cgroup manager. Defaults to false.": "S'il est défini, force l'environnement d'exécution du conteneur à utiliser systemd comme gestionnaire de groupe de contrôle. La valeur par défaut est false.",
"If set, install addons. Defaults to true.": "Si défini, installe les modules. La valeur par défaut est true.",
Expand Down Expand Up @@ -966,7 +968,9 @@
"{{.name}} is already running": "{{.name}} est déjà en cours d'exécution",
"{{.name}} was successfully configured": "{{.name}} a été configuré avec succès",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity)": "{{.n}} manque presque d'espace disque, ce qui peut entraîner l'échec des déploiements ! ({{.p}} % de la capacité)",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity)": "{{.n}} n'a plus d'espace disque ! (/var est à {{.p}} % de capacité)",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.ociBin}} rmi {{.images}}": "{{.ociBin}} rmi {{.images}}",
"{{.ocibin}} is taking an unsually long time to respond, consider restarting {{.ocibin}}": "{{.ocibin}} prend un temps anormalement long pour répondre, pensez à redémarrer {{.ocibin}}",
"{{.path}} is version {{.client_version}}, which may have incompatibilites with Kubernetes {{.cluster_version}}.": "{{.path}} est la version {{.client_version}}, qui peut comporter des incompatibilités avec Kubernetes {{.cluster_version}}.",
Expand Down
4 changes: 4 additions & 0 deletions translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@
"If present, writes to the provided file instead of stdout.": "指定すると、標準出力の代わりに指定されたファイルに出力します。",
"If set, automatically updates drivers to the latest version. Defaults to true.": "設定すると、自動的にドライバーを最新バージョンに更新します。デフォルトは true です。",
"If set, delete the current cluster if start fails and try again. Defaults to false.": "設定すると、現在のクラスターの起動に失敗した場合はクラスターを削除して再度試行します。デフォルトは false です。",
"If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.": "設定すると、ローカルの Kubernetes 用に設定された最適化を無効化します。CoreDNS レプリカ数を 2 から 1 に減らし、kubeadm の housekeeping-interval を 10 秒から 5 分に増加させることを含みます。デフォルトは false です。",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.": "",
"If set, download tarball of preloaded images if available to improve start time. Defaults to true.": "設定すると、開始時間を改善するため、利用可能であれば、プレロードイメージの tar ボールをダウンロードします。デフォルトは false です。",
"If set, force the container runtime to use systemd as cgroup manager. Defaults to false.": "設定すると、cgroup マネージャーとして systemd を使うようコンテナーランタイムに強制します。デフォルトは false です。",
"If set, install addons. Defaults to true.": "設定すると、アドオンをインストールします。デフォルトは true です。",
Expand Down Expand Up @@ -1024,7 +1026,9 @@
"{{.name}} is already running": "{{.name}} はすでに実行中です",
"{{.name}} was successfully configured": "{{.name}} は正常に設定されました",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity)": "{{.n}} はほとんどディスクがいっぱいで、デプロイが失敗する原因になりかねません!(容量の {{.p}}%)",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity)": "{{.n}} はディスクがいっぱいです!(/var は容量の {{.p}}% です)",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.ociBin}} rmi {{.images}}": "",
"{{.ocibin}} is taking an unsually long time to respond, consider restarting {{.ocibin}}": "{{.ocibin}} の反応が異常なほど長時間かかっています。{{.ocibin}} の再起動を検討してください",
"{{.path}} is version {{.client_version}}, which may have incompatibilites with Kubernetes {{.cluster_version}}.": "{{.path}} のバージョンは {{.client_version}} で、Kubernetes {{.cluster_version}} と互換性がないかもしれません。",
Expand Down
7 changes: 4 additions & 3 deletions translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@
"If present, writes to the provided file instead of stdout.": "",
"If set, automatically updates drivers to the latest version. Defaults to true.": "",
"If set, delete the current cluster if start fails and try again. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1 and increasing kubeadm housekeeping-interval from 10s to 5m. Defaults to false.": "",
"If set, disables metrics reporting (CPU and memory usage), this can improve CPU usage. Defaults to false.": "",
"If set, disables optimizations that are set for local Kubernetes. Including decreasing CoreDNS replicas from 2 to 1. Defaults to false.": "",
"If set, download tarball of preloaded images if available to improve start time. Defaults to true.": "",
"If set, force the container runtime to use systemd as cgroup manager. Defaults to false.": "",
"If set, install addons. Defaults to true.": "",
Expand Down Expand Up @@ -1013,8 +1014,8 @@
"{{.name}} has no available configuration options": "{{.name}} 이 사용 가능한 환경 정보 옵션이 없습니다",
"{{.name}} is already running": "{{.name}} 이 이미 실행 중입니다",
"{{.name}} was successfully configured": "{{.name}} 이 성공적으로 설정되었습니다",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity)": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity)": "",
"{{.n}} is nearly out of disk space, which may cause deployments to fail! ({{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.n}} is out of disk space! (/var is at {{.p}}% of capacity). You can pass '--force' to skip this check.": "",
"{{.ociBin}} rmi {{.images}}": "",
"{{.ocibin}} is taking an unsually long time to respond, consider restarting {{.ocibin}}": "",
"{{.path}} is version {{.client_version}}, which may have incompatibilites with Kubernetes {{.cluster_version}}.": "",
Expand Down
Loading

0 comments on commit 535d0b6

Please sign in to comment.