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.

122 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. revisionHistoryLimit: 10
  16. selector:
  17. app: ${APPLICATION_NAME}
  18. deploymentconfig: ${APPLICATION_NAME}
  19. strategy:
  20. activeDeadlineSeconds: 21600
  21. resources: {}
  22. rollingParams:
  23. intervalSeconds: 1
  24. maxSurge: 25%
  25. maxUnavailable: 25%
  26. timeoutSeconds: 600
  27. updatePeriodSeconds: 1
  28. type: Rolling
  29. template:
  30. metadata:
  31. labels:
  32. app: ${APPLICATION_NAME}
  33. deploymentconfig: ${APPLICATION_NAME}
  34. spec:
  35. containers:
  36. - image: ${APPLICATION_NAME}:latest
  37. imagePullPolicy: Always
  38. name: ${APPLICATION_NAME}
  39. ports:
  40. - containerPort: 27017
  41. protocol: TCP
  42. resources: {}
  43. terminationMessagePath: /dev/termination-log
  44. terminationMessagePolicy: File
  45. volumeMounts:
  46. - mountPath: /data/configdb
  47. name: ${APPLICATION_NAME}-volume-1
  48. - mountPath: /data/db
  49. name: ${APPLICATION_NAME}-volume-2
  50. dnsPolicy: ClusterFirst
  51. restartPolicy: Always
  52. schedulerName: default-scheduler
  53. securityContext: {}
  54. terminationGracePeriodSeconds: 30
  55. volumes:
  56. - emptyDir: {}
  57. name: ${APPLICATION_NAME}-volume-1
  58. - emptyDir: {}
  59. name: ${APPLICATION_NAME}-volume-2
  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: 27017-tcp
  81. port: 27017
  82. protocol: TCP
  83. targetPort: 27017
  84. selector:
  85. app: ${APPLICATION_NAME}
  86. deploymentconfig: ${APPLICATION_NAME}
  87. sessionAffinity: None
  88. type: ClusterIP
  89. - apiVersion: image.openshift.io/v1
  90. kind: ImageStream
  91. metadata:
  92. labels:
  93. app: ${APPLICATION_NAME}
  94. template: ${TEMPLATE_NAME}
  95. name: ${APPLICATION_NAME}
  96. spec:
  97. lookupPolicy:
  98. local: false
  99. tags:
  100. - annotations:
  101. openshift.io/imported-from: mongo
  102. from:
  103. kind: DockerImage
  104. name: mongo
  105. importPolicy: {}
  106. name: latest
  107. referencePolicy:
  108. type: Source
  109. parameters:
  110. - description: The name for the application.
  111. displayName: Application Name
  112. name: APPLICATION_NAME
  113. required: true
  114. value: mongo
  115. - description: The OpenShift project name that is hosting the image registry.
  116. displayName: Image Registry Project Name
  117. name: IMAGE_REGISTRY_PROJECT_NAME
  118. required: true
  119. - description: The template name.
  120. displayName: Template Name
  121. name: TEMPLATE_NAME
  122. required: true
  123. value: mongo-db-deploy-template