• 调试 Ingress Nginx


    由于 Ingress Nginx 是最受欢迎的 Ingress 控制器,因此接下来我们将介绍一些有关调试 ingress-nginx 的技巧。

    调试 Ingress Nginx

    Ingress-nginx 项目有一个 Kubectl 的官方插件

    可以使用 kubectl ingress-nginx :

    • 检查日志,后端,证书等。
    • 连接到 ingress
    • 检查当前配置

    应该尝试的三个命令是:

    • kubectl ingress-nginx lint,它会检查 nginx.conf 配置
    • kubectl ingress-nginx backend,它会检查后端(类似于kubectl describe ingress
    • kubectl ingress-nginx logs,查看日志

    请注意,可能需要为 Ingress 控制器指定正确的名称空间 namespace

    macOS/Linux
    Bash or ZSH shells
    Make sure that  is installed.

    Run this command in your terminal to download and install krew:

    
    
    (
      set -x; cd "$(mktemp -d)" &&
      curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
      tar zxvf krew.tar.gz &&
      KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" &&
      "$KREW" install krew
    )

    Add $HOME/.krew/bin directory to your PATH environment variable. To do this, update your .bashrc or .zshrc file and append the following line:

    export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

    and restart your shell.

    Verify running kubectl krew works.

    安装 krew, 运行

    kubectl krew install ingress-nginx

    安装插件然后运行

    kubectl ingress-nginx --help

  • 相关阅读:
    敏感信息脱敏实现
    SpringBoot集成Swagger2
    CSS三大特性
    background
    background-attachment
    background-position
    background-repeat
    background-image
    background-color
    CSS元素显示模式
  • 原文地址:https://www.cnblogs.com/Dev0ps/p/13568809.html
Copyright © 2020-2023  润新知