• k8s笔记


    Minikube

    - minikube start -p k8svm
    - minikube stop k8svm
    - minikube ssh -p k8svm

    可用的镜像仓库

    - mirrorgooglecontainers
    - registry.cn-hangzhou.aliyuncs.com/google_containers  

    kubectl

    - kubectl delete --all pods --namespace=default
    

    kubeadm

    # 安装单节点集群
    
    systemctl stop firewalld
    systemctl disable firewalld
    iptables -F && sudo iptables -X && sudo iptables -F -t nat && sudo iptables -X -t nat
    iptables -P FORWARD ACCEPT
    swapoff -a
    sed -i '/ swap / s/^(.*)$/#1/g' /etc/fstab
    echo "SELINUX=disabled" > /etc/selinux/config
    
    apt-get update && apt-get install -y apt-transport-https curl
    curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
    cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
    deb https://apt.kubernetes.io/ kubernetes-xenial main
    EOF
    apt-get update
    apt-get install -y kubelet kubeadm kubectl
    apt-mark hold kubelet kubeadm kubectl
    
    kubeadm init --image-repository registry.cn-hangzhou.aliyuncs.com/google_containers --ignore-preflight-errors=all
    

    清除正在Terminating的资源

    NAMESPACE=rook-ceph
    kubectl proxy &
    kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json
    curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
    

    Custom Metrics

    curl http://localhost:8001/apis/custom.metrics.k8s.io/v1beta1/namespaces/monitoring/pods/*/mmp_per_second
    kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/|jq .
    curl https://etcd-k8s.kube-system.svc/metrics -k --cert /var/lib/minikube/certs/etcd/ca.crt --key /var/lib/minikube/certs/etcd/ca.key
    

      

    有志者,事竟成!
  • 相关阅读:
    rosservice call ERROR:Unable to load type ... Have you typed 'make'
    查看ubuntu版本号
    VirtualBox虚拟机 host/guest 拷贝粘贴,共享剪贴板,安装guest additions
    traffic_light_bag_file 数据集 下载链接
    ubuntu linux double tab
    ubuntu linux查看cpu信息
    ubuntu linux查看硬盘使用量
    ubuntu查看nvidia显卡状态
    ibus
    windows7 屏幕亮图胡乱变化
  • 原文地址:https://www.cnblogs.com/styier/p/11224306.html
Copyright © 2020-2023  润新知