请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

deployment创建报错: MinimumReplicasUnavailable

老师,你好,执行这个命令创建失败,麻烦您看下。

[root@master kubeimooc]# kubectl apply -f deployment.yaml 
deployment.apps/kubeimooc created
[root@master kubeimooc]# kubectl get pod -n kubeimooc-system
No resources found in kubeimooc-system namespace.

[root@master kubeimooc]# kubectl get deployment -A
NAMESPACE          NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
kube-system        coredns                           2/2     2            2           10d
kube-system        nfs-subdir-external-provisioner   1/1     1            1           2d23h
kubeimooc-system   kubeimooc                         0/1     0            0           4m35s
metallb-system     metallb-controller                1/1     1            1           2d22h
[root@master kubeimooc]# kubectl describe deployment -n kubeimooc-system
Name:                   kubeimooc
Namespace:              kubeimooc-system
CreationTimestamp:      Thu, 12 Oct 2023 19:55:58 +0800
Labels:                 app=kubeimooc
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=kubeimooc
Replicas:               1 desired | 0 updated | 0 total | 0 available | 1 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app=kubeimooc
  Service Account:  kubeimooc-admin
  Containers:
   server:
    Image:        harbor.kubeimooc.com/kubeimooc/kubeimooc:v1.5
    Port:         8082/TCP
    Host Port:    0/TCP
    Environment:  <none>
    Mounts:       <none>
   web:
    Image:      harbor.kubeimooc.com/kubeimooc/kubeimooc-web:v1.0
    Port:       80/TCP
    Host Port:  0/TCP
    Environment:
      BACKEND_HOST:  http://127.0.0.1:8082/
    Mounts:          <none>
  Volumes:           <none>
Conditions:
  Type             Status  Reason
  ----             ------  ------
  Progressing      True    NewReplicaSetCreated
  Available        False   MinimumReplicasUnavailable
  ReplicaFailure   True    FailedCreate
OldReplicaSets:    <none>
NewReplicaSet:     kubeimooc-5f6f8c7f44 (0/1 replicas created)
Events:
  Type    Reason             Age    From                   Message
  ----    ------             ----   ----                   -------
  Normal  ScalingReplicaSet  5m19s  deployment-controller  Scaled up replica set kubeimooc-5f6f8c7f44 to 1
[root@master kubeimooc]# kubectl describe deployment -n kubeimooc-system
Name:                   kubeimooc
Namespace:              kubeimooc-system
CreationTimestamp:      Thu, 12 Oct 2023 19:55:58 +0800
Labels:                 app=kubeimooc
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=kubeimooc
Replicas:               1 desired | 0 updated | 0 total | 0 available | 1 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app=kubeimooc
  Service Account:  kubeimooc-admin
  Containers:
   server:
    Image:        harbor.kubeimooc.com/kubeimooc/kubeimooc:v1.5
    Port:         8082/TCP
    Host Port:    0/TCP
    Environment:  <none>
    Mounts:       <none>
   web:
    Image:      harbor.kubeimooc.com/kubeimooc/kubeimooc-web:v1.0
    Port:       80/TCP
    Host Port:  0/TCP
    Environment:
      BACKEND_HOST:  http://127.0.0.1:8082/
    Mounts:          <none>
  Volumes:           <none>
Conditions:
  Type             Status  Reason
  ----             ------  ------
  Progressing      True    NewReplicaSetCreated
  Available        False   MinimumReplicasUnavailable
  ReplicaFailure   True    FailedCreate
OldReplicaSets:    <none>
NewReplicaSet:     kubeimooc-5f6f8c7f44 (0/1 replicas created)
Events:
  Type    Reason             Age    From                   Message
  ----    ------             ----   ----                   -------
  Normal  ScalingReplicaSet  5m26s  deployment-controller  Scaled up replica set kubeimooc-5f6f8c7f44 to 1
