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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!

- name: cluster
connection:
# This controls the protocol between the API Server and the Konnectivity
Expand Down