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.

120 lines
3.4 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. - name: PORT
  38. value: 8080
  39. - name: GRPC_PORT
  40. value: 5001
  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. - name: 8081-tcp-grpc
  80. port: 8081
  81. protocol: TCP
  82. targetPort: 8081
  83. selector:
  84. app: ${APPLICATION_NAME}
  85. deploymentconfig: ${APPLICATION_NAME}
  86. sessionAffinity: None
  87. type: ClusterIP
  88. status:
  89. loadBalancer: {}
  90. parameters:
  91. - description: The name for the application.
  92. displayName: Application Name
  93. name: APPLICATION_NAME
  94. required: true
  95. value: basketapi
  96. - description: The OpenShift project name that is hosting the image registry.
  97. displayName: Image Registry Project Name
  98. name: IMAGE_REGISTRY_PROJECT_NAME
  99. required: true
  100. - description: The template name.
  101. displayName: Template Name
  102. name: TEMPLATE_NAME
  103. required: true
  104. value: basketapi-deploy-template
  105. - description: The external URL of the Identity endpoint
  106. displayName: Identity URL External
  107. name: IDENTITY_URL_EXTERNAL
  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 hostname of the Redis service
  114. displayName: Redis Hostname
  115. name: REDIS_HOSTNAME
  116. required: true
  117. - description: The hostname of the RabbitMQ service
  118. displayName: RabbitMQ Hostname
  119. name: RABBITMQ_HOSTNAME
  120. required: true