zoukankan      html  css  js  c++  java
  • K8s 日常操作

    1、获取所有Pods

    kubectl get pods --namespace=default

    2、获取所有Deployments

    kubectl get deployments --namespace=default

    3、获取所有Services

    kubectl get services --namespace=default

    4、查看POD日志

    kubectl describe pod <pod-name> --namespace=defualt

    5、让master也运行pod(默认master不运行pod)

    kubectl taint nodes --all node-role.kubernetes.io/master-

    6、动态扩容deployment

    kubectl scale deployment nginx-deployment --replicas 10

    7、更新image

    kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1

    8、获取ETCD、Scheduler、Controller-Manager组件状态 

    [root@node01 ~]# kubectl get componentstatus
    NAME                 STATUS    MESSAGE              ERROR
    scheduler            Healthy   ok                   
    controller-manager   Healthy   ok                   
    etcd-0               Healthy   {"health": "true"}   
    etcd-1               Healthy   {"health": "true"}   
    etcd-2               Healthy   {"health": "true"}   

    9、查看网络link详细属性

    ip -d link show

    10、进入POD内部

    kubectl exec -it redis-master-6b556f4c5f-7rddd /bin/sh
  • 相关阅读:
    连载日记
    自我介绍
    test0710 二分专题
    test0709 搜索专题
    test0705
    test0704
    [题解] [HNOI2015]落忆枫音
    test0606
    test0523
    备份
  • 原文地址:https://www.cnblogs.com/vincenshen/p/8878280.html
Copyright © 2011-2022 走看看