kubernetes 如何设置KUBIE_KUBECONFIG?

vtwuwzda  于 2023-02-15  发布在  Kubernetes
关注(0)|答案(1)|浏览(131)

我已经安装了kubie,并一直在使用它来成功地管理我的多集群配置。
不过最近我注意到我默认的KUBECONFIGKUBIE_KUBECONFIG路径发生了变化,现在当我尝试下载新的自动驾驶集群配置时,它就消失了。

KUBECONFIG=/var/folders/rb/2t5drg9n0f3g_p3y7rnknf_w0000gn/T/kubie-configpAMbHS.yaml
KUBIE_KUBECONFIG=/var/folders/rb/2t5drg9n0f3g_p3y7rnknf_w0000gn/T/kubie-configpAMbHS.yaml

我想将它们改回:$HOME/.kube/config.
我该怎么做呢?

    • 注**:kubie.yaml中没有用于执行此操作的设置。
2izufjch

2izufjch1#

我也遇到了同样的问题。我按照README.md-部分设置-https://github.com/sbstp/kubie/blob/master/README.md#settings中的说明操作,现在echo $KUBECONFIG显示了正确的路径。

# yaml
# Force kubie to use a particular shell, if unset detect shell currently in use.
# Possible values: bash, dash, fish, xonsh, zsh
# Default: unset
shell: bash

# Configure where to look for kubernetes config files.
configs:

    # Include these globs.
    # Default: values listed below.
    include:
        - ~/.kube/config
        - ~/.kube/*.yml
        - ~/.kube/*.yaml
        - ~/.kube/configs/*.yml
        - ~/.kube/configs/*.yaml
        - ~/.kube/kubie/*.yml
        - ~/.kube/kubie/*.yaml

    # Exclude these globs.
    # Default: values listed below.
    # Note: kubie's own config file is always excluded.
    exclude:
        - ~/.kube/kubie.yaml

# Prompt settings.
prompt:
    # Disable kubie's custom prompt inside of a kubie shell. This is useful
    # when you already have a prompt displaying kubernetes information.
    # Default: false
    disable: true

    # When using recursive contexts, show depth when larger than 1.
    # Default: true
    show_depth: true

    # When using zsh, show context and namespace on the right-hand side using RPS1.
    # Default: false
    zsh_use_rps1: false

    # When using fish, show context and namespace on the right-hand side.
    # Default: false
    fish_use_rprompt: false

    # When using xonsh, show context and namespace on the right-hand side.
    # Default: false
    xonsh_use_right_prompt: false

# Behavior
behavior:
    # Make sure the namespace exists with `kubectl get namespaces` when switching
    # namespaces. If you do not have the right to list namespaces, disable this.
    # Default: true
    validate_namespaces: true

    # Enable or disable the printing of the 'CONTEXT => ...' headers when running
    # `kubie exec`.
    # Valid values:
    #   auto:   Prints context headers only if stdout is a TTY. Piping/redirecting
    #           kubie output will auto-disable context headers.
    #   always: Always prints context headers, even if stdout is not a TTY.
    #   never:  Never prints context headers.
    # Default: auto
    print_context_in_exec: auto

相关问题