zoukankan      html  css  js  c++  java
  • 【k8s】rc-replicas

    环境

    1. kubernetes 1.20.4
    2. Spring Boot 2.5.0-M3

    目标

    replicas 字段可以控制启动的副本数,如果不写,默认为 1。

    示例

    rc.yaml

    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: spring-k8s
    spec:
      replicas: 10
      template:
        metadata:
          labels:
            app: spring-k8s
        spec:
          containers:
            - name: spring-k8s
              image: jiangbo920827/spring-k8s:liveness
              ports:
                - containerPort: 8080
    

    查看

    [root@master manifests]# kubectl get pod -o wide
    NAME               READY   STATUS    RESTARTS   AGE   IP             NODE    NOMINATED NODE   READINESS GATES
    spring-k8s-22xpv   1/1     Running   0          41s   10.244.1.226   node1   <none>           <none>
    spring-k8s-26c6j   1/1     Running   0          42s   10.244.2.203   node2   <none>           <none>
    spring-k8s-8l5wj   1/1     Running   0          41s   10.244.2.205   node2   <none>           <none>
    spring-k8s-brxmf   1/1     Running   0          42s   10.244.1.224   node1   <none>           <none>
    spring-k8s-h5p5z   1/1     Running   0          41s   10.244.1.227   node1   <none>           <none>
    spring-k8s-nmbmg   1/1     Running   0          41s   10.244.1.228   node1   <none>           <none>
    spring-k8s-phwj7   1/1     Running   0          41s   10.244.2.206   node2   <none>           <none>
    spring-k8s-r68h5   1/1     Running   0          41s   10.244.1.225   node1   <none>           <none>
    spring-k8s-vfcv5   1/1     Running   0          41s   10.244.2.207   node2   <none>           <none>
    spring-k8s-wjx2m   1/1     Running   0          41s   10.244.2.204   node2   <none>           <none>
    

    总结

    replicas 可以设置启动的副本数。

    附录

  • 相关阅读:
    Mybatis-plugin插件的使用
    SpringBoot整合mybatis-pagehelper实现分页
    springboot打war包
    keepalived1.4.0安装启动卸载
    六、nginx 搭建高可用集群
    五、nginx的动静分离
    四、nginx的负载均衡
    linux中mysql忘记root密码如何登陆
    十分钟到你了解OpenStack--nova组件
    docker 中 add 和 copy 的区别
  • 原文地址:https://www.cnblogs.com/jiangbo44/p/14608231.html
Copyright © 2011-2022 走看看