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.

119 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: ConnectionString
  30. value: ${MONGO_DB_CONNECTION_STRING}
  31. - name: Database
  32. value: ${LOCATIONS_DB_NAME}
  33. - name: IdentityUrl
  34. value: ${IDENTITY_URL}
  35. - name: IdentityUrlExternal
  36. value: ${IDENTITY_URL_EXTERNAL}
  37. - name: EventBusConnection
  38. value: ${RABBITMQ_HOSTNAME}
  39. - name: PATH_BASE
  40. value: /locations-api
  41. image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  42. imagePullPolicy: Always
  43. name: ${APPLICATION_NAME}
  44. ports:
  45. - containerPort: 8080
  46. protocol: TCP
  47. resources: {}
  48. terminationMessagePath: /dev/termination-log
  49. terminationMessagePolicy: File
  50. dnsPolicy: ClusterFirst
  51. restartPolicy: Always
  52. schedulerName: default-scheduler
  53. securityContext: {}
  54. terminationGracePeriodSeconds: 30
  55. triggers:
  56. - type: ConfigChange
  57. - imageChangeParams:
  58. automatic: true
  59. containerNames:
  60. - ${APPLICATION_NAME}
  61. from:
  62. kind: ImageStreamTag
  63. name: ${APPLICATION_NAME}:latest
  64. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  65. type: ImageChange
  66. - apiVersion: v1
  67. kind: Service
  68. metadata:
  69. labels:
  70. app: ${APPLICATION_NAME}
  71. template: ${TEMPLATE_NAME}
  72. name: ${APPLICATION_NAME}
  73. spec:
  74. ports:
  75. - name: 8080-tcp
  76. port: 8080
  77. protocol: TCP
  78. targetPort: 8080
  79. selector:
  80. app: ${APPLICATION_NAME}
  81. deploymentconfig: ${APPLICATION_NAME}
  82. sessionAffinity: None
  83. type: ClusterIP
  84. status:
  85. loadBalancer: {}
  86. parameters:
  87. - description: The name for the application.
  88. displayName: Application Name
  89. name: APPLICATION_NAME
  90. required: true
  91. value: locationsapi
  92. - description: The OpenShift project name that is hosting the image registry.
  93. displayName: Image Registry Project Name
  94. name: IMAGE_REGISTRY_PROJECT_NAME
  95. required: true
  96. - description: The template name.
  97. displayName: Template Name
  98. name: TEMPLATE_NAME
  99. required: true
  100. value: locationsapi-deploy-template
  101. - description: The connection string to the MongoDB Marketing database
  102. displayName: MongoDB Connection String
  103. name: MONGO_DB_CONNECTION_STRING
  104. required: true
  105. - description: The Locations database name
  106. displayName: Locations Database Name
  107. name: LOCATIONS_DB_NAME
  108. required: true
  109. - description: The cluster internal URL of the Identity endpoint
  110. displayName: Identity URL
  111. name: IDENTITY_URL
  112. required: true
  113. - description: The external URL of the Identity endpoint
  114. displayName: Identity URL External
  115. name: IDENTITY_URL_EXTERNAL
  116. required: true
  117. - description: The hostname of the RabbitMQ service
  118. displayName: RabbitMQ Hostname
  119. name: RABBITMQ_HOSTNAME
  120. required: true