命令kubectl get ns或者kubectl get namespaces 案例:
[root@123 ~]# kubectl get namespaces NAME STATUS AGE default Active 3h40m kube-node-lease Active 3h40m kube-public Active 3h40m kube-system Active 3h40m
#使用yaml创建名称空间 [root@123 ~]# kubectl create -f test-namespace.yaml test-ns created [root@123 ~]# kubectl get ns NAME STATUS AGE default Active 3h45m kube-node-lease Active 3h45m kube-public Active 3h45m kube-system Active 3h45m test-ns Active 18s# 使用命令创建名称空间 [root@123 ~]# kubectl create namespace custom-namespace custom-namespace created [root@123 ~]# kubectl get ns NAME STATUS AGE custom-namespace Active 11s default Active 3h49m kube-node-lease Active 3h49m kube-public Active 3h49m kube-system Active 3h49m test-ns Active 4m1s [root@123 ~]# kubectl describe ns custom-namespace Name: custom-namespace Labels: kubernetes.io/metadata.name=custom-namespace Annotations: Status: Active No resource quota. No LimitRange resource.
注意:命名空间名称不允许包含点(.)
删除namespace
命令:kubectl delete ns $namespace 案例:
[root@123 ~]# kubectl get ns NAME STATUS AGE custom-namespace Active 11s default Active 3h49m kube-node-lease Active 3h49m kube-public Active 3h49m kube-system Active 3h49m test-ns Active 4m1s[root@123 ~]# kubectl delete ns custom-namespacenamespace"custom-namespace" deleted[root@123 ~]# kubectl get ns NAME STATUS AGE default Active 3h55m kube-node-lease Active 3h55m kube-public Active 3h55m kube-system Active 3h55m test-ns Active 10m
本文深入探讨了ASP.NET Web API与RESTful架构的设计与实现。ASP.NET Web API 是一个强大的框架,能够简化HTTP服务的开发,使其能够广泛支持各种客户端设备。通过详细分析其核心原理和最佳实践,本文为开发者提供了构建高效、可扩展且易于维护的Web服务的指导。此外,还讨论了如何利用RESTful原则优化API设计,确保系统的灵活性和互操作性。 ...
[详细]