• 【k8s】deploy-metadata


    环境

    1. kubernetes 1.20.4
    2. Spring Boot 2.5.0-M3

    目标

    查看 Deployment 中的一些字段。

    示例

    Deployment.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: busybox
    spec:
      selector:
        matchLabels:
          app: busybox
      replicas: 4
      template:
        metadata:
          labels:
            app: busybox
        spec:
          terminationGracePeriodSeconds: 5
          containers:
            - name: busybox
              image: busybox:1.30.0
              command: ["/bin/sh", "-c", "sleep 3600"]
    

    查看

    [root@master docker]# kubectl describe deployments.apps busybox
    Name:                   busybox
    Namespace:              default
    CreationTimestamp:      Tue, 30 Mar 2021 21:41:46 +0800
    Labels:                 <none>
    Annotations:            deployment.kubernetes.io/revision: 1
    Selector:               app=busybox
    Replicas:               4 desired | 4 updated | 4 total | 0 available | 4 unavailable
    StrategyType:           RollingUpdate
    MinReadySeconds:        0
    RollingUpdateStrategy:  25% max unavailable, 25% max surge
    Pod Template:
      Labels:  app=busybox
      Containers:
       busybox:
        Image:      busybox:1.30.0
        Port:       <none>
        Host Port:  <none>
        Command:
          /bin/sh
          -c
          sleep 3600
        Environment:  <none>
        Mounts:       <none>
      Volumes:        <none>
    Conditions:
      Type           Status  Reason
      ----           ------  ------
      Available      False   MinimumReplicasUnavailable
      Progressing    True    ReplicaSetUpdated
    OldReplicaSets:  <none>
    NewReplicaSet:   busybox-6bd65c67cf (4/4 replicas created)
    Events:
      Type    Reason             Age   From                   Message
      ----    ------             ----  ----                   -------
      Normal  ScalingReplicaSet  3s    deployment-controller  Scaled up replica set busybox-6bd65c67cf to 4
    

    Name,Selector 等字段都已经很熟悉了;Replicas 字段和之前的有点不一样,加入了状态。
    升级相关的字段之后学习;Pod Template 字段里的都学习过;Conditions 后面学习。

    总结

    查看 Deployment 中的一些字段。

    附录

  • 相关阅读:
    sizeof运算符、虚函数、虚继承考点(待修改)
    sizeof运算符、字节对齐考点(面宝P50)
    浮点数的存储、类型转换知识点(面宝P34)
    赋值语句C++(面宝P29)
    求格子中的最短路径条数问题
    求两个数的最大公约数和最小公倍数Java(cvte考题)
    快速排序c代码
    希尔排序java代码
    快速排序java代码
    归并排序java代码
  • 原文地址:https://www.cnblogs.com/jiangbo44/p/14608454.html
Copyright © 2020-2023  润新知