[英]Adding environment variables to already deployed application in OpenShift
[英]Is there a command to get the pods details for a specific service deployed on openshift
目前,我需要從jenkins管道中獲取為現有服務運行的Pod數量以及Pod狀態。 是否存在可以用於此目的的oc命令?
如果在應用程序的deploymentconfig
上運行oc describe
,則可以看到該應用程序的副本數。 例如:
$ oc describe dc/blog
Name: blog
Namespace: book
Created: 2 weeks ago
Labels: app=blog
Annotations: openshift.io/generated-by=OpenShiftNewApp
Latest Version: 1
Selector: app=blog,deploymentconfig=blog
Replicas: 1
Triggers: Config, Image(blog-django-py@latest, auto=true)
Strategy: Rolling
...
另請注意標簽。 運行oc get pods
時,可以使用標簽選擇器oc get pods
實際部署的pod列表。 例如:
$ oc get pods --selector app=blog
NAME READY STATUS RESTARTS AGE
blog-1-vqj1x 1/1 Running 0 15d
這將顯示窗格的狀態。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.