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.

119 lines
3.1 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: IfNotPresent
  38. name: ${APPLICATION_NAME}
  39. ports:
  40. - containerPort: 6379
  41. protocol: TCP
  42. resources: {}
  43. terminationMessagePath: /dev/termination-log
  44. terminationMessagePolicy: File
  45. volumeMounts:
  46. - mountPath: /data
  47. name: ${APPLICATION_NAME}-volume-1
  48. dnsPolicy: ClusterFirst
  49. restartPolicy: Always
  50. schedulerName: default-scheduler
  51. securityContext: {}
  52. terminationGracePeriodSeconds: 30
  53. volumes:
  54. - emptyDir: {}
  55. name: ${APPLICATION_NAME}-volume-1
  56. triggers:
  57. - type: ConfigChange
  58. - imageChangeParams:
  59. automatic: true
  60. containerNames:
  61. - ${APPLICATION_NAME}
  62. from:
  63. kind: ImageStreamTag
  64. name: '${APPLICATION_NAME}:alpine'
  65. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  66. type: ImageChange
  67. - apiVersion: v1
  68. kind: Service
  69. metadata:
  70. labels:
  71. app: ${APPLICATION_NAME}
  72. template: ${TEMPLATE_NAME}
  73. name: ${APPLICATION_NAME}
  74. spec:
  75. ports:
  76. - name: 6379-tcp
  77. port: 6379
  78. protocol: TCP
  79. targetPort: 6379
  80. selector:
  81. app: ${APPLICATION_NAME}
  82. deploymentconfig: ${APPLICATION_NAME}
  83. sessionAffinity: None
  84. type: ClusterIP
  85. - apiVersion: image.openshift.io/v1
  86. kind: ImageStream
  87. metadata:
  88. labels:
  89. app: ${APPLICATION_NAME}
  90. template: ${TEMPLATE_NAME}
  91. name: ${APPLICATION_NAME}
  92. spec:
  93. lookupPolicy:
  94. local: false
  95. tags:
  96. - annotations:
  97. openshift.io/imported-from: '${APPLICATION_NAME}:alpine'
  98. from:
  99. kind: DockerImage
  100. name: '${APPLICATION_NAME}:alpine'
  101. generation: 2
  102. importPolicy: {}
  103. name: alpine
  104. referencePolicy:
  105. type: Source
  106. parameters:
  107. - description: The name for the application.
  108. displayName: Application Name
  109. name: APPLICATION_NAME
  110. required: true
  111. value: redis
  112. - description: The OpenShift project name that is hosting the image registry.
  113. displayName: Image Registry Project Name
  114. name: IMAGE_REGISTRY_PROJECT_NAME
  115. required: true
  116. - description: The template name.
  117. displayName: Template Name
  118. name: TEMPLATE_NAME
  119. required: true
  120. value: redis-deploy-template