飞天使-k8s知识点19-kubernetes实操4-资源调度 标签和选择器:Label与Selector的使用-版本回退

本文主要是介绍飞天使-k8s知识点19-kubernetes实操4-资源调度 标签和选择器:Label与Selector的使用-版本回退,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

      • 添加label
        • 资源调度 Deployment:创建与配置文件解析
        • rs pod deploy 的关联信息展示
        • Deployment:滚动更新
        • Deployment:回滚
          • 回退版本实际操作

添加label

[root@kubeadm-master1 test]# kubectl get pod
NAME                                 READY   STATUS      RESTARTS   AGE
client                               1/1     Running     0          49d
my-pod                               1/1     Running     0          9d
my-pod1                              0/1     Completed   6          83m
net-test1                            1/1     Running     136        56d
net-test2                            1/1     Running     14         56d
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d
[root@kubeadm-master1 test]# kubectl get po --show-labels
NAME                                 READY   STATUS      RESTARTS   AGE   LABELS
client                               1/1     Running     0          49d   run=client
my-pod                               1/1     Running     0          9d    test=1.0.0,type=app
my-pod1                              0/1     Completed   6          83m   test=1.0.0,type=app
net-test1                            1/1     Running     136        56d   run=net-test1
net-test2                            1/1     Running     14         56d   run=net-test2
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d   app=nginx,pod-template-hash=67dfd6c8f9
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d   app=tomcat,pod-template-hash=6c44f58b47
[root@kubeadm-master1 test]# kubectl label po my-pod author=xx1
pod/my-pod labeled
[root@kubeadm-master1 test]# kubectl get po --show-labels
NAME                                 READY   STATUS      RESTARTS   AGE   LABELS
client                               1/1     Running     0          49d   run=client
my-pod                               1/1     Running     0          9d    author=xx1,test=1.0.0,type=app
my-pod1                              0/1     Completed   6          83m   test=1.0.0,type=app
net-test1                            1/1     Running     136        56d   run=net-test1
net-test2                            1/1     Running     14         56d   run=net-test2
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d   app=nginx,pod-template-hash=67dfd6c8f9
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d   app=tomcat,pod-template-hash=6c44f58b47
[root@kubeadm-master1 test]# kubectl label po my-pod author=xxx1 --overwrite
pod/my-pod labeled
[root@kubeadm-master1 test]# kubectl get po --show-labels
NAME                                 READY   STATUS      RESTARTS   AGE   LABELS
client                               1/1     Running     0          49d   run=client
my-pod                               1/1     Running     0          9d    author=xxx1,test=1.0.0,type=app
my-pod1                              0/1     Completed   6          85m   test=1.0.0,type=app
net-test1                            1/1     Running     136        56d   run=net-test1
net-test2                            1/1     Running     14         56d   run=net-test2
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d   app=nginx,pod-template-hash=67dfd6c8f9
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d   app=tomcat,pod-template-hash=6c44f58b47
资源调度 Deployment:创建与配置文件解析

在这里插入图片描述

