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

Fix wrong guide for egress selection. #34839

Merged
merged 1 commit into from
Jul 13, 2022
Merged

Conversation

lshgdut
Copy link
Contributor

@lshgdut lshgdut commented Jul 6, 2022

This PR fix the wrong guide according to the commit bellow:

apiserver: support egress selection name 'controlplane' and deprecate 'master'

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 6, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: lshgdut / name: monk (abcf77f)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jul 6, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @lshgdut!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. language/en Issues or PRs related to English language labels Jul 6, 2022
@k8s-ci-robot k8s-ci-robot requested review from chenxuc and gochist July 6, 2022 03:00
@k8s-ci-robot k8s-ci-robot added language/ko Issues or PRs related to Korean language language/zh Issues or PRs related to Chinese language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Jul 6, 2022
@netlify
Copy link

netlify bot commented Jul 6, 2022

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 950b874
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/62c58683cf3def00097648a3
😎 Deploy Preview https://deploy-preview-34839--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 6, 2022
@divya-mohan0209
Copy link
Contributor

Hey @lshgdut , thank you for your contribution! I'd rather we have this change technically approved & signed off in one language i.e. English & then replicated via PRs in different languages.

@divya-mohan0209 divya-mohan0209 removed language/ko Issues or PRs related to Korean language language/zh Issues or PRs related to Chinese language labels Jul 6, 2022
@lshgdut
Copy link
Contributor Author

lshgdut commented Jul 6, 2022

Hey @lshgdut , thank you for your contribution! I'd rather we have this change technically approved & signed off in one language i.e. English & then replicated via PRs in different languages.

OK! I have reverted files changed except English.

Copy link
Contributor

@divya-mohan0209 divya-mohan0209 left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divya-mohan0209

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 Jul 6, 2022
This PR fix the wrong guide according to the commit bellow:

[apiserver: support egress selection name 'controlplane' and deprecate 'master'](kubernetes/kubernetes@a0aebf9)
@lshgdut
Copy link
Contributor Author

lshgdut commented Jul 6, 2022

/approve

I'm sorry. I have force pushed again to correct the commit message.

@@ -2,7 +2,7 @@ apiVersion: apiserver.k8s.io/v1beta1
kind: EgressSelectorConfiguration
egressSelections:
# Since we want to control the egress traffic to the cluster, we use the
# "cluster" as the name. Other supported values are "etcd", and "master".
# "cluster" as the name. Other supported values are "etcd", and "controlplane".
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @lshgdut . Thanks for contributing.
Do you know if controlplane is an accepted value? I am trying to locate information about this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ref commit is here kubernetes/kubernetes@a0aebf9

# file: staging/src/k8s.io/apiserver/pkg/server/egressselector/egress_selector.go
func lookupServiceName(name string) (EgressType, error) {
	switch strings.ToLower(name) {
	// 'master' is deprecated, interpret "master" as controlplane internally until removed in v1.22.
	case "master":
		klog.Warning("EgressSelection name 'master' is deprecated, use 'controlplane' instead")
		return ControlPlane, nil
	case "controlplane":
		return ControlPlane, nil
	case "etcd":
		return Etcd, nil
	case "cluster":
		return Cluster, nil
	}
	return -1, fmt.Errorf("unrecognized service name %s", name)
}

BTW, the "master" value is also accepted but deprecated, it will automatically convert to "controlplane".

Please take a look at staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/conversion.go

func Convert_v1alpha1_EgressSelection_To_apiserver_EgressSelection(in *EgressSelection, out *apiserver.EgressSelection, s conversion.Scope) error {
	if err := autoConvert_v1alpha1_EgressSelection_To_apiserver_EgressSelection(in, out, s); err != nil {
		return err
	}
	if out.Name == "master" {
		out.Name = "controlplane"
	}
	return nil
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the information!

@kbhawkey
Copy link
Contributor

Thanks @lshgdut

/lgtm

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

LGTM label has been added.

Git tree hash: 74f066cdb93eb6acec8b3b6ec78008aaeb2665b5

@k8s-ci-robot k8s-ci-robot merged commit dba3d59 into kubernetes:main Jul 13, 2022
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. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants