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