程序发布之后会有两个pod,一个为deploy,一个为真实程序pod
成功:deploy-pod状态变为Completed,程序pod 保留,状态为通过健康检查的Running,
失败:deploy-pod状态为Error,程序pod会删掉,所以排查问题时候要尽快查看pod的日志,不一会出现问题的pod就会被自动删除了的

DC

  1. apiVersion: apps.openshift.io/v1
  2. kind: DeploymentConfig
  3. metadata:
  4. name: hr
  5. generation: 54
  6. labels:
  7. run: hr
  8. namespace: erp-debug
  9. resourceVersion: '357152110'
  10. creationTimestamp: '2021-09-16T12:19:59Z'
  11. selfLink: /apis/apps.openshift.io/v1/namespaces/erp-debug/deploymentconfigs/hr
  12. uid: 70ab62a0-6cc2-4e25-8572-90a8f5d3cfdc
  13. spec:
  14. triggers:
  15. - type: ConfigChange
  16. replicas: 1
  17. selector:
  18. run: hr
  19. template:
  20. spec:
  21. dnsPolicy: None
  22. securityContext: {}
  23. dnsConfig:
  24. nameservers:
  25. - 10.82.26.253
  26. - 10.82.26.252
  27. schedulerName: default-scheduler
  28. hostAliases:
  29. - ip: 127.0.0.1
  30. hostnames:
  31. - localhost
  32. terminationGracePeriodSeconds: 30
  33. restartPolicy: Always
  34. volumes:
  35. - emptyDir: {}
  36. name: applogs
  37. containers:
  38. - livenessProbe:
  39. httpGet:
  40. path: /info
  41. scheme: HTTP
  42. port: 13001
  43. timeoutSeconds: 2
  44. initialDelaySeconds: 50
  45. periodSeconds: 5
  46. successThreshold: 1
  47. failureThreshold: 50
  48. terminationMessagePath: /dev/termination-log
  49. name: hr
  50. image: >-
  51. image-registry.openshift-image-registry.svc:5000/erp-debug/hr:20211009162752-22bad51
  52. args:
  53. - '-server'
  54. - '-jar'
  55. - /app/erp/hr.jar
  56. - '--eureka.client.serviceUrl.defaultZone=http://10.83.10.12:18761'
  57. - '--eureka.instance.ip-address=hr.erp-debug.apps.ocp4.ky-tech.com.cn'
  58. - '--eureka.instance.non-secure-port=80'
  59. volumeMounts:
  60. - mountPath: /app/logs/
  61. name: applogs
  62. terminationMessagePolicy: File
  63. command:
  64. - /jdk/bin/java
  65. env:
  66. - name: TZ
  67. value: Asia/Shanghai
  68. imagePullPolicy: Always
  69. readinessProbe:
  70. httpGet:
  71. path: /info
  72. scheme: HTTP
  73. port: 13001
  74. timeoutSeconds: 2
  75. initialDelaySeconds: 50
  76. periodSeconds: 5
  77. successThreshold: 1
  78. failureThreshold: 5
  79. ports:
  80. - protocol: TCP
  81. containerPort: 13001
  82. resources:
  83. requests:
  84. cpu: '2'
  85. memory: 4G
  86. limits:
  87. cpu: '2'
  88. memory: 4G
  89. metadata:
  90. labels:
  91. run: hr
  92. creationTimestamp: null
  93. test: false
  94. revisionHistoryLimit: 4
  95. strategy:
  96. activeDeadlineSeconds: 21600
  97. rollingParams:
  98. maxUnavailable: 25%
  99. maxSurge: 100%
  100. updatePeriodSeconds: 1
  101. intervalSeconds: 1
  102. timeoutSeconds: 600
  103. type: Rolling
  104. resources: {}
  105. status:
  106. replicas: 1
  107. observedGeneration: 54
  108. updatedReplicas: 1
  109. availableReplicas: 1
  110. details:
  111. message: config change
  112. causes:
  113. - type: ConfigChange
  114. latestVersion: 54
  115. readyReplicas: 1
  116. conditions:
  117. - status: 'True'
  118. lastTransitionTime: '2021-10-08T11:08:17Z'
  119. message: Deployment config has minimum availability.
  120. type: Available
  121. lastUpdateTime: '2021-10-08T11:08:17Z'
  122. - status: 'True'
  123. lastUpdateTime: '2021-10-09T08:33:39Z'
  124. lastTransitionTime: '2021-10-09T08:33:37Z'
  125. reason: NewReplicationControllerAvailable
  126. message: replication controller "hr-54" successfully rolled out
  127. type: Progressing
  128. unavailableReplicas: 0

Service

  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: hr
  5. labels:
  6. run: hr
  7. namespace: erp-debug
  8. resourceVersion: '4112947'
  9. creationTimestamp: '2020-07-20T03:57:11Z'
  10. annotations:
  11. kubectl.kubernetes.io/last-applied-configuration: >
  12. {"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"}}
  13. selfLink: /api/v1/namespaces/erp-debug/services/hr
  14. uid: 3936a06e-ded4-4aeb-be94-8c080a4d0c37
  15. spec:
  16. clusterIP: 172.31.253.138
  17. sessionAffinity: None
  18. type: ClusterIP
  19. ports:
  20. - targetPort: 13001
  21. protocol: TCP
  22. name: tcp
  23. port: 13001
  24. selector:
  25. run: hr
  26. status:
  27. loadBalancer: {}

Router

  1. apiVersion: route.openshift.io/v1
  2. kind: Route
  3. metadata:
  4. name: hr.erp-debug.apps.ocp4.ky-tech.com.cn
  5. labels:
  6. run: hr
  7. namespace: erp-debug
  8. resourceVersion: '3768781'
  9. creationTimestamp: '2020-07-19T15:18:38Z'
  10. annotations:
  11. kubectl.kubernetes.io/last-applied-configuration: >
  12. {"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"}}
  13. selfLink: >-
  14. /apis/route.openshift.io/v1/namespaces/erp-debug/routes/hr.erp-debug.apps.ocp4.ky-tech.com.cn
  15. uid: 345b8a06-14f2-4f14-ad75-670c8c6566d2
  16. spec:
  17. to:
  18. kind: Service
  19. name: hr
  20. weight: 100
  21. host: hr.erp-debug.apps.ocp4.ky-tech.com.cn
  22. port:
  23. targetPort: tcp
  24. wildcardPolicy: None
  25. status:
  26. ingress:
  27. - routerName: default
  28. host: hr.erp-debug.apps.ocp4.ky-tech.com.cn
  29. routerCanonicalHostname: apps.ocp4.ky-tech.com.cn
  30. conditions:
  31. - status: 'True'
  32. lastTransitionTime: '2020-07-19T15:18:39Z'
  33. type: Admitted
  34. wildcardPolicy: None