在命名空间Kubernetes中创建入口控制器(Create ingress controller in namespace Kubernetes)
我正在学习一些关于入口的知识。 它由两部分组成:
- Ingress资源: “您希望如何将请求路由到支持服务?”
- Ingress控制器: “收听Ingress资源的Kubernetes API。”
我在名为ingress的命名空间中部署了一个入口控制器。 我还部署了一个默认的后端。 现在我想部署一个应用程序(svc,pods的部署等)。
我是否还需要在命名空间
ingress
部署此应用程序? 对我来说似乎合乎逻辑我必须为每个新应用程序部署一个新的入口资源,但这对Ingress控制器有何影响?我是否必须为每个命名空间创建一个入口控制器,还是建议在多个命名空间的入口控制器上使用?
I am learning a bit about ingress. It consists of 2 parts:
- Ingress resource: "How do you want to route requests to the backing services?"
- Ingress controller: "Listens to Kubernetes API for Ingress resources."
I've deployed an ingress controller in namespace called ingress. I've also deployed a default backend. Now I want to deploy an application (svc, deployment of pods etc).
Do I need to deploy this application also in the namespace
ingress
? It seems logical to me I have to deploy a new ingress resource for every new application, but how is this working for the Ingress controller?Do I have to create one ingress controller for every namespace or is it recommended to use on ingress controller over multiple namespaces?
原文:https://stackoverflow.com/questions/51571542
最满意答案
在尝试访问.Displayed属性之前,您需要检查元素是否为null,将您的IsElementVisible方法更改为:
public bool IsElementVisible(IWebElement element) { return element == null ? false : element.Displayed; }
You need to check if the element is null before trying to access the .Displayed property, change your IsElementVisible method to this:
public bool IsElementVisible(IWebElement element) { return element == null ? false : element.Displayed; }
相关问答
更多-
虽然评论是真的,但我为您提供了解决方法 - 将Assert更改为: if (!message.equals(expected)){ takeScreenshot(outputfile.jpg); } While the comments are true, I offer you workaround - change Assert to if: if (!message.equals(expected)){ takeScreenshot(outputfile.jpg); }
-
在尝试访问.Displayed属性之前,您需要检查元素是否为null,将您的IsElementVisible方法更改为: public bool IsElementVisible(IWebElement element) { return element == null ? false : element.Displayed; } You need to check if the element is null before trying to access the .Displayed prop ...
-
运行功能测试时,通常需要使用“ 运行功能测试”任务在测试代理上运行。 When running functional tests, you typically need to use the Run Functional Tests task to run on a test agent.
-
由于您获得的异常是StaleElementReferenceException ,看起来您仍然太快了。 说明: 该元素位于您正在使用的页面上。 你点击的东西,页面开始重新加载。 但是在它重新加载之前,WebDriver已经找到了你的错误元素(它不会因为某些原因等待之前的操作完成)。 然后页面最终重新加载,WebDriver尝试单击以前找到的元素...现在不存在,因为它在上一页(即使它现在也在那里)。 您需要等待上一个操作完成,最好等待一些操作结果。 屏幕上有新内容吗? 等等! Since the excep ...
-
Selenium Webdriver C#如何测试元素不存在?(Selenium Webdriver C# How to test an element is not present?)[2023-12-13]
这是一个直接解决问题的方法: if (Driver.Instance.FindElements(By.XPath(baseXPathSendKeys + "div[2]/textarea")).Count != 0) { // exists } else { // doesn't exist } 您可以创建一个Exists(By)方法来测试元素: public bool Exists(By by) { if (Driver.Instance.FindElements(by).Cou ... -
这与99年11月10日的问题相同 。 我的答案如何不能满足你的问题? 我添加了(虽然评论)行browser.wait(EC.invisibilityOf(blockingElement), 5000); 作为你的问题的答案。 当下,一个元素isClickable不会自动意味着,它也在前面,没有其他对象覆盖它。 这意味着,该对象可能会收到click() ,因为... 元素是可见的并且已启用,因此您可以单击它 阅读更多关于这里 。 您甚至可以检查源代码。 UPDATE 鉴于你的评论,你有一个对话框弹出阻止输入, ...
-
我建议改变一些事情: 你错过了对$this->url();的调用$this->url(); 从我在测试方法中看到的内容: public function testFormSubmissionWithUsername() { $this->url('your actual URL here'); // Add this line $this->byName('login-form[login]')->value('admin'); $this->byName('login-form[p ...
-
您可以在按下按钮或任何其他事件时以编程方式提交表单。 $('#form_id').trigger('submit'); 此外,如果您想在不使用jQuery Mobile Ajax的情况下提交表单,请将以下属性添加到表单div中。
-
如果测试用例1失败,则使用Selenium Python执行测试用例2(Execute test case 2 if test case 1 fails and so on with Selenium Python)[2022-10-05]
在使用unittest.TestCase类或django.test.TestCase类的Python单元测试中,您应该为要测试的每个逻辑概念创建一个test_*函数。 单元测试应该失败只有一个原因。 有多种方法可以测试一个原因,但测试失败只有一个原因。 测试类可能如下: from django.test import LiveServerTestCase from selenium import webdriver class FooTestCase(LiveServerTestCase): de ... -
AutoIt就是解决方案。 我能够在我的C#项目中执行脚本。 private void UploadFile() { foreach (var element in driver.FindElements(By.TagName("button"))) { string open = element.Text; if (open == "Open") { eleme ...