Docker Kubernetes 查詢字段說明
阿新 • • 發佈:2018-11-26
Kubernete bat span 記錄 cto contain best ready hash
Docker Kubernetes 查詢字段說明
- # 打印受支持的API版本
- kubectl api-versions
# 擴展 apiextensions.k8s.io/v1beta1 # 註冊 apiregistration.k8s.io/v1beta1 # 創建app apps/v1beta1 apps/v1beta2 # 認證 authentication.k8s.io/v1 authentication.k8s.io/v1beta1 # 授權 authorization.k8s.io/v1 authorization.k8s.io/v1beta1 # 彈性伸縮 autoscaling/v1 autoscaling/v2beta1 # 批量 batch/v1 batch/v1beta1 certificates.k8s.io/v1beta1 # 證書 extensions/v1beta1 # 網絡 networking.k8s.io/v1 # 策略 policy/v1beta1 # 控制 rbac.authorization.k8s.io/v1 rbac.authorization.k8s.io/v1beta1 # 存儲 storage.k8s.io/v1 storage.k8s.io/v1beta1 v1
- # 查看service 詳細信息
- kubectl describe service 資源名
# 服務名稱 Name: nginx# 命名空間 Namespace: default # 標簽 Labels: run=nginx Annotations: <none> # 標簽 Selector: run=nginx # 網絡代理類型 Type: ClusterIP # 集群唯一IP IP: 10.10.10.17 # Service端口 Port: <unset> 88/TCP # 容器端口 TargetPort: 80/TCP # 代理容器IPEndpoints: 172.17.1.2:80,172.17.2.2:80,172.17.2.3:80
註:kubernetes默認負載均衡模式為ClusterIP。
註:標簽主要是識別資源的描述符號。
註:顯示集群信息 kubectl cluster-info 顯示運行API情況。
- # 查看容器詳細信息
- kubectl describe pod 容器名
# 容器名稱 Name: hello-world-cc85d4fb6-9lnt9 # 命名空間 Namespace: default # 分配節點IP Node: 192.168.1.77/192.168.1.77 # 啟動時間 Start Time: Thu, 15 Nov 2018 11:59:33 +0800 # 標簽名稱,系統生成標簽 Labels: app=example pod-template-hash=774180962 # 註釋 Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"hello-world-cc85d4fb6","uid":"dc7d20d1-e88a-11e8-91e0-000c29e1b1... # 狀態 Status: Running # 分配容器IP IP: 172.17.1.3 # 由RS進行管理 Created By: ReplicaSet/hello-world-cc85d4fb6 Controlled By: ReplicaSet/hello-world-cc85d4fb6 # 容器信息 Containers: hello-world: # 容器ID Container ID: docker://b05c00a8a840e8cf0ee4499ee9244282d500acf28ede13c76ff62c62baaa2057 # 鏡像版本號 Image: nginx:1.10 Image ID: docker-pullable://nginx@sha256:6202beb06ea61f44179e02ca965e8e13b961d12640101fca213efbfd145d7575 # 開放端口 Port: 80/TCP # 運行狀態 State: Running Started: Thu, 15 Nov 2018 12:00:04 +0800 Ready: True Restart Count: 0 Environment: <none> Mounts: <none> # 容器信息 Conditions: Type Status Initialized True Ready True PodScheduled True Volumes: <none> QoS Class: BestEffort Node-Selectors: <none> Tolerations: <none> Events: <none>
- # 顯示有關Deployments詳細信息
- kubectl describe deployments 資源名
# 服務名稱 Name: hello-world # 命名空間名稱,一個命名空間相當與一個虛擬集群 Namespace: default CreationTimestamp: Thu, 15 Nov 2018 11:59:33 +0800 # 加入一個標簽 Labels: app=example # 註釋 Annotations: deployment.kubernetes.io/revision=1 # 標簽選擇器 Selector: app=example # 副本數 Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 1 max unavailable, 1 max surge # pod模板 Pod Template: Labels: app=example Containers: hello-world: # 容器鏡像版本 Image: nginx:1.10 # 容器端口 Port: 80/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ # 執行時間記錄 Available True MinimumReplicasAvailable OldReplicaSets: <none> NewReplicaSet: hello-world-cc85d4fb6 (3/3 replicas created) Events: <none>
Docker Kubernetes 查詢字段說明