Kubernetes常用命令

    <div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post">
                <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-e2445db1a8.css">
                    <div class="htmledit_views">
            <p>查看kubernetes管理的pods</p>

[root@centos-master kubeguide]# kubectl get pods

NAME                 READY     STATUS    RESTARTS   AGE

redis-master-u3824   1/1       Running   0          15m

 

查看kubernetes管理的nodes

[root@centos-master kubeguide]# kubectl get nodes

NAME            LABELS                                 STATUS    AGE

centos-master   kubernetes.io/hostname=centos-master   Ready     3d

centos-minion   kubernetes.io/hostname=centos-minion   Ready     3d

 

查看Replication Controller

[root@centos-master kubeguide]# kubectl get rc

CONTROLLER     CONTAINER(S)   IMAGE(S)                 SELECTOR            REPLICAS   AGE

redis-master   master         kubeguide/redis-master   name=redis-master   1          1h

 

删除资源

[root@centos-master kubeguide]# kubectl stop -f redis-master-controller.yaml

 

查看Service状态

[root@centos-master kubeguide]# kubectl describe service frontend
Name: frontend
Namespace: default
Labels: name=frontend
Selector: name=frontend
Type: NodePort
IP: 10.10.55.133
Port: <unnamed> 80/TCP
NodePort: <unnamed> 30001/TCP
Endpoints: 172.17.0.10:80,172.17.0.7:80,172.17.0.8:80
Session Affinity: None

No events.

 

[root@centos-master kubeguide]# kubectl describe pods redis-master
Name: redis-master-b7u7l
Namespace: default
Image(s): kubeguide/redis-master
Node: centos-minion/
Start Time: Tue, 23 Feb 2016 14:49:35 +0800
Labels: name=redis-master
Status: Pending
Reason:
Message:
IP:
Replication Controllers: redis-master (1/1 replicas created)
Containers:
  master:
    Container ID:
    Image: kubeguide/redis-master
    Image ID:
    QoS Tier:
      memory: BestEffort
      cpu: BestEffort
    State: Waiting
    Ready: False
    Restart Count: 0
    Environment Variables:
No volumes.
Events:
  FirstSeen LastSeen Count From SubobjectPath Reason Message
  ───────── ──────── ───── ──── ───────────── ────── ───────
  38m 38m 1 {kubelet centos-minion} implicitly required container POD Pulled Successfully pulled image “registry.access.redhat.com/rhel7/pod-infrastructure:latest
  38m 38m 1 {kubelet centos-minion} implicitly required container POD Created Created with docker id 3f6c9cdd351a
  38m 38m 1 {kubelet centos-minion} implicitly required container POD Started Started with docker id 3f6c9cdd351a
  38m 38m 1 {kubelet centos-minion} spec.containers{master} Pulling pulling image “kubeguide/redis-master”
  59s 59s 1 {kubelet centos-minion} implicitly required container POD Pulled Container image “registry.access.redhat.com/rhel7/pod-infrastructure:latest” already present on machine
  54s 54s 1 {kubelet centos-minion} implicitly required container POD Created Created with docker id 83c6847b9cd7
  53s 53s 1 {kubelet centos-minion} implicitly required container POD Started Started with docker id 83c6847b9cd7

  53s 53s 1 {kubelet centos-minion} spec.containers{master} Pulling pulling image “kubeguide/redis-master”

 

查看etcd中的数据

etcdctl –endpoint http://10.10.3.184:2379 ls /registry

 

重新设置pod副本数

kubectl scale –replicas=4 replicationcontrollers frontend 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值