程序发布之后会有两个pod,一个为deploy,一个为真实程序pod
成功:deploy-pod状态变为Completed,程序pod 保留,状态为通过健康检查的Running,
失败:deploy-pod状态为Error,程序pod会删掉,所以排查问题时候要尽快查看pod的日志,不一会出现问题的pod就会被自动删除了的
DC
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: hr
generation: 54
labels:
run: hr
namespace: erp-debug
resourceVersion: '357152110'
creationTimestamp: '2021-09-16T12:19:59Z'
selfLink: /apis/apps.openshift.io/v1/namespaces/erp-debug/deploymentconfigs/hr
uid: 70ab62a0-6cc2-4e25-8572-90a8f5d3cfdc
spec:
triggers:
- type: ConfigChange
replicas: 1
selector:
run: hr
template:
spec:
dnsPolicy: None
securityContext: {}
dnsConfig:
nameservers:
- 10.82.26.253
- 10.82.26.252
schedulerName: default-scheduler
hostAliases:
- ip: 127.0.0.1
hostnames:
- localhost
terminationGracePeriodSeconds: 30
restartPolicy: Always
volumes:
- emptyDir: {}
name: applogs
containers:
- livenessProbe:
httpGet:
path: /info
scheme: HTTP
port: 13001
timeoutSeconds: 2
initialDelaySeconds: 50
periodSeconds: 5
successThreshold: 1
failureThreshold: 50
terminationMessagePath: /dev/termination-log
name: hr
image: >-
image-registry.openshift-image-registry.svc:5000/erp-debug/hr:20211009162752-22bad51
args:
- '-server'
- '-jar'
- /app/erp/hr.jar
- '--eureka.client.serviceUrl.defaultZone=http://10.83.10.12:18761'
- '--eureka.instance.ip-address=hr.erp-debug.apps.ocp4.ky-tech.com.cn'
- '--eureka.instance.non-secure-port=80'
volumeMounts:
- mountPath: /app/logs/
name: applogs
terminationMessagePolicy: File
command:
- /jdk/bin/java
env:
- name: TZ
value: Asia/Shanghai
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /info
scheme: HTTP
port: 13001
timeoutSeconds: 2
initialDelaySeconds: 50
periodSeconds: 5
successThreshold: 1
failureThreshold: 5
ports:
- protocol: TCP
containerPort: 13001
resources:
requests:
cpu: '2'
memory: 4G
limits:
cpu: '2'
memory: 4G
metadata:
labels:
run: hr
creationTimestamp: null
test: false
revisionHistoryLimit: 4
strategy:
activeDeadlineSeconds: 21600
rollingParams:
maxUnavailable: 25%
maxSurge: 100%
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
type: Rolling
resources: {}
status:
replicas: 1
observedGeneration: 54
updatedReplicas: 1
availableReplicas: 1
details:
message: config change
causes:
- type: ConfigChange
latestVersion: 54
readyReplicas: 1
conditions:
- status: 'True'
lastTransitionTime: '2021-10-08T11:08:17Z'
message: Deployment config has minimum availability.
type: Available
lastUpdateTime: '2021-10-08T11:08:17Z'
- status: 'True'
lastUpdateTime: '2021-10-09T08:33:39Z'
lastTransitionTime: '2021-10-09T08:33:37Z'
reason: NewReplicationControllerAvailable
message: replication controller "hr-54" successfully rolled out
type: Progressing
unavailableReplicas: 0
Service
apiVersion: v1
kind: Service
metadata:
name: hr
labels:
run: hr
namespace: erp-debug
resourceVersion: '4112947'
creationTimestamp: '2020-07-20T03:57:11Z'
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"run":"hr"},"name":"hr","namespace":"erp-debug"},"spec":{"ports":[{"name":"tcp","port":13001,"protocol":"TCP","targetPort":13001}],"selector":{"run":"hr"},"sessionAffinity":"None","type":"ClusterIP"}}
selfLink: /api/v1/namespaces/erp-debug/services/hr
uid: 3936a06e-ded4-4aeb-be94-8c080a4d0c37
spec:
clusterIP: 172.31.253.138
sessionAffinity: None
type: ClusterIP
ports:
- targetPort: 13001
protocol: TCP
name: tcp
port: 13001
selector:
run: hr
status:
loadBalancer: {}
Router
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: hr.erp-debug.apps.ocp4.ky-tech.com.cn
labels:
run: hr
namespace: erp-debug
resourceVersion: '3768781'
creationTimestamp: '2020-07-19T15:18:38Z'
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"route.openshift.io/v1","kind":"Route","metadata":{"annotations":{},"labels":{"run":"hr"},"name":"hr.erp-debug.apps.ocp4.ky-tech.com.cn","namespace":"erp-debug"},"spec":{"host":"hr.erp-debug.apps.ocp4.ky-tech.com.cn","port":{"targetPort":"tcp"},"to":{"kind":"Service","name":"hr","weight":100},"wildcardPolicy":"None"}}
selfLink: >-
/apis/route.openshift.io/v1/namespaces/erp-debug/routes/hr.erp-debug.apps.ocp4.ky-tech.com.cn
uid: 345b8a06-14f2-4f14-ad75-670c8c6566d2
spec:
to:
kind: Service
name: hr
weight: 100
host: hr.erp-debug.apps.ocp4.ky-tech.com.cn
port:
targetPort: tcp
wildcardPolicy: None
status:
ingress:
- routerName: default
host: hr.erp-debug.apps.ocp4.ky-tech.com.cn
routerCanonicalHostname: apps.ocp4.ky-tech.com.cn
conditions:
- status: 'True'
lastTransitionTime: '2020-07-19T15:18:39Z'
type: Admitted
wildcardPolicy: None