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.

156 lines
4.3 KiB

5 years ago
  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: PicBaseUrl
  30. value: ${PIC_BASE_URL}
  31. - name: EventBusConnection
  32. value: ${RABBITMQ_HOSTNAME}
  33. - name: PORT
  34. value: "8080"
  35. - name: GRPC_PORT
  36. value: "8081"
  37. - name: PATH_BASE
  38. value: /catalog-api
  39. - name: ConnectionString
  40. valueFrom:
  41. secretKeyRef:
  42. key: ConnectionString
  43. name: catalog-db-connection-secret
  44. image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  45. imagePullPolicy: Always
  46. name: ${APPLICATION_NAME}
  47. ports:
  48. - containerPort: 8080
  49. protocol: TCP
  50. - containerPort: 8081
  51. protocol: TCP
  52. resources: {}
  53. terminationMessagePath: /dev/termination-log
  54. terminationMessagePolicy: File
  55. dnsPolicy: ClusterFirst
  56. restartPolicy: Always
  57. schedulerName: default-scheduler
  58. securityContext: {}
  59. terminationGracePeriodSeconds: 30
  60. triggers:
  61. - type: ConfigChange
  62. - imageChangeParams:
  63. automatic: true
  64. containerNames:
  65. - ${APPLICATION_NAME}
  66. from:
  67. kind: ImageStreamTag
  68. name: ${APPLICATION_NAME}:latest
  69. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  70. type: ImageChange
  71. - apiVersion: v1
  72. kind: Service
  73. metadata:
  74. labels:
  75. app: ${APPLICATION_NAME}
  76. template: ${TEMPLATE_NAME}
  77. name: ${APPLICATION_NAME}
  78. spec:
  79. ports:
  80. - name: 8080-tcp
  81. port: 8080
  82. protocol: TCP
  83. targetPort: 8080
  84. - name: 8081-tcp-grpc
  85. port: 8081
  86. protocol: TCP
  87. targetPort: 8081
  88. selector:
  89. app: ${APPLICATION_NAME}
  90. deploymentconfig: ${APPLICATION_NAME}
  91. sessionAffinity: None
  92. type: ClusterIP
  93. status:
  94. loadBalancer: {}
  95. - apiVersion: route.openshift.io/v1
  96. kind: Route
  97. metadata:
  98. labels:
  99. app: ${APPLICATION_NAME}
  100. template: ${TEMPLATE_NAME}
  101. name: catalog-public-route
  102. spec:
  103. host: ${CATALOG_PUBLIC_HOSTNAME}
  104. port:
  105. targetPort: 8080-tcp
  106. tls:
  107. caCertificate: |
  108. ${CA_CERTIFICATE}
  109. certificate: |
  110. ${CERTIFICATE}
  111. key: |
  112. ${PRIVATE_KEY}
  113. termination: edge
  114. to:
  115. kind: Service
  116. name: ${APPLICATION_NAME}
  117. weight: 100
  118. wildcardPolicy: None
  119. parameters:
  120. - description: The name for the application.
  121. displayName: Application Name
  122. name: APPLICATION_NAME
  123. required: true
  124. value: catalogapi
  125. - description: The OpenShift project name that is hosting the image registry.
  126. displayName: Image Registry Project Name
  127. name: IMAGE_REGISTRY_PROJECT_NAME
  128. required: true
  129. - description: The template name.
  130. displayName: Template Name
  131. name: TEMPLATE_NAME
  132. required: true
  133. value: catalogapi-deploy-template
  134. - description: The public base URL for the catalog pictures
  135. displayName: Pictures Base URL
  136. name: PIC_BASE_URL
  137. required: true
  138. - description: The hostname of the RabbitMQ service
  139. displayName: RabbitMQ Hostname
  140. name: RABBITMQ_HOSTNAME
  141. required: true
  142. - description: The public hostname of the Catalog route
  143. displayName: Catalog Public Hostname
  144. name: CATALOG_PUBLIC_HOSTNAME
  145. required: true
  146. - description: The CA Certificate thumbprint value
  147. displayName: CA Certificate
  148. name: CA_CERTIFICATE
  149. required: true
  150. - description: The Certificate thumbprint value
  151. displayName: Certificate
  152. name: CERTIFICATE
  153. required: true
  154. - description: The private key thumbprint value for the certificate
  155. displayName: Private Key
  156. name: PRIVATE_KEY
  157. required: true