よく忘れてしまうので、Kubernetes のネームスペース関連をメモ代わりにまとめておきます。
ネームスペースの作成
# kubectl create namespace mongodb
ネームスペースの削除
# kubectl delete namespace mongodb
namespace "mongodb" deleted
ネームスペース一覧
# kubectl get ns
NAME STATUS AGE
default Active 23d
gpu-operator Active 21d
ingress-nginx Active 22d
kube-flannel Active 23d
kube-node-lease Active 23d
kube-public Active 23d
kube-system Active 23d
kubernetes-dashboard Active 23d
metallb-system Active 22d
micro-grafana Active 4h30m
microai Active 16d
mongodb Active 15d
ollama Active 21d
redis Active 16d
ネームスペースに属するリソース一覧取得
# kubectl get all -n microai -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/api-microai-jp-7f8f55849-4wr2c 1/1 Running 0 6d15h 10.0.8.68 worker-05 <none> <none>
pod/api-microai-jp-7f8f55849-rgpqw 1/1 Running 0 6d15h 10.0.9.72 worker-04 <none> <none>
pod/microai-jp-7bb4797768-6kdcw 1/1 Running 0 6h18m 10.0.8.92 worker-05 <none> <none>
pod/microai-jp-7bb4797768-748hc 1/1 Running 0 6h19m 10.0.9.98 worker-04 <none> <none>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/api-microai-jp-service ClusterIP 10.101.202.149 <none> 80/TCP 15d app=api.microai.jp
service/microai-jp-service ClusterIP 10.103.235.177 <none> 80/TCP 15d app=microai.jp
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/api-microai-jp 2/2 2 2 15d api-microai-jp ghcr.io/microaijp/api.microai.jp:latest app=api.microai.jp
deployment.apps/microai-jp 2/2 2 2 11d microai-jp ghcr.io/microaijp/microai.jp:latest app=microai.jp
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
replicaset.apps/api-microai-jp-5bb7cb949f 0 0 0 6d15h api-microai-jp ghcr.io/microaijp/api.microai.jp:latest app=api.microai.jp,pod-template-hash=5bb7cb949f
replicaset.apps/api-microai-jp-5c4596b9f5 0 0 0 9d api-microai-jp ghcr.io/microaijp/api.microai.jp:latest app=api.microai.jp,pod-template-hash=5c4596b9f5
: