Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable scaling fluentd-gcp resources using ScalingPolicy. #59657

Merged
merged 3 commits into from
Feb 15, 2018

Conversation

x13n
Copy link
Member

@x13n x13n commented Feb 9, 2018

See https://github.com/justinsb/scaler for more details about ScalingPolicy resource.

What this PR does / why we need it:
This is adding a way to override fluentd-gcp resources in a running cluster. The resources syncing for fluentd-gcp is decoupled from addon manager.

Special notes for your reviewer:

Release note:

fluentd-gcp resources can be modified via a ScalingPolicy

cc @kawych @justinsb

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 9, 2018
@x13n
Copy link
Member Author

x13n commented Feb 9, 2018

/assign @piosz
/unassign @crassirostris

Copy link

@crassirostris crassirostris left a comment

Choose a reason for hiding this comment

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

I'm little bit concerned about using the short form of the resource in the scaler (looks like a pretty common name, possible collisions) + a couple of nits. Overall LGTM

namespace: kube-system
labels:
k8s-app: fluentd-gcp-scaler
version: v0.1

Choose a reason for hiding this comment

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

Use semver for consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

fi
if [[ -n "${request_resources}" ]]; then
modifying_flags="${modifying_flags} --requests=${request_resources}"
if ! $any_overrides; then

Choose a reason for hiding this comment

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

Won't it crash if there are no overrides?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why would it? If there are no overrides, then $any_overrides equals false.

Copy link

@crassirostris crassirostris Feb 13, 2018

Choose a reason for hiding this comment

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

Don't we use the strict mode, which will throw an error if the variable hasn't been explicitly defined before? I remember such error that resulted in #55950

Copy link
Member Author

Choose a reason for hiding this comment

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

But the variable is defined, see line 1985.

Choose a reason for hiding this comment

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

Missed it, then everything's fine, thanks :)

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: scalingpolicies.scalingpolicy.kope.io

Choose a reason for hiding this comment

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

kope.io?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just reused the ScalingPolicy defined by @justinsb in https://github.com/justinsb/scaler. I hope we can ultimately migrate to autoscaling controlled by this ScalingPolicy in the long term.

@x13n
Copy link
Member Author

x13n commented Feb 13, 2018

/assign @bowei

@crassirostris
Copy link

/assign

@x13n
Copy link
Member Author

x13n commented Feb 13, 2018

Btw, I updated configure-helper.sh to use full resource name.

Copy link

@crassirostris crassirostris left a comment

Choose a reason for hiding this comment

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

/lgtm

fi
if [[ -n "${request_resources}" ]]; then
modifying_flags="${modifying_flags} --requests=${request_resources}"
if ! $any_overrides; then

Choose a reason for hiding this comment

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

Missed it, then everything's fine, thanks :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2018
@x13n
Copy link
Member Author

x13n commented Feb 14, 2018

/assign @gmarek
Marek, can you take a look?

@x13n
Copy link
Member Author

x13n commented Feb 14, 2018

/area platform/gce
/area platform/gke

@k8s-ci-robot k8s-ci-robot added area/platform/gce area/provider/gcp Issues or PRs related to gcp provider labels Feb 14, 2018
@gmarek
Copy link
Contributor

gmarek commented Feb 15, 2018

/approve no-issue

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crassirostris, gmarek, x13n

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit d3bacb9 into kubernetes:master Feb 15, 2018
@x13n x13n deleted the manual-fluentd-gcp-scaler branch February 15, 2018 14:32
@mikedanese
Copy link
Member

Hey, this is an alpha API. We can't run this in non-alpha clusters. Furthermore this API went through no review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/platform/gce area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

8 participants