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.

79 lines
2.1 KiB

  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: 'api-template'
  5. objects:
  6. - apiVersion: apps.openshift.io/v1
  7. kind: DeploymentConfig
  8. metadata:
  9. labels:
  10. app: ${APPLICATION_NAME}
  11. name: ${APPLICATION_NAME}
  12. spec:
  13. replicas: 1
  14. selector:
  15. app: ${APPLICATION_NAME}
  16. deploymentconfig: ${APPLICATION_NAME}
  17. strategy:
  18. type: Rolling
  19. revisionHistoryLimit: 2
  20. template:
  21. metadata:
  22. labels:
  23. app: ${APPLICATION_NAME}
  24. deploymentconfig: ${APPLICATION_NAME}
  25. spec:
  26. containers:
  27. - image: docker-registry.default.svc:5000/development${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  28. imagePullPolicy: Always
  29. name: ${APPLICATION_NAME}
  30. ports:
  31. - containerPort: 8080
  32. protocol: TCP
  33. resources: {}
  34. terminationMessagePath: /dev/termination-log
  35. terminationMessagePolicy: File
  36. dnsPolicy: ClusterFirst
  37. restartPolicy: Always
  38. schedulerName: default-scheduler
  39. securityContext: {}
  40. terminationGracePeriodSeconds: 30
  41. triggers:
  42. - type: ConfigChange
  43. - imageChangeParams:
  44. automatic: true
  45. containerNames:
  46. - ${APPLICATION_NAME}
  47. from:
  48. kind: ImageStreamTag
  49. name: ${APPLICATION_NAME}:latest
  50. namespace: development
  51. type: ImageChange
  52. - apiVersion: v1
  53. kind: Service
  54. metadata:
  55. labels:
  56. app: ${APPLICATION_NAME}
  57. name: ${APPLICATION_NAME}
  58. spec:
  59. ports:
  60. - name: 8080-tcp
  61. port: 8080
  62. protocol: TCP
  63. targetPort: 8080
  64. selector:
  65. app: ${APPLICATION_NAME}
  66. deploymentconfig: ${APPLICATION_NAME}
  67. sessionAffinity: None
  68. type: ClusterIP
  69. status:
  70. loadBalancer: {}
  71. parameters:
  72. - description: The name for the application.
  73. displayName: Application Name
  74. name: APPLICATION_NAME
  75. required: true
  76. - description: The OpenShift project name that is hosting the image registry.
  77. displayName: Image Registry Project Name
  78. name: IMAGE_REGISTRY_PROJECT_NAME
  79. required: true