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

Add support for cloud-controller-manager in local-up-cluster.sh #57757

Conversation

dims
Copy link
Member

@dims dims commented Jan 2, 2018

What this PR does / why we need it:
We need an easy way to test the new external cloud provider. So
let's keep the existing CLOUD_PROVIDER and CLOUD_CONFIG as-is and
add a flag EXTERNAL_CLOUD_PROVIDER to run a separate process.

Since we use hyperkube to run controller-manager, let's add support
for cloud-controller-manager as well to support this use case.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Ability to run the cloud-controller-manager from local-up-cluster for easy testing

@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/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 2, 2018
@dims
Copy link
Member Author

dims commented Jan 2, 2018

/test pull-kubernetes-unit

@@ -36,6 +36,7 @@ func main() {
hk.AddServer(NewKubectlServer())
hk.AddServer(NewKubeAPIServer())
hk.AddServer(NewKubeControllerManager())
hk.AddServer(NewCloudControllerManager())
Copy link
Contributor

Choose a reason for hiding this comment

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

seems already added as 'hk.AddAlphaServer(NewCloudControllerManager())' in this file?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops! bad merge. thanks!

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 have updated the local-up-cluster.sh too with the "alpha" syntax

@dims dims force-pushed the support-cloud-controller-manager-in-local-up-cluster branch 4 times, most recently from 5bc3203 to 8a888ef Compare January 3, 2018 04:08
@dims
Copy link
Member Author

dims commented Jan 3, 2018

/test pull-kubernetes-node-e2e

@dims
Copy link
Member Author

dims commented Jan 5, 2018

@cblecker ping!

/assign @sttts
/assign @fejta

@sttts @fejta - fishing for reviews! please take a look when you get a chance.

@@ -532,9 +533,16 @@ function start_apiserver {
kube::util::create_client_certkey "${CONTROLPLANE_SUDO}" "${CERT_DIR}" 'client-ca' kube-aggregator system:kube-aggregator system:masters
kube::util::write_client_kubeconfig "${CONTROLPLANE_SUDO}" "${CERT_DIR}" "${ROOT_CA_FILE}" "${API_HOST}" "${API_SECURE_PORT}" kube-aggregator

cloud_config=""
Copy link
Member

Choose a reason for hiding this comment

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

While it won't directly cause an issue, this creates both an uppercase CLOUD_CONFIG, and a lowercase cloud_config with very different uses. Makes it less readable/clear. Perhaps "cloud_provider_arg" or something slightly different?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks fixed!

@dims dims force-pushed the support-cloud-controller-manager-in-local-up-cluster branch from 8a888ef to fef03a9 Compare January 5, 2018 20:09
@@ -532,9 +533,16 @@ function start_apiserver {
kube::util::create_client_certkey "${CONTROLPLANE_SUDO}" "${CERT_DIR}" 'client-ca' kube-aggregator system:kube-aggregator system:masters
kube::util::write_client_kubeconfig "${CONTROLPLANE_SUDO}" "${CERT_DIR}" "${ROOT_CA_FILE}" "${API_HOST}" "${API_SECURE_PORT}" kube-aggregator

cloud_config_arg=""
Copy link
Contributor

Choose a reason for hiding this comment

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

set the "else" case value here. Saves two lines.

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!

--kubeconfig "$CERT_DIR"/controller.kubeconfig \
--use-service-account-credentials \
--controllers="${KUBE_CONTROLLERS}" \
--master="https://${API_HOST}:${API_SECURE_PORT}" >"${CTLRMGR_LOG}" 2>&1 &
CTLRMGR_PID=$!

if [[ "${EXTERNAL_CLOUD_PROVIDER:-}" == "true" ]]; then
if [ "${CLOUD_CONFIG}" == "" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

if [ -z "${CLOUD_CONFIG}" ]; then

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!

--kubeconfig "$CERT_DIR"/controller.kubeconfig \
--use-service-account-credentials \
--controllers="${KUBE_CONTROLLERS}" \
--master="https://${API_HOST}:${API_SECURE_PORT}" >"${CTLRMGR_LOG}" 2>&1 &
CTLRMGR_PID=$!

if [[ "${EXTERNAL_CLOUD_PROVIDER:-}" == "true" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

would prefer to see this in a separate start_cloud_controller_manager.

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!

@dims dims force-pushed the support-cloud-controller-manager-in-local-up-cluster branch from fef03a9 to 77c7117 Compare January 8, 2018 12:02
We need an easy way to test the new external cloud provider. So
let's keep the existing CLOUD_PROVIDER and CLOUD_CONFIG as-is and
add a flag EXTERNAL_CLOUD_PROVIDER to run a separate process.
@fejta
Copy link
Contributor

fejta commented Jan 8, 2018

@k8s-mirror-cluster-lifecycle-pr-reviews do we really want to make changes to local-up-cluster.sh? If not what is the alternative?

@sttts
Copy link
Contributor

sttts commented Jan 9, 2018

do we really want to make changes to local-up-cluster.sh? If not what is the alternative?

It's the tool many of us (still) use to test code locally. AFAIK there is no alternative, have not even heard of any discussions around that. Especially, kubeadm is no replacement for this developer-only tool.

@sttts
Copy link
Contributor

sttts commented Jan 9, 2018

/lgtm
/approve no-issue

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, sttts

Associated issue requirement bypassed by: sttts

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your 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 Jan 9, 2018
@sttts
Copy link
Contributor

sttts commented Jan 9, 2018

@dims switch the release-note to a dev-release-note. Ptal. I think this is nothing normal users should have to see.

@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 (batch tested with PRs 55910, 57757). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 32c026c into kubernetes:master Jan 9, 2018
@dims
Copy link
Member Author

dims commented Jan 9, 2018

thanks @sttts

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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants