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.

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