[root@master kubeimooc]# kubectl get deployment -A
NAMESPACE          NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
kube-system        coredns                           2/2     2            2           10d
kube-system        nfs-subdir-external-provisioner   1/1     1            1           2d23h
kubeimooc-system   kubeimooc                         0/1     0            0           5m32s
metallb-system     metallb-controller                1/1     1            1           2d22h
[root@master kubeimooc]# kubectl get deployment -A
NAMESPACE          NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
kube-system        coredns                           2/2     2            2           10d
kube-system        nfs-subdir-external-provisioner   1/1     1            1           2d23h
kubeimooc-system   kubeimooc                         0/1     0            0           8m32s
metallb-system     metallb-controller                1/1     1            1           2d22h
[root@master kubeimooc]# kubectl describe deployment -n kubeimooc-system
Name:                   kubeimooc
Namespace:              kubeimooc-system
CreationTimestamp:      Thu, 12 Oct 2023 19:55:58 +0800
Labels:                 app=kubeimooc
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=kubeimooc
Replicas:               1 desired | 0 updated | 0 total | 0 available | 1 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app=kubeimooc
  Service Account:  kubeimooc-admin
  Containers:
   server:
    Image:        harbor.kubeimooc.com/kubeimooc/kubeimooc:v1.5
    Port:         8082/TCP
    Host Port:    0/TCP
    Environment:  <none>
    Mounts:       <none>
   web:
    Image:      harbor.kubeimooc.com/kubeimooc/kubeimooc-web:v1.0
    Port:       80/TCP
    Host Port:  0/TCP
    Environment:
      BACKEND_HOST:  http://127.0.0.1:8082/
    Mounts:          <none>
  Volumes:           <none>
Conditions:
  Type             Status  Reason
  ----             ------  ------
  Progressing      True    NewReplicaSetCreated
  Available        False   MinimumReplicasUnavailable
  ReplicaFailure   True    FailedCreate
OldReplicaSets:    <none>
NewReplicaSet:     kubeimooc-5f6f8c7f44 (0/1 replicas created)
Events:
  Type    Reason             Age    From                   Message
  ----    ------             ----   ----                   -------
  Normal  ScalingReplicaSet  8m37s  deployment-controller  Scaled up replica set kubeimooc-5f6f8c7f44 to 1

deployment.yaml文件内容是

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubeimooc
  namespace: kubeimooc-system
  labels:
    app: kubeimooc
spec:
  selector:
    matchLabels:
      app: kubeimooc
  template:
    metadata:
      labels:
        app: kubeimooc
    spec:
      serviceAccount: kubeimooc-admin
      imagePullSecrets:
        - name: private-harbor-reg
      containers:
        - name: server
          image: harbor.kubeimooc.com/kubeimooc/kubeimooc:v1.5
          ports:
            - name: port0
              containerPort: 8082
        - name: web
          image: harbor.kubeimooc.com/kubeimooc/kubeimooc-web:v1.0
          env:
            - name: BACKEND_HOST
              value: http://127.0.0.1:8082/
          ports:
            - name: port0
              containerPort: 80

正在回答 回答被采纳积分+3

1回答

暮闲 2023-10-12 22:49:23

同学你好 查看一下pod:

kubectl get pod -n kubeimooc-system

然后查看对应pod异常的日志,截图我看看

0 回复 有任何疑惑可以回复我~
  • 提问者 慕后端4419857 #1
    老师 你好,我在第一个代码块的三 四行有查询。
    [root@master kubeimooc]# kubectl get pod -n kubeimooc-system
    No resources found in kubeimooc-system namespace.
    回复 有任何疑惑可以回复我~ 2023-10-13 11:26:39
  • 暮闲 回复 提问者 慕后端4419857 #2
    嗯嗯 看到了 你QQ私聊我一下方便吗 我给你远程看看
    回复 有任何疑惑可以回复我~ 2023-10-13 15:08:06

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信