在 openshift 4.x 中,您有一个 APIproject
似乎与namespace
创建项目时创建的命名空间完全相似,反之亦然。我知道namespace
这是 Kubernetes 中的标准对象,而项目是特定于 Openshift 的。那么project
带来了什么?
# list projects
oc get projects
NAME DISPLAY NAME STATUS
default Active
kube-node-lease Active
kube-public Active
kube-system Active
local-storage Active
openshift Active
openshift-apiserver Active
# list namespaces
$ oc get ns
NAME STATUS AGE
default Active 17d
kube-node-lease Active 17d
kube-public Active 17d
kube-system Active 17d
local-storage Active 16d
openshift Active 17d
openshift-apiserver Active 17d
openshift-apiserver-operator Active 17d
该列表是相同的,除了不同的列
oc get project foo
Error from server (NotFound): namespaces "foo" not found
oc get ns foo
Error from server (NotFound): namespaces "foo" not found
15:30 $ oc new-project foo
Now using project "foo" on server "https://api.goo.tadadidou.bo:6443".
...
$ oc get project foo
NAME DISPLAY NAME STATUS
foo Active
$ oc get ns foo
NAME STATUS AGE
foo Active 70s
甚至 yaml 输出也是相似的,除了字段的值Kind:
是Project
or Namespace
。