You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.5 KiB

  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: ${TEMPLATE_NAME}
  5. objects:
  6. - apiVersion: apps.openshift.io/v1
  7. kind: DeploymentConfig
  8. metadata:
  9. labels:
  10. app: ${APPLICATION_NAME}
  11. template: ${TEMPLATE_NAME}
  12. name: ${APPLICATION_NAME}
  13. spec:
  14. replicas: 1
  15. selector:
  16. app: ${APPLICATION_NAME}
  17. deploymentconfig: ${APPLICATION_NAME}
  18. strategy:
  19. type: Rolling
  20. revisionHistoryLimit: 2
  21. template:
  22. metadata:
  23. labels:
  24. app: ${APPLICATION_NAME}
  25. deploymentconfig: ${APPLICATION_NAME}
  26. spec:
  27. containers:
  28. - env:
  29. - name: IdentityUrlExternal
  30. value: ${IDENTITY_URL_EXTERNAL}
  31. - name: IdentityUrl
  32. value: ${IDENTITY_URL}
  33. - name: EventBusConnection
  34. value: ${RABBITMQ_HOSTNAME}
  35. - name: PORT
  36. value: "8080"
  37. - name: GRPC_PORT
  38. value: "8081"
  39. - name: PATH_BASE
  40. value: /ordering-api
  41. - name: ConnectionString
  42. valueFrom:
  43. secretKeyRef:
  44. key: ConnectionString
  45. name: ordering-db-connection-secret
  46. image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  47. imagePullPolicy: Always
  48. name: ${APPLICATION_NAME}
  49. ports:
  50. - containerPort: 8080
  51. protocol: TCP
  52. - containerPort: 8081
  53. protocol: TCP
  54. resources: {}
  55. terminationMessagePath: /dev/termination-log
  56. terminationMessagePolicy: File
  57. dnsPolicy: ClusterFirst
  58. restartPolicy: Always
  59. schedulerName: default-scheduler
  60. securityContext: {}
  61. terminationGracePeriodSeconds: 30
  62. triggers:
  63. - type: ConfigChange
  64. - imageChangeParams:
  65. automatic: true
  66. containerNames:
  67. - ${APPLICATION_NAME}
  68. from:
  69. kind: ImageStreamTag
  70. name: ${APPLICATION_NAME}:latest
  71. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  72. type: ImageChange
  73. - apiVersion: v1
  74. kind: Service
  75. metadata:
  76. labels:
  77. app: ${APPLICATION_NAME}
  78. template: ${TEMPLATE_NAME}
  79. name: ${APPLICATION_NAME}
  80. spec:
  81. ports:
  82. - name: 8080-tcp
  83. port: 8080
  84. protocol: TCP
  85. targetPort: 8080
  86. - name: 8081-tcp-grpc
  87. port: 8081
  88. protocol: TCP
  89. targetPort: 8081
  90. selector:
  91. app: ${APPLICATION_NAME}
  92. deploymentconfig: ${APPLICATION_NAME}
  93. sessionAffinity: None
  94. type: ClusterIP
  95. status:
  96. loadBalancer: {}
  97. parameters:
  98. - description: The name for the application.
  99. displayName: Application Name
  100. name: APPLICATION_NAME
  101. required: true
  102. value: orderingapi
  103. - description: The OpenShift project name that is hosting the image registry.
  104. displayName: Image Registry Project Name
  105. name: IMAGE_REGISTRY_PROJECT_NAME
  106. required: true
  107. - description: The template name.
  108. displayName: Template Name
  109. name: TEMPLATE_NAME
  110. required: true
  111. value: orderingapi-deploy-template
  112. - description: The external URL of the Identity endpoint
  113. displayName: Identity URL External
  114. name: IDENTITY_URL_EXTERNAL
  115. required: true
  116. - description: The cluster internal URL of the Identity endpoint
  117. displayName: Identity URL
  118. name: IDENTITY_URL
  119. required: true
  120. - description: The hostname of the RabbitMQ service
  121. displayName: RabbitMQ Hostname
  122. name: RABBITMQ_HOSTNAME
  123. required: true