Can I set a default namespace in Kubernetes?

前端 未结 2 1769
耶瑟儿~
耶瑟儿~ 2020-12-29 22:34

Can I set the default namespace? That is:

$ kubectl get pods -n NAMESPACE

It saves me having to type it in each time especially when I\'m o

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 22:56

    You can also use a temporary linux alias:

    alias k='kubectl -n kube-system '
    

    Then use it like

    k get pods
    

    That's it ;)

提交回复
热议问题