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.

131 lines
3.5 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. volumes:
  28. - name: config
  29. configMap:
  30. name: ${APPLICATION_NAME}-config-map
  31. items:
  32. - key: envoy.yaml
  33. path: envoy.yaml
  34. containers:
  35. - env:
  36. - name: PATH_BASE
  37. value: /${APPLICATION_NAME}
  38. image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest
  39. imagePullPolicy: Always
  40. name: ${APPLICATION_NAME}
  41. volumeMounts:
  42. - name: config
  43. mountPath: /etc/envoy
  44. ports:
  45. - containerPort: 8080
  46. protocol: TCP
  47. - containerPort: 8001
  48. protocol: TCP
  49. resources: {}
  50. terminationMessagePath: /dev/termination-log
  51. terminationMessagePolicy: File
  52. volumes:
  53. - name: config
  54. configMap:
  55. name: ${APPLICATION_NAME}-config-map
  56. items:
  57. - key: envoy.yaml
  58. path: envoy.yaml
  59. dnsPolicy: ClusterFirst
  60. restartPolicy: Always
  61. schedulerName: default-scheduler
  62. securityContext: {}
  63. terminationGracePeriodSeconds: 30
  64. triggers:
  65. - type: ConfigChange
  66. - imageChangeParams:
  67. automatic: true
  68. containerNames:
  69. - ${APPLICATION_NAME}
  70. from:
  71. kind: ImageStreamTag
  72. name: ${APPLICATION_NAME}:latest
  73. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  74. type: ImageChange
  75. - apiVersion: v1
  76. kind: Service
  77. metadata:
  78. labels:
  79. app: ${APPLICATION_NAME}
  80. template: ${TEMPLATE_NAME}
  81. name: ${APPLICATION_NAME}
  82. spec:
  83. ports:
  84. - name: 8080-tcp
  85. port: 8080
  86. protocol: TCP
  87. targetPort: 8080
  88. - name: 8001-tcp
  89. port: 8001
  90. protocol: TCP
  91. targetPort: 8001
  92. selector:
  93. app: ${APPLICATION_NAME}
  94. deploymentconfig: ${APPLICATION_NAME}
  95. sessionAffinity: None
  96. type: ClusterIP
  97. status:
  98. loadBalancer: {}
  99. - apiVersion: image.openshift.io/v1
  100. kind: ImageStream
  101. metadata:
  102. labels:
  103. app: ${APPLICATION_NAME}
  104. template: ${TEMPLATE_NAME}
  105. name: ${APPLICATION_NAME}
  106. spec:
  107. lookupPolicy:
  108. local: false
  109. tags:
  110. - annotations:
  111. openshift.io/imported-from: 'envoyproxy/envoy:v1.11.1'
  112. from:
  113. kind: DockerImage
  114. name: 'envoyproxy/envoy:v1.11.1'
  115. importPolicy: {}
  116. name: latest
  117. referencePolicy:
  118. type: Source
  119. parameters:
  120. - description: The name for the application.
  121. displayName: Application Name
  122. name: APPLICATION_NAME
  123. required: true
  124. - description: The OpenShift project name that is hosting the image registry.
  125. displayName: Image Registry Project Name
  126. name: IMAGE_REGISTRY_PROJECT_NAME
  127. required: true
  128. - description: The template name.
  129. displayName: Template Name
  130. name: TEMPLATE_NAME
  131. required: true
  132. value: apigw-deploy-template