分别是有状态和无状态应用
创建deployment 
[root@kubeadm-master1 ~]# kubectl create deploy nginx-deploy --image=nginx:1.7.9
查看 replicaset
[root@kubeadm-master1 ~]# kubectl get replicaset
NAME                           DESIRED   CURRENT   READY   AGE
nginx-deploy-845964f5bf        1         1         1       2m34s查看pod
[root@kubeadm-master1 ~]# kubectl get po
NAME                                 READY   STATUS      RESTARTS   AGE
nginx-deploy-845964f5bf-2pvw4        1/1     Running     0          3m获取deployment的yaml 文件
[root@kubeadm-master1 ~]# kubectl get deploy nginx-deploy -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:annotations:deployment.kubernetes.io/revision: "1"creationTimestamp: "2024-02-16T02:25:18Z"generation: 1labels:app: nginx-deploymanagedFields:- apiVersion: apps/v1fieldsType: FieldsV1fieldsV1:f:metadata:f:labels:.: {}f:app: {}f:spec:f:progressDeadlineSeconds: {}f:replicas: {}f:revisionHistoryLimit: {}f:selector: {}f:strategy:f:rollingUpdate:.: {}f:maxSurge: {}f:maxUnavailable: {}f:type: {}f:template:f:metadata:f:labels:.: {}f:app: {}f:spec:f:containers:k:{"name":"nginx"}:.: {}f:image: {}f:imagePullPolicy: {}f:name: {}f:resources: {}f:terminationMessagePath: {}f:terminationMessagePolicy: {}f:dnsPolicy: {}f:restartPolicy: {}f:schedulerName: {}f:securityContext: {}f:terminationGracePeriodSeconds: {}manager: kubectl-createoperation: Updatetime: "2024-02-16T02:25:18Z"- apiVersion: apps/v1fieldsType: FieldsV1fieldsV1:f:metadata:f:annotations:.: {}f:deployment.kubernetes.io/revision: {}f:status:f:availableReplicas: {}f:conditions:.: {}k:{"type":"Available"}:.: {}f:lastTransitionTime: {}f:lastUpdateTime: {}f:message: {}f:reason: {}f:status: {}f:type: {}k:{"type":"Progressing"}:.: {}f:lastTransitionTime: {}f:lastUpdateTime: {}f:message: {}f:reason: {}f:status: {}f:type: {}f:observedGeneration: {}f:readyReplicas: {}f:replicas: {}f:updatedReplicas: {}manager: kube-controller-manageroperation: Updatetime: "2024-02-16T02:25:20Z"name: nginx-deploynamespace: defaultresourceVersion: "8890971"uid: 7951f67e-ad52-436a-8f25-5d8241fa06c6
spec:progressDeadlineSeconds: 600replicas: 1revisionHistoryLimit: 10selector:matchLabels:app: nginx-deploystrategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdatetemplate:metadata:creationTimestamp: nulllabels:app: nginx-deployspec:containers:- image: nginx:1.7.9imagePullPolicy: IfNotPresentname: nginxresources: {}terminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30
status:availableReplicas: 1conditions:- lastTransitionTime: "2024-02-16T02:25:20Z"lastUpdateTime: "2024-02-16T02:25:20Z"message: Deployment has minimum availability.reason: MinimumReplicasAvailablestatus: "True"type: Available- lastTransitionTime: "2024-02-16T02:25:18Z"lastUpdateTime: "2024-02-16T02:25:20Z"message: ReplicaSet "nginx-deploy-845964f5bf" has successfully progressed.reason: NewReplicaSetAvailablestatus: "True"type: ProgressingobservedGeneration: 1readyReplicas: 1replicas: 1updatedReplicas: 1

在这里插入图片描述

在这里插入图片描述

rs pod deploy 的关联信息展示
[root@kubeadm-master1 ~]# kubectl get po,rs,deploy --show-labels
NAME                                     READY   STATUS      RESTARTS   AGE   LABELS
pod/client                               1/1     Running     0          50d   run=client
pod/my-pod                               1/1     Running     0          9d    author=xxx1,test=1.0.0,type=app
pod/my-pod1                              0/1     Completed   6          19h   test=1.0.0,type=app
pod/net-test1                            1/1     Running     138        57d   run=net-test1
pod/net-test2                            1/1     Running     14         57d   run=net-test2
pod/nginx-deploy-845964f5bf-2pvw4        1/1     Running     0          10m   app=nginx-deploy,pod-template-hash=845964f5bf
pod/nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d   app=nginx,pod-template-hash=67dfd6c8f9
pod/tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d   app=tomcat,pod-template-hash=6c44f58b47NAME                                           DESIRED   CURRENT   READY   AGE   LABELS
replicaset.apps/nginx-deploy-845964f5bf        1         1         1       10m   app=nginx-deploy,pod-template-hash=845964f5bf
replicaset.apps/nginx-deployment-67dfd6c8f9    1         1         1       56d   app=nginx,pod-template-hash=67dfd6c8f9
replicaset.apps/tomcat-deployment-6c44f58b47   1         1         1       56d   app=tomcat,pod-template-hash=6c44f58b47NAME                                READY   UP-TO-DATE   AVAILABLE   AGE   LABELS
deployment.apps/nginx-deploy        1/1     1            1           10m   app=nginx-deploy
deployment.apps/nginx-deployment    1/1     1            1           56d   app=nginx
deployment.apps/tomcat-deployment   1/1     1            1           56d   app=tomcat
Deployment:滚动更新
修改镜像版本
kubectl edit deploy
image 选择升级为高版本改完之后运行这个命令看 deploy pod 的变化
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     1            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     1            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     2            3           20m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy  --show-labels
NAME                READY   UP-TO-DATE   AVAILABLE   AGE   LABELS
nginx-deploy        3/3     3            3           20m   app=nginx-deploy
nginx-deployment    1/1     1            1           56d   app=nginx
tomcat-deployment   1/1     1            1           56d   app=tomcat查看滚动更新的状态
[root@kubeadm-master1 ~]# kubectl rollout status deploy nginx-deploy
deployment "nginx-deploy" successfully rolled out修改nginx的镜像为1.7.9[root@kubeadm-master1 ~]# kubectl set image deployment/nginx-deploy nginx=nginx:1.7.9
deployment.apps/nginx-deploy image updated
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     3            3           24m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl get deploy
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
nginx-deploy        3/3     3            3           24m
nginx-deployment    1/1     1            1           56d
tomcat-deployment   1/1     1            1           56d
[root@kubeadm-master1 ~]# kubectl rollout status deploy nginx-deploy
deployment "nginx-deploy" successfully rolled out
[root@kubeadm-master1 ~]# kubectl describe deploy nginx-deploy
Name:                   nginx-deploy
Namespace:              default
CreationTimestamp:      Fri, 16 Feb 2024 10:25:18 +0800
Labels:                 app=nginx-deploy
Annotations:            deployment.kubernetes.io/revision: 3
Selector:               app=nginx-deploy
Replicas:               3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:Labels:  app=nginx-deployContainers:nginx:Image:        nginx:1.7.9Port:         <none>Host Port:    <none>Environment:  <none>Mounts:       <none>Volumes:        <none>
Conditions:Type           Status  Reason----           ------  ------Available      True    MinimumReplicasAvailableProgressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   nginx-deploy-845964f5bf (3/3 replicas created)
Events:Type    Reason             Age                From                   Message----    ------             ----               ----                   -------Normal  ScalingReplicaSet  8m58s              deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 3Normal  ScalingReplicaSet  5m6s               deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 1Normal  ScalingReplicaSet  4m56s              deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 2Normal  ScalingReplicaSet  4m56s              deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  4m47s              deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 3Normal  ScalingReplicaSet  4m47s              deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  4m45s              deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 0Normal  ScalingReplicaSet  39s (x2 over 25m)  deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  38s                deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  36s (x4 over 38s)  deployment-controller  (combined from similar events): Scaled down replica set nginx-deploy-968b78ccf to 0查看rs1 和 rs2 的更新状态,上一个变成0 ,新的变成3 
[root@kubeadm-master1 ~]# kubectl get rs --show-labels
NAME                           DESIRED   CURRENT   READY   AGE     LABELS
nginx-deploy-845964f5bf        3         3         3       27m     app=nginx-deploy,pod-template-hash=845964f5bf
nginx-deploy-968b78ccf         0         0         0       7m58s   app=nginx-deploy,pod-template-hash=968b78ccf
Deployment:回滚
[root@kubeadm-master1 ~]# kubectl set image deployment/nginx-deploy nginx=nginx:1.9.1
deployment.apps/nginx-deploy image updated
[root@kubeadm-master1 ~]# kubectl rollout status deployments nginx-deploy
deployment "nginx-deploy" successfully rolled out
[root@kubeadm-master1 ~]# kubectl get pod
NAME                                 READY   STATUS      RESTARTS   AGE
client                               1/1     Running     0          50d
my-pod                               1/1     Running     0          9d
my-pod1                              0/1     Completed   6          19h
net-test1                            1/1     Running     138        57d
net-test2                            1/1     Running     14         57d
nginx-deploy-968b78ccf-8lb9c         1/1     Running     0          16s
nginx-deploy-968b78ccf-d8mhr         1/1     Running     0          17s
nginx-deploy-968b78ccf-nqq4s         1/1     Running     0          19s
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running     1          56d
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running     1          56d
[root@kubeadm-master1 ~]# kubectl describe deploy nginx-deploy
Name:                   nginx-deploy
Namespace:              default
CreationTimestamp:      Fri, 16 Feb 2024 10:25:18 +0800
Labels:                 app=nginx-deploy
Annotations:            deployment.kubernetes.io/revision: 4
Selector:               app=nginx-deploy
Replicas:               3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:Labels:  app=nginx-deployContainers:nginx:Image:        nginx:1.9.1Port:         <none>Host Port:    <none>Environment:  <none>Mounts:       <none>Volumes:        <none>
Conditions:Type           Status  Reason----           ------  ------Available      True    MinimumReplicasAvailableProgressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   nginx-deploy-968b78ccf (3/3 replicas created)
Events:Type    Reason             Age                From                   Message----    ------             ----               ----                   -------Normal  ScalingReplicaSet  25m                deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 3Normal  ScalingReplicaSet  17m (x2 over 41m)  deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  17m                deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  17m (x4 over 17m)  deployment-controller  (combined from similar events): Scaled down replica set nginx-deploy-968b78ccf to 0Normal  ScalingReplicaSet  48s (x2 over 21m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 1Normal  ScalingReplicaSet  46s (x2 over 21m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  46s (x2 over 21m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 2Normal  ScalingReplicaSet  45s (x2 over 21m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  45s (x2 over 21m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 3Normal  ScalingReplicaSet  44s (x2 over 21m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 0查看历史版本
[root@kubeadm-master1 ~]# kubectl rollout history deployment/nginx-deploy
deployment.apps/nginx-deploy
REVISION  CHANGE-CAUSE
3         <none>
4         <none>如果修改时候 kubectl set image deployment/nginx-deploy nginx=nginx:1.7.9 --record 
上面的none 就会记录详细的信息查看历史版本详细信息
kubectl rollout history deployment/nginx-deploy --revision=3确认回退版本之后
kubectl rollout undo deployment/nginx-deploy --to-revision=2查看回退版本的状态
kubectl get deploy 
kubectl describe deploy 
回退版本实际操作
[root@kubeadm-master1 ~]# kubectl describe deploy nginx-deploy
Name:                   nginx-deploy
Namespace:              default
CreationTimestamp:      Fri, 16 Feb 2024 10:25:18 +0800
Labels:                 app=nginx-deploy
Annotations:            deployment.kubernetes.io/revision: 4
Selector:               app=nginx-deploy
Replicas:               3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:Labels:  app=nginx-deployContainers:nginx:Image:        nginx:1.9.1Port:         <none>Host Port:    <none>Environment:  <none>Mounts:       <none>Volumes:        <none>
Conditions:Type           Status  Reason----           ------  ------Available      True    MinimumReplicasAvailableProgressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   nginx-deploy-968b78ccf (3/3 replicas created)
Events:Type    Reason             Age                From                   Message----    ------             ----               ----                   -------Normal  ScalingReplicaSet  37m                deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 3Normal  ScalingReplicaSet  29m (x2 over 53m)  deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  29m                deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  29m (x4 over 29m)  deployment-controller  (combined from similar events): Scaled down replica set nginx-deploy-968b78ccf to 0Normal  ScalingReplicaSet  12m (x2 over 34m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 1Normal  ScalingReplicaSet  12m (x2 over 33m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  12m (x2 over 33m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 2Normal  ScalingReplicaSet  12m (x2 over 33m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  12m (x2 over 33m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 3Normal  ScalingReplicaSet  12m (x2 over 33m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 0
[root@kubeadm-master1 ~]# kubectl rollout history deployment/nginx-deploy --revision=4
deployment.apps/nginx-deploy with revision #4
Pod Template:Labels:	app=nginx-deploypod-template-hash=968b78ccfContainers:nginx:Image:	nginx:1.9.1Port:	<none>Host Port:	<none>Environment:	<none>Mounts:	<none>Volumes:	<none>[root@kubeadm-master1 ~]# kubectl rollout history deployment/nginx-deploy --revision=3
deployment.apps/nginx-deploy with revision #3
Pod Template:Labels:	app=nginx-deploypod-template-hash=845964f5bfContainers:nginx:Image:	nginx:1.7.9Port:	<none>Host Port:	<none>Environment:	<none>Mounts:	<none>Volumes:	<none>[root@kubeadm-master1 ~]# kubectl rollout undo deployment/nginx-deploy --to-revision=3
deployment.apps/nginx-deploy rolled back
[root@kubeadm-master1 ~]# kubectl describe deploy nginx-deploy
Name:                   nginx-deploy
Namespace:              default
CreationTimestamp:      Fri, 16 Feb 2024 10:25:18 +0800
Labels:                 app=nginx-deploy
Annotations:            deployment.kubernetes.io/revision: 5
Selector:               app=nginx-deploy
Replicas:               3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:Labels:  app=nginx-deployContainers:nginx:Image:        nginx:1.7.9Port:         <none>Host Port:    <none>Environment:  <none>Mounts:       <none>Volumes:        <none>
Conditions:Type           Status  Reason----           ------  ------Available      True    MinimumReplicasAvailableProgressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   nginx-deploy-845964f5bf (3/3 replicas created)
Events:Type    Reason             Age                From                   Message----    ------             ----               ----                   -------Normal  ScalingReplicaSet  30m (x4 over 30m)  deployment-controller  (combined from similar events): Scaled down replica set nginx-deploy-968b78ccf to 0Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 1Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 2Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled up replica set nginx-deploy-968b78ccf to 3Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  13m (x2 over 34m)  deployment-controller  Scaled down replica set nginx-deploy-845964f5bf to 0Normal  ScalingReplicaSet  10s (x3 over 54m)  deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 1Normal  ScalingReplicaSet  9s (x2 over 30m)   deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 2Normal  ScalingReplicaSet  9s                 deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 2Normal  ScalingReplicaSet  8s (x2 over 38m)   deployment-controller  Scaled up replica set nginx-deploy-845964f5bf to 3Normal  ScalingReplicaSet  8s                 deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 1Normal  ScalingReplicaSet  6s                 deployment-controller  Scaled down replica set nginx-deploy-968b78ccf to 0

这篇关于飞天使-k8s知识点19-kubernetes实操4-资源调度 标签和选择器:Label与Selector的使用-版本回退的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/714800

相关文章

如何使用celery进行异步处理和定时任务(django)

《如何使用celery进行异步处理和定时任务(django)》文章介绍了Celery的基本概念、安装方法、如何使用Celery进行异步任务处理以及如何设置定时任务,通过Celery,可以在Web应用中... 目录一、celery的作用二、安装celery三、使用celery 异步执行任务四、使用celery

使用Python绘制蛇年春节祝福艺术图

《使用Python绘制蛇年春节祝福艺术图》:本文主要介绍如何使用Python的Matplotlib库绘制一幅富有创意的“蛇年有福”艺术图,这幅图结合了数字,蛇形,花朵等装饰,需要的可以参考下... 目录1. 绘图的基本概念2. 准备工作3. 实现代码解析3.1 设置绘图画布3.2 绘制数字“2025”3.3

Jsoncpp的安装与使用方式

《Jsoncpp的安装与使用方式》JsonCpp是一个用于解析和生成JSON数据的C++库,它支持解析JSON文件或字符串到C++对象,以及将C++对象序列化回JSON格式,安装JsonCpp可以通过... 目录安装jsoncppJsoncpp的使用Value类构造函数检测保存的数据类型提取数据对json数

python使用watchdog实现文件资源监控

《python使用watchdog实现文件资源监控》watchdog支持跨平台文件资源监控,可以检测指定文件夹下文件及文件夹变动,下面我们来看看Python如何使用watchdog实现文件资源监控吧... python文件监控库watchdogs简介随着Python在各种应用领域中的广泛使用,其生态环境也

Python中构建终端应用界面利器Blessed模块的使用

《Python中构建终端应用界面利器Blessed模块的使用》Blessed库作为一个轻量级且功能强大的解决方案,开始在开发者中赢得口碑,今天,我们就一起来探索一下它是如何让终端UI开发变得轻松而高... 目录一、安装与配置:简单、快速、无障碍二、基本功能:从彩色文本到动态交互1. 显示基本内容2. 创建链

springboot整合 xxl-job及使用步骤

《springboot整合xxl-job及使用步骤》XXL-JOB是一个分布式任务调度平台,用于解决分布式系统中的任务调度和管理问题,文章详细介绍了XXL-JOB的架构,包括调度中心、执行器和Web... 目录一、xxl-job是什么二、使用步骤1. 下载并运行管理端代码2. 访问管理页面,确认是否启动成功

使用Nginx来共享文件的详细教程

《使用Nginx来共享文件的详细教程》有时我们想共享电脑上的某些文件,一个比较方便的做法是,开一个HTTP服务,指向文件所在的目录,这次我们用nginx来实现这个需求,本文将通过代码示例一步步教你使用... 在本教程中,我们将向您展示如何使用开源 Web 服务器 Nginx 设置文件共享服务器步骤 0 —

Java中switch-case结构的使用方法举例详解

《Java中switch-case结构的使用方法举例详解》:本文主要介绍Java中switch-case结构使用的相关资料,switch-case结构是Java中处理多个分支条件的一种有效方式,它... 目录前言一、switch-case结构的基本语法二、使用示例三、注意事项四、总结前言对于Java初学者

Golang使用minio替代文件系统的实战教程

《Golang使用minio替代文件系统的实战教程》本文讨论项目开发中直接文件系统的限制或不足,接着介绍Minio对象存储的优势,同时给出Golang的实际示例代码,包括初始化客户端、读取minio对... 目录文件系统 vs Minio文件系统不足:对象存储:miniogolang连接Minio配置Min

使用Python绘制可爱的招财猫

《使用Python绘制可爱的招财猫》招财猫,也被称为“幸运猫”,是一种象征财富和好运的吉祥物,经常出现在亚洲文化的商店、餐厅和家庭中,今天,我将带你用Python和matplotlib库从零开始绘制一... 目录1. 为什么选择用 python 绘制?2. 绘图的基本概念3. 实现代码解析3.1 设置绘图画