0

我有一个 Openshift 集群。我创建了一个自定义应用程序并尝试使用 Helm 图表部署它。当我使用“ oc new-app ”在 Openshift 上部署它时,部署工作得非常好。但是当我使用 helm chart 部署它时,它不起作用。

以下是' oc get all '的输出----

[root@worker2 ~]#
[root@worker2 ~]# oc get all
NAME                                       READY   STATUS             RESTARTS   AGE
pod/chart-acme-85648d4645-7msdl            1/1     Running            0          3d7h
pod/chart1-acme-f8b65b78d-k2fb6            1/1     Running            0          3d7h
pod/netshoot                               1/1     Running            0          3d10h
pod/sample1-buildachart-5b5d9d8649-qqmsf   0/1     CrashLoopBackOff   672        2d9h
pod/sample2-686bb7f969-fx5bk               0/1     CrashLoopBackOff   674        2d9h
pod/vjobs-npm-96b65fcb-b2p27               0/1     CrashLoopBackOff   817        47h

NAME                          TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
service/chart-acme            LoadBalancer   172.30.174.208   <pending>     80:30222/TCP   3d7h
service/chart1-acme           LoadBalancer   172.30.153.36    <pending>     80:30383/TCP   3d7h
service/sample1-buildachart   NodePort       172.30.29.124    <none>        80:32375/TCP   2d9h
service/sample2               NodePort       172.30.19.24     <none>        80:32647/TCP   2d9h
service/vjobs-npm             NodePort       172.30.205.30    <none>        80:30476/TCP   47h

NAME                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/chart-acme            1/1     1            1           3d7h
deployment.apps/chart1-acme           1/1     1            1           3d7h
deployment.apps/sample1-buildachart   0/1     1            0           2d9h
deployment.apps/sample2               0/1     1            0           2d9h
deployment.apps/vjobs-npm             0/1     1            0           47h

NAME                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/chart-acme-85648d4645            1         1         1       3d7h
replicaset.apps/chart1-acme-f8b65b78d            1         1         1       3d7h
replicaset.apps/sample1-buildachart-5b5d9d8649   1         1         0       2d9h
replicaset.apps/sample2-686bb7f969               1         1         0       2d9h
replicaset.apps/vjobs-npm-96b65fcb               1         1         0       47h
[root@worker2 ~]#
[root@worker2 ~]#

根据上图,您可以看到部署 ' vjobs-npm ' 给出了 ' CrashLoopBackOff ' 错误。

下面是' oc describe pod '的输出----

[root@worker2 ~]#
[root@worker2 ~]# oc describe pod vjobs-npm-96b65fcb-b2p27
Name:         vjobs-npm-96b65fcb-b2p27
Namespace:    vjobs-testing
Priority:     0
Node:         worker0/192.168.100.109
Start Time:   Mon, 31 Aug 2020 09:30:28 -0400
Labels:       app.kubernetes.io/instance=vjobs-npm
              app.kubernetes.io/name=vjobs-npm
              pod-template-hash=96b65fcb
Annotations:  openshift.io/scc: restricted
Status:       Running
IP:           10.131.0.107
IPs:
  IP:           10.131.0.107
Controlled By:  ReplicaSet/vjobs-npm-96b65fcb
Containers:
  vjobs-npm:
    Container ID:   cri-o://c232849eb25bd96ae9343ac3ed1539d492985dd8cdf47a5a4df7d3cf776c4cf3
    Image:          quay.io/aditya7002/vjobs_local_build_new:latest
    Image ID:       quay.io/aditya7002/vjobs_local_build_new@sha256:87f18e3a24fc7043a43a143e96b0b069db418ace027d95a5427cf53de56feb4c
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Mon, 31 Aug 2020 09:31:23 -0400
    Last State:     Terminated
      Reason:       Error
      Exit Code:    137
      Started:      Mon, 31 Aug 2020 09:30:31 -0400
      Finished:     Mon, 31 Aug 2020 09:31:22 -0400
    Ready:          False
    Restart Count:  1
    Liveness:       http-get http://:http/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:http/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from vjobs-npm-token-vw6f7 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  vjobs-npm-token-vw6f7:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  vjobs-npm-token-vw6f7
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  68s                default-scheduler  Successfully assigned vjobs-testing/vjobs-npm-96b65fcb-b2p27 to worker0
  Normal   Killing    44s                kubelet, worker0   Container vjobs-npm failed liveness probe, will be restarted
  Normal   Pulling    14s (x2 over 66s)  kubelet, worker0   Pulling image "quay.io/aditya7002/vjobs_local_build_new:latest"
  Normal   Pulled     13s (x2 over 65s)  kubelet, worker0   Successfully pulled image "quay.io/aditya7002/vjobs_local_build_new:latest"
  Normal   Created    13s (x2 over 65s)  kubelet, worker0   Created container vjobs-npm
  Normal   Started    13s (x2 over 65s)  kubelet, worker0   Started container vjobs-npm
  Warning  Unhealthy  4s (x4 over 64s)   kubelet, worker0   Liveness probe failed: Get http://10.131.0.107:80/: dial tcp 10.131.0.107:80:
 connect: connection refused
  Warning  Unhealthy  1s (x7 over 61s)   kubelet, worker0   Readiness probe failed: Get http://10.131.0.107:80/: dial tcp 10.131.0.107:80
: connect: connection refused
[root@worker2 ~]#
4

0 回答 0