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.

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