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.

94 lines
2.6 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: EventBusConnection
  30. value: ${RABBITMQ_HOSTNAME}
  31. image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  32. imagePullPolicy: Always
  33. name: ${APPLICATION_NAME}
  34. ports:
  35. - containerPort: 8080
  36. protocol: TCP
  37. resources: {}
  38. terminationMessagePath: /dev/termination-log
  39. terminationMessagePolicy: File
  40. dnsPolicy: ClusterFirst
  41. restartPolicy: Always
  42. schedulerName: default-scheduler
  43. securityContext: {}
  44. terminationGracePeriodSeconds: 30
  45. triggers:
  46. - type: ConfigChange
  47. - imageChangeParams:
  48. automatic: true
  49. containerNames:
  50. - ${APPLICATION_NAME}
  51. from:
  52. kind: ImageStreamTag
  53. name: ${APPLICATION_NAME}:latest
  54. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  55. type: ImageChange
  56. - apiVersion: v1
  57. kind: Service
  58. metadata:
  59. labels:
  60. app: ${APPLICATION_NAME}
  61. template: ${TEMPLATE_NAME}
  62. name: ${APPLICATION_NAME}
  63. spec:
  64. ports:
  65. - name: 8080-tcp
  66. port: 8080
  67. protocol: TCP
  68. targetPort: 8080
  69. selector:
  70. app: ${APPLICATION_NAME}
  71. deploymentconfig: ${APPLICATION_NAME}
  72. sessionAffinity: None
  73. type: ClusterIP
  74. status:
  75. loadBalancer: {}
  76. parameters:
  77. - description: The name for the application.
  78. displayName: Application Name
  79. name: APPLICATION_NAME
  80. required: true
  81. value: paymentapi
  82. - description: The OpenShift project name that is hosting the image registry.
  83. displayName: Image Registry Project Name
  84. name: IMAGE_REGISTRY_PROJECT_NAME
  85. required: true
  86. - description: The template name.
  87. displayName: Template Name
  88. name: TEMPLATE_NAME
  89. required: true
  90. value: paymentapi-deploy-template
  91. - description: The hostname of the RabbitMQ service
  92. displayName: RabbitMQ Hostname
  93. name: RABBITMQ_HOSTNAME
  94. required: true