• Kubernetes常用命令


    1,启动Kubernetes命令
    systemctl start etcd
    systemctl start flanneld(可选)
    systemctl start docker
    systemctl start kube-apiserver 或 kube-apiserver --insecure-bind-address=0.0.0.0 --insecure-port=8080 --etcd_servers=http://127.0.0.1:2379 --service-cluster-ip-range='127.0.0.1/24' &
    kube-apiserver配置文件/etc/kubernetes/apiserver
    systemctl start kube-controller-manager
    systemctl start kube-scheduler
    systemctl start kubelet
    systemctl start kube-proxy
    systemctl daemon-reload
    日志目录/var/log/kubernetes
     
    2,创建和查看ReplicationController
    kubectl create -f [redis-master-controller.yaml]
    kubectl get rc
    kubectl get pods
     
    3,创建和查看Service
    kubectl create -f [redis-master-servcie.yaml]
    kubectl get services
     
    4,一键动态缩放Pod
    kubectl scale rc [redis-slave] --replicas=3
     
    5,查看所有端点(endpoints)
    kubectl get endpoints
     
    6,设置etcd
    etcdctl set /atomic.io/network '{ "Network": "172.17.0.0/16" }'
     
    7,删除操作
    kubectl delete -f 文件名
    kubectl delete pods <podname> --grace-period=0 --force 强制删除
     
    8,修改资源配置
    kubectl edit pod <podname> 
    kubectl get pod <podname> -o yaml >> /tmp/cronm-tmp.yaml
    kubectl replace -f /tmp/nginx-tmp.yaml   

    9,查看pod日志
    kubectl gets <podname>
    kubectl logs <pod_name>
    kubectl logs <pod_name> -c <container_name>
    docker logs  <container_id>
     
    10,查看Kubernetes系统日志
    systemctl status kube-controller-manager -l
    journalctl -u kube-controller-manage
  • 相关阅读:
    Directx 3D编程实例:多个3D球的综合Directx实例
    利用组策略禁用Oultook 各个版本的缓存模式!
    node-mongo-native1.3.19连接mongo的最优方法
    BT5之网络配置
    BT5之配置笔记
    Linux常用命令大全
    Linux下的基本网络配置
    SQLMAP系列教程
    重燃你的PHP安全分析之火
    Metasploit渗透测试魔鬼训练营
  • 原文地址:https://www.cnblogs.com/birdstudio/p/8378491.html
Copyright © 2020-2023  润新知