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

Disabling ASM mode if the Istio CRD is not available. #942

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

cadmuxe
Copy link
Member

@cadmuxe cadmuxe commented Nov 14, 2019

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 14, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @cadmuxe. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cadmuxe
Copy link
Member Author

cadmuxe commented Nov 14, 2019

/cc @freehan

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 14, 2019
@@ -204,7 +204,7 @@ L7 load balancing. CSV values accepted. Example: -node-port-ranges=80,8080,400-5
flag.BoolVar(&F.EnableL7Ilb, "enable-l7-ilb", false,
`Optional, whether or not to enable L7-ILB.`)
flag.BoolVar(&F.EnableASMConfigMapBasedConfig, "enable-asm-config-map-config", false, "Enable ASMConfigMapBasedConfig")
flag.StringVar(&F.ASMConfigMapBasedConfigNamespace, "asm-configmap-based-config-namespace", "kube-system,istio-system", "ASM Configmap based config: configmap namespace")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bug, it's the configmap namespace, but not the skip namespace.

@freehan
Copy link
Contributor

freehan commented Nov 14, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 14, 2019
Copy link
Contributor

@freehan freehan left a comment

Choose a reason for hiding this comment

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

just nits.

@@ -24,7 +24,7 @@ const (

// NewConfig returns a Conifg instances with default values.
func NewConfig() Config {
return Config{ASMServiceNEGSkipNamespaces: []string{"kube-system"}}
return Config{ASMServiceNEGSkipNamespaces: []string{"kube-system", "istio-system"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend specifying Enable=false as well.

That is more readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

istio-system was in the default skip flag, I just forgot to move it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, explicitly config is good.

@@ -127,6 +130,7 @@ func NewControllerContext(

// Init inits the Context, so that we can defers some config until the main thread enter actually get the leader lock.
func (ctx *ControllerContext) Init() {
klog.Info("Init ControllerContext...")
Copy link
Contributor

Choose a reason for hiding this comment

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

klog.V(2).Info("Controller Context initializing with %v", ctx.ControllerContextConfig)


apiextensionClient, err := apiextensionsclientset.NewForConfig(ctx.KubeConfig)
if err != nil {
msg := fmt.Sprintf("Failed to validate DestinationRule CRD: failed to create apiextensionClient, disabling ASM Mode, error: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this is related to DestinationRule CRD at all. This just means that the clientSet cannot be initialized, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but it's a required step to validate the CRD

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the message should be failed to create extension clientset right? Not validating destinationRule CRD.

pkg/context/context.go Outdated Show resolved Hide resolved
pkg/context/context.go Outdated Show resolved Hide resolved
@@ -58,6 +63,23 @@ func (c *ConfigMapConfigController) GetConfig() Config {
return *c.currentConfig
}

// DisableASMMode disables the ASM Mode by updating the ConfigMap and setting the internal flag.
func (c *ConfigMapConfigController) DisableASMMode() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am thinking if it is possible to not patch the original config map but just record events. Patching configmap requires some RBAC changes I assume?

@freehan
Copy link
Contributor

freehan commented Nov 15, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cadmuxe, freehan

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2019
@k8s-ci-robot k8s-ci-robot merged commit 4f86827 into kubernetes:master Nov 15, 2019
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

3 participants