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.

142 lines
3.7 KiB

  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: ${TEMPLATE_NAME}
  5. objects:
  6. - apiVersion: v1
  7. kind: PersistentVolumeClaim
  8. metadata:
  9. labels:
  10. app: ${APPLICATION_NAME}
  11. template: ${TEMPLATE_NAME}
  12. name: sql-storage-claim
  13. spec:
  14. accessModes:
  15. - ReadWriteOnce
  16. resources:
  17. requests:
  18. storage: 1Gi
  19. - apiVersion: apps.openshift.io/v1
  20. kind: DeploymentConfig
  21. metadata:
  22. labels:
  23. app: ${APPLICATION_NAME}
  24. template: ${TEMPLATE_NAME}
  25. name: ${APPLICATION_NAME}
  26. spec:
  27. replicas: 1
  28. revisionHistoryLimit: 10
  29. selector:
  30. app: ${APPLICATION_NAME}
  31. deploymentconfig: ${APPLICATION_NAME}
  32. strategy:
  33. activeDeadlineSeconds: 21600
  34. resources: {}
  35. rollingParams:
  36. intervalSeconds: 1
  37. maxSurge: 25%
  38. maxUnavailable: 25%
  39. timeoutSeconds: 600
  40. updatePeriodSeconds: 1
  41. type: Rolling
  42. template:
  43. metadata:
  44. labels:
  45. app: ${APPLICATION_NAME}
  46. deploymentconfig: ${APPLICATION_NAME}
  47. spec:
  48. containers:
  49. - env:
  50. - name: ACCEPT_EULA
  51. value: 'Y'
  52. - name: SA_PASSWORD
  53. valueFrom:
  54. secretKeyRef:
  55. key: SA_PASSWORD
  56. name: sa-password-secret
  57. envFrom:
  58. - secretRef:
  59. name: sa-password-secret
  60. image: mcr.microsoft.com/mssql/server:latest
  61. imagePullPolicy: IfNotPresent
  62. name: ${APPLICATION_NAME}
  63. ports:
  64. - containerPort: 1433
  65. protocol: TCP
  66. resources: {}
  67. terminationMessagePath: /dev/termination-log
  68. terminationMessagePolicy: File
  69. volumeMounts:
  70. - mountPath: /var/opt/mssql/
  71. name: sql-volume-01
  72. dnsPolicy: ClusterFirst
  73. restartPolicy: Always
  74. schedulerName: default-scheduler
  75. securityContext: {}
  76. terminationGracePeriodSeconds: 30
  77. volumes:
  78. - name: sql-volume-01
  79. persistentVolumeClaim:
  80. claimName: sql-storage-claim
  81. triggers:
  82. - type: ConfigChange
  83. - imageChangeParams:
  84. automatic: true
  85. containerNames:
  86. - ${APPLICATION_NAME}
  87. from:
  88. kind: ImageStreamTag
  89. name: '${APPLICATION_NAME}:latest'
  90. namespace: ${IMAGE_REGISTRY_PROJECT_NAME}
  91. type: ImageChange
  92. - apiVersion: v1
  93. kind: Service
  94. metadata:
  95. labels:
  96. app: ${APPLICATION_NAME}
  97. template: ${TEMPLATE_NAME}
  98. name: ${APPLICATION_NAME}
  99. spec:
  100. ports:
  101. - name: 1433-tcp
  102. port: 1433
  103. protocol: TCP
  104. targetPort: 1433
  105. selector:
  106. app: ${APPLICATION_NAME}
  107. deploymentconfig: ${APPLICATION_NAME}
  108. sessionAffinity: None
  109. type: ClusterIP
  110. - apiVersion: image.openshift.io/v1
  111. kind: ImageStream
  112. metadata:
  113. labels:
  114. app: ${APPLICATION_NAME}
  115. template: ${TEMPLATE_NAME}
  116. name: ${APPLICATION_NAME}
  117. spec:
  118. lookupPolicy:
  119. local: false
  120. tags:
  121. - annotations: null
  122. from:
  123. kind: DockerImage
  124. name: 'mcr.microsoft.com/mssql/server:2017-latest-ubuntu'
  125. importPolicy: {}
  126. name: latest
  127. referencePolicy:
  128. type: Source
  129. parameters:
  130. - description: The name for the application.
  131. displayName: Application Name
  132. name: APPLICATION_NAME
  133. required: true
  134. value: mssql-server
  135. - description: The OpenShift project name that is hosting the image registry.
  136. displayName: Image Registry Project Name
  137. name: IMAGE_REGISTRY_PROJECT_NAME
  138. required: true
  139. - description: The template name.
  140. displayName: Template Name
  141. name: TEMPLATE_NAME
  142. required: true
  143. value: mssql-server-deploy-template