Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Allowing adding arbitrary flags to kubernetes core components through plugins #1564

Conversation

omar-nahhas
Copy link
Contributor

@omar-nahhas omar-nahhas commented Feb 28, 2019

This PR Is to allow adding specific configuration flags to the kube-proxy, kubelet and kube-scheduler through plugins, it is an extension of the currently existing functionality to add fags to the kubeapi and kube-controller-manager.

In the plugin.yaml you can add flags like follows:

kube-componets-flags

Then they will be injected on the configuration of the specific components:
kube-scheduler
kubelet
generated_kube_proxy_conf

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: redbaron

If they are not already assigned, you can assign the PR to them by writing /assign @redbaron in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 28, 2019
@codecov-io
Copy link

codecov-io commented Feb 28, 2019

Codecov Report

Merging #1564 into master will increase coverage by 0.05%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1564      +/-   ##
==========================================
+ Coverage    25.8%   25.85%   +0.05%     
==========================================
  Files          98       98              
  Lines        5057     5062       +5     
==========================================
+ Hits         1305     1309       +4     
- Misses       3605     3606       +1     
  Partials      147      147
Impacted Files Coverage Δ
pkg/api/types.go 0% <ø> (ø) ⬆️
pkg/model/node_pool_config.go 34.88% <ø> (ø) ⬆️
pkg/model/config.go 54.76% <ø> (ø) ⬆️
pkg/model/compiler.go 55.69% <100%> (+0.56%) ⬆️
pkg/model/stack_new.go 33.33% <75%> (+1.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f14e23...f0c7bba. Read the comment docs.

@omar-nahhas omar-nahhas force-pushed the allow-flags-on-every-component branch from 64e9024 to 75d9034 Compare February 28, 2019 14:55
@omar-nahhas
Copy link
Contributor Author

/assign @davidmccormick

@omar-nahhas
Copy link
Contributor Author

omar-nahhas commented Mar 1, 2019

I have tested this by adding the flag metricsBindAddress 0.0.0.0 to the kube-proxy (through a plugin) and then spun the cluster. The cluster spun successfully and my external Prometheus could finally scrape all the kube-proxy(ies)

version

cluster_spinned_up

cluster_running

kube_proxy

Copy link
Contributor

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments on naming. This seems like a great idea though!

pkg/api/kubernetes.go Outdated Show resolved Hide resolved
pkg/model/config.go Outdated Show resolved Hide resolved
test/integration/plugin_test.go Outdated Show resolved Hide resolved
@omar-nahhas omar-nahhas force-pushed the allow-flags-on-every-component branch 2 times, most recently from d2b8fb1 to 9c326ec Compare March 4, 2019 12:27
@omar-nahhas omar-nahhas force-pushed the allow-flags-on-every-component branch from 9c326ec to f0c7bba Compare March 4, 2019 12:28
@omar-nahhas
Copy link
Contributor Author

@mumoshu I have refactored it and test it again by spinning a cluster.

rolled_ok2
rolled_ok

@davidmccormick
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@davidmccormick
Copy link
Contributor

Thanks @omar-nahhas for your continued support! 🙏

@davidmccormick davidmccormick merged commit e8acbea into kubernetes-retired:master Apr 8, 2019
@davidmccormick davidmccormick added this to the v0.13.0 milestone Apr 10, 2019
@paalkr
Copy link
Contributor

paalkr commented Aug 20, 2019

I'm not sure if I understand how to include a plugin that will allow me to configure the kube-controller-manager flags. My goal is to add this flag
--horizontal-pod-autoscaler-downscale-stabilization-window=10m

Any guidance or examples would be highly appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants