“Hpa”的版本间的差异
跳到导航
跳到搜索
第1行: | 第1行: | ||
== | == | ||
<pre> | <pre> | ||
+ | |||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | name: mydep | ||
+ | |||
+ | spec: | ||
+ | replicas: 2 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: nginx | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | spec: | ||
+ | containers: | ||
+ | - name: nginx | ||
+ | image: nginx:latest | ||
+ | imagePullPolicy: IfNotPresent | ||
+ | resources: | ||
+ | requests: | ||
+ | cpu: 50m | ||
+ | |||
+ | |||
root@ubuntu-200470-1:~/hpa# kubectl get pod | grep mydep | root@ubuntu-200470-1:~/hpa# kubectl get pod | grep mydep |
2023年10月29日 (日) 14:21的版本
==
apiVersion: apps/v1 kind: Deployment metadata: name: mydep spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:latest imagePullPolicy: IfNotPresent resources: requests: cpu: 50m root@ubuntu-200470-1:~/hpa# kubectl get pod | grep mydep mydep-759989964c-8gvxv 1/1 Running 0 6m34s mydep-759989964c-8kxnw 1/1 Running 0 6m19s mydep-759989964c-9rbsc 1/1 Running 0 6m34s mydep-759989964c-f8ztl 1/1 Running 0 6m49s mydep-759989964c-tdf5l 1/1 Running 0 20m 停止压力测试后 过一阵 root@ubuntu-200470-1:~/hpa# kubectl get pod | grep mydep mydep-759989964c-tdf5l 1/1 Running 0 41m root@ubuntu-200470-1:~/hpa#