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.

86 lines
2.3 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. - image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  29. imagePullPolicy: Always
  30. name: ${APPLICATION_NAME}
  31. ports:
  32. - containerPort: 8080
  33. protocol: TCP
  34. resources: {}
  35. terminationMessagePath: /dev/termination-log
  36. terminationMessagePolicy: File
  37. dnsPolicy: ClusterFirst
  38. restartPolicy: Always
  39. schedulerName: default-scheduler
  40. securityContext: {}
  41. terminationGracePeriodSeconds: 30
  42. triggers:
  43. - type: ConfigChange
  44. - imageChangeParams:
  45. automatic: true
  46. containerNames:
  47. - ${APPLICATION_NAME}
  48. from:
  49. kind: ImageStreamTag
  50. name: ${APPLICATION_NAME}:latest
  51. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  52. type: ImageChange
  53. - apiVersion: v1
  54. kind: Service
  55. metadata:
  56. labels:
  57. app: ${APPLICATION_NAME}
  58. template: ${TEMPLATE_NAME}
  59. name: ${APPLICATION_NAME}
  60. spec:
  61. ports:
  62. - name: 8080-tcp
  63. port: 8080
  64. protocol: TCP
  65. targetPort: 8080
  66. selector:
  67. app: ${APPLICATION_NAME}
  68. deploymentconfig: ${APPLICATION_NAME}
  69. sessionAffinity: None
  70. type: ClusterIP
  71. status:
  72. loadBalancer: {}
  73. parameters:
  74. - description: The name for the application.
  75. displayName: Application Name
  76. name: APPLICATION_NAME
  77. required: true
  78. - description: The OpenShift project name that is hosting the image registry.
  79. displayName: Image Registry Project Name
  80. name: IMAGE_REGISTRY_PROJECT_NAME
  81. required: true
  82. - description: The template name.
  83. displayName: Template Name
  84. name: TEMPLATE_NAME
  85. required: true
  86. value: webapp-template