OpenShift 4之アイドルポッド

  1. テスト対象のアプリケーションを作成し、その後、ポッドの数を表示し、アプリケーションにアクセスします。
$ oc new-project idle
$ oc new-app openshift/hello-openshift
$ oc expose svc hello-openshift
$  oc get pod
NAME                       READY   STATUS      RESTARTS   AGE
hello-openshift-1-deploy   0/1     Completed   0          5m25s
hello-openshift-1-rz4gf    1/1     Running     0          5m11s
$ curl $(oc get route hello-openshift -o template --template '{{.spec.host}}')
Hello OpenShift!
  1. POCに実行しているアプリケーションの数が「0」に減少しました
$ oc idle hello-openshift
The service "idle-app/hello-openshift" has been marked as idled
The service will unidle DeploymentConfig "idle-app/hello-openshift" to 1 replicas once it receives traffic
DeploymentConfig "idle-app/hello-openshift" has been idled
$ oc get pod
NAME                       READY   STATUS        RESTARTS   AGE
hello-openshift-1-deploy   0/1     Completed     0          3m53s
  1. 再度アプリケーションにアクセスし、識別され、アクセス、およびポッドの数を復元します。
$ curl $(oc get route hello-openshift -o template --template '{{.spec.host}}')
Hello OpenShift!
NAME                       READY   STATUS      RESTARTS   AGE
hello-openshift-1-blgzf    1/1     Running     0          32s
hello-openshift-1-deploy   0/1     Completed   0          18m
公開された54元の記事 ウォンの賞賛0 ビュー1108

おすすめ

転載: blog.csdn.net/weixin_43902588/article/details/103748020