k8s note

  • kubectl apply -f test.yml
  • K8S is not allowed to load pods in master by default 
    • Error:
      Warning  FailedScheduling   default-scheduler  0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
    • Solu:
      kubectl taint nodes --all node-role.kubernetes.io/master-
  • [root@t:/k8s]# kubectl get pods
    NAME                     READY   STATUS    RESTARTS   AGE
    nginx-7fb7fd49b4-t8rmm   1/1     Running   0          26m
    
    [root@t:/k8s]# kubectl get deploy nginx -o wide
    NAME    READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES         SELECTOR
    nginx   1/1     1            1           26m   nginx        nginx:alpine   app=nginx
    
    [root@t:/k8s]# kubectl get pod nginx-7fb7fd49b4-t8rmm  -o wide
    NAME                     READY   STATUS    RESTARTS   AGE   IP           NODE              NOMINATED NODE   READINESS GATES
    nginx-7fb7fd49b4-t8rmm   1/1     Running   0          26m   172.16.0.6   t   <none>           <none>
    
    
  • kubectl exec -it nginx-7fb7fd49b4-t8rmm   -- /bin/sh
  • [root@t:/k8s]# kubectl get service nginx-service -o wide
    NAME            TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE   SELECTOR
    nginx-service   NodePort   10.97.61.67   <none>        80:8080/TCP    31s   app=nginx
    
  • kubectl get [deploy|pod|service] [container name] --output=yaml
    
    kubectl describe [deploy|pod|service] [container name]
  •    According to the solution above, I want to create a multi containers pod:  one for binary dll and the other used for runtime, but the k8s pod status will be NotReady if any container exit:
    • the root process stopped, the docker container stopped
    • the root process you start in container instead of [/sbin/init] : pid 